Page Menu
Home
Search
Configure Global Search
Log In
Files
F1540
drawview.c.diff
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Author
Juan Carlos Muro (jcmuro)
Created
Nov 13 2013, 12:58 PM
Size
5 KB
Mime Type
text/xdiff
Engine
localdisk
Format
Raw Data
Handle
50/57/0685d2b878bcb969f01dc4b992da
drawview.c.diff
View Options
 drawview.c Fri Apr 1 13:26:37 2005
+++ drawview_jc.c Fri Apr 1 13:37:11 2005
@@ 1073,6 +1073,14 @@
/* this one assumes there is only one editmode in blender... (for object panel) */
static float ve_median[4];
+/* (jcmuro) patching starts here */
+#define R_REFLOCAL 1
+#define R_REFGLOBAL 2
+#define R_REFCURSOR 3
+
+static short r_ref = 1; /* reference to (which radio button is selected) */
+static short r_refp = 1; /* previous reference (for monitoring of r_ref ) */
+
/* is used for both read and write... */
static void v3d_editvertex_buts(uiBlock *block, Object *ob, float lim)
{
@@ 1081,6 +1089,7 @@
EditEdge *eed;
float median[4];
int tot, totw, totedge;
+ float *curs;
median[0]= median[1]= median[2]= median[3]= 0.0;
tot= totw= totedge= 0;
@@ 1162,37 +1171,65 @@
if(totedge) median[3] /= (float)totedge;
else median[3] /= (float)tot;
+ switch(r_ref) {
+ case R_REFLOCAL:
+ /* (jcmuro) leave as is */
+ break;
+ case R_REFGLOBAL:
+ VecAddf(median, median, ob>loc);
+ break;
+ case R_REFCURSOR:
+ curs= give_cursor();
+ VecAddf(median, median, ob>loc);
+ VecSubf(median, median, curs);
+ break;
+ }
+
if(block) { // buttons
QUATCOPY(ve_median, median);
uiBlockBeginAlign(block);
 if(tot==1) {
 uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Vertex X:", 10, 140, 300, 19, &(ve_median[0]), lim, lim, 10, 3, "");
 uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Vertex Y:", 10, 120, 300, 19, &(ve_median[1]), lim, lim, 10, 3, "");
 uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Vertex Z:", 10, 100, 300, 19, &(ve_median[2]), lim, lim, 10, 3, "");
 if(totw==1)
 uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Vertex W:", 10, 80, 300, 19, &(ve_median[3]), 0.01, 100.0, 10, 3, "");
 }
 else {
 uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median X:", 10, 140, 300, 19, &(ve_median[0]), lim, lim, 10, 3, "");
 uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median Y:", 10, 120, 300, 19, &(ve_median[1]), lim, lim, 10, 3, "");
 uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median Z:", 10, 100, 300, 19, &(ve_median[2]), lim, lim, 10, 3, "");
 if(totw==tot)
 uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median W:", 10, 80, 300, 19, &(ve_median[3]), 0.01, 100.0, 10, 3, "");
 }
 uiBlockEndAlign(block);

 if(totedge==1)
 uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Crease W:", 10, 60, 300, 19, &(ve_median[3]), 0.0, 1.0, 10, 3, "");
 else if(totedge>1)
 uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median Crease W:", 10, 60, 300, 19, &(ve_median[3]), 0.0, 1.0, 10, 3, "");
+ uiDefBut (block, LABEL, 0, "Reference:", 10, 150, 100, 20, 0, 0, 0, 0, 0, "");
+ uiDefButS(block, ROW, B_OBJECTPANELMEDIAN, "Local ", 110, 150, 60, 19, &r_ref, 0, R_REFLOCAL, 10, 3, "Relative to object's origin");
+ uiDefButS(block, ROW, B_OBJECTPANELMEDIAN, "Global", 180, 150, 60, 19, &r_ref, 0, R_REFGLOBAL, 10, 3, "Relative to screen origin");
+ uiDefButS(block, ROW, B_OBJECTPANELMEDIAN, "Cursor", 250, 150, 60, 19, &r_ref, 0, R_REFCURSOR, 10, 3, "Relative to 3DCursor");
+ uiBlockEndAlign(block);
+
+ uiBlockBeginAlign(block);
+ if(tot==1) {
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Vertex X:", 10, 120, 300, 19, &(ve_median[0]), lim, lim, 10, 3, "");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Vertex Y:", 10, 100, 300, 19, &(ve_median[1]), lim, lim, 10, 3, "");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Vertex Z:", 10, 80, 300, 19, &(ve_median[2]), lim, lim, 10, 3, "");
+
+ if(totw==1)
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Vertex W:", 10, 60, 300, 19, &(ve_median[3]), 0.01, 100.0, 10, 3, "");
+ }
+ else {
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median X:", 10, 120, 300, 19, &(ve_median[0]), lim, lim, 10, 3, "");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median Y:", 10, 100, 300, 19, &(ve_median[1]), lim, lim, 10, 3, "");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median Z:", 10, 80, 300, 19, &(ve_median[2]), lim, lim, 10, 3, "");
+ if(totw==tot)
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median W:", 10, 60, 300, 19, &(ve_median[3]), 0.01, 100.0, 10, 3, "");
+ }
+ uiBlockEndAlign(block);
+
+ if(totedge==1)
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Crease W:", 10, 40, 300, 19, &(ve_median[3]), 0.0, 1.0, 10, 3, "");
+ else if(totedge>1)
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median Crease W:", 10, 40, 300, 19, &(ve_median[3]), 0.0, 1.0, 10, 3, "");
}
else { // apply
 VecSubf(median, ve_median, median);
 median[3]= ve_median[3]median[3];
+ if (r_ref == r_refp) {
+ VecSubf(median, ve_median, median);
+ median[3]= ve_median[3]median[3];
+ }
+ else {
+ median[0]= median[1]= median[2]= median[3]= 0.0;
+ r_refp = r_ref;
+ }
if(ob>type==OB_MESH) {
float diffac= 1.0;
@@ 1280,6 +1317,7 @@
BIF_undo_push("Transform properties");
}
}
+/* (jcmuro) patching ends here */
static void v3d_posearmature_buts(uiBlock *block, Object *ob, float lim)
{
Event Timeline
Log In to Comment