Page Menu
Home
Search
Configure Global Search
Log In
Files
F2245
patch-constraint-target-menus.txt
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Jonathan Hudson (mirkril)
Nov 13 2013, 1:03 PM
Size
13 KB
Subscribers
None
patch-constraint-target-menus.txt
View Options
? tools/Blender.pyc
? tools/__init__.pyc
? tools/bcolors.pyc
? tools/btools.pyc
Index: config/linux2-config.py
===================================================================
RCS file: /cvsroot/bf-blender/blender/config/linux2-config.py,v
retrieving revision 1.13
diff -u -p -r1.13 linux2-config.py
--- config/linux2-config.py 6 Apr 2006 20:11:06 -0000 1.13
+++ config/linux2-config.py 9 May 2006 14:36:14 -0000
@@ -1,24 +1,25 @@
LCGDIR = '../lib/linux2'
-BF_PYTHON = '/usr'
+BF_PYTHON = '/usr/local'
BF_PYTHON_VERSION = '2.4'
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
-BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' #BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
+BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}'
+BF_PYTHON_LIBPATH = '/usr/local/lib/python'+BF_PYTHON_VERSION+'/config'
-WITH_BF_OPENAL = 'true'
-BF_OPENAL = '/usr'
+WITH_BF_OPENAL = 'false'
+BF_OPENAL = '/usr/local'
BF_OPENAL_INC = '${BF_OPENAL}/include'
BF_OPENAL_LIB = 'openal'
WITH_BF_SDL = 'true'
-BF_SDL = '/usr' #$(shell sdl-config --prefix)
+BF_SDL = '/usr/local'
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
WITH_BF_FMOD = 'false'
BF_FMOD = LCGDIR + '/fmod'
-WITH_BF_OPENEXR = 'true'
+WITH_BF_OPENEXR = 'false'
BF_OPENEXR = '/usr'
BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
Index: source/blender/src/buttons_object.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/buttons_object.c,v
retrieving revision 1.156
diff -u -p -r1.156 buttons_object.c
--- source/blender/src/buttons_object.c 7 May 2006 14:57:57 -0000 1.156
+++ source/blender/src/buttons_object.c 9 May 2006 14:54:43 -0000
@@ -513,6 +513,54 @@ void autocomplete_vgroup(char *str, void
}
}
+static void parnr_to_objtar_cb(void *objectv, void *nr)
+{
+ Object **objout;
+
+ objout = objectv;
+ *objout = BLI_findlink(&G.main->object, *(int*)nr);
+}
+
+static char *build_objtarstring (void)
+{
+ int numObjects, index, i;
+ char *string;
+ Object *curObject;
+ char (*qsort_ptr)[32] = NULL;
+
+ numObjects = BLI_countlist(&G.main->object);
+
+ string = MEM_mallocN((numObjects * 64)+64, "Object target str");
+ sprintf(string, "None%%t| %%x%d", -1); /* That space is there
+ * for a reason
+ */
+
+ /*
+ * This will hold the object names temporarily so we can sort them
+ */
+ if (numObjects > 0)
+ qsort_ptr = MEM_callocN (numObjects * sizeof (qsort_ptr[0]),
+ "qsort_ptr");
+
+ numObjects = 0;
+ for (curObject = G.main->object.first, index=0; curObject;
+ curObject=curObject->id.next, index++) {
+ sprintf (qsort_ptr[numObjects], "|%s%%x%d", curObject->id.name+2, index);
+ numObjects++;
+ }
+ qsort (qsort_ptr, numObjects, sizeof (qsort_ptr[0]),
+ ( int (*)(const void *, const void *) ) strcmp);
+
+ for (i=0; i < numObjects; ++i) {
+ sprintf (string, "%s%s", string, qsort_ptr[i]);
+ }
+
+ if (qsort_ptr)
+ MEM_freeN(qsort_ptr);
+
+ return string;
+}
+
static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, short *xco, short *yco)
{
Object *ob= OBACT;
@@ -603,6 +651,8 @@ static void draw_constraint (uiBlock *bl
{
bActionConstraint *data = con->data;
bArmature *arm;
+ char *objtarstr;
+ int objtar_nr;
height = 88;
uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
@@ -613,6 +663,14 @@ static void draw_constraint (uiBlock *bl
uiBlockBeginAlign(block);
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
+ objtarstr = build_objtarstring();
+
+ but = uiDefButI(block, MENU,REDRAWVIEW3D, objtarstr, *xco+120+139,*yco-24,18,18, &objtar_nr, 0.0, 0.0, 0.0, 0.0, "Object Target List");
+ /* last arg NULL means button will put old string there */
+ uiButSetFunc(but, parnr_to_objtar_cb, &data->tar, &objtar_nr);
+
+ MEM_freeN(objtarstr);
+
arm = get_armature(data->tar);
if (arm){
but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone");
@@ -642,6 +700,8 @@ static void draw_constraint (uiBlock *bl
{
bLocateLikeConstraint *data = con->data;
bArmature *arm;
+ char *objtarstr;
+ int objtar_nr;
height = 66;
uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
@@ -652,6 +712,14 @@ static void draw_constraint (uiBlock *bl
uiBlockBeginAlign(block);
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
+ objtarstr = build_objtarstring();
+
+ but = uiDefButI(block, MENU,REDRAWVIEW3D, objtarstr, *xco+120+139,*yco-24,18,18, &objtar_nr, 0.0, 0.0, 0.0, 0.0, "Object Target List");
+ /* last arg NULL means button will put old string there */
+ uiButSetFunc(but, parnr_to_objtar_cb, &data->tar, &objtar_nr);
+
+ MEM_freeN(objtarstr);
+
arm = get_armature(data->tar);
if (arm){
but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone");
@@ -675,6 +743,8 @@ static void draw_constraint (uiBlock *bl
{
bRotateLikeConstraint *data = con->data;
bArmature *arm;
+ char *objtarstr;
+ int objtar_nr;
/* also old files stuff... version patch is too much code! */
if(data->flag==0) data->flag = ROTLIKE_X|ROTLIKE_Y|ROTLIKE_Z;
@@ -688,6 +758,14 @@ static void draw_constraint (uiBlock *bl
uiBlockBeginAlign(block);
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
+ objtarstr = build_objtarstring();
+
+ but = uiDefButI(block, MENU,REDRAWVIEW3D, objtarstr, *xco+120+139,*yco-24,18,18, &objtar_nr, 0.0, 0.0, 0.0, 0.0, "Object Target List");
+ /* last arg NULL means button will put old string there */
+ uiButSetFunc(but, parnr_to_objtar_cb, &data->tar, &objtar_nr);
+
+ MEM_freeN(objtarstr);
+
arm = get_armature(data->tar);
if (arm){
but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone");
@@ -711,6 +789,9 @@ static void draw_constraint (uiBlock *bl
{
bSizeLikeConstraint *data = con->data;
bArmature *arm;
+ char *objtarstr;
+ int objtar_nr;
+
height = 66;
BIF_ThemeColor(curCol);
@@ -722,6 +803,14 @@ static void draw_constraint (uiBlock *bl
uiBlockBeginAlign(block);
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
+ objtarstr = build_objtarstring();
+
+ but = uiDefButI(block, MENU,REDRAWVIEW3D, objtarstr, *xco+120+139,*yco-24,18,18, &objtar_nr, 0.0, 0.0, 0.0, 0.0, "Object Target List");
+ /* last arg NULL means button will put old string there */
+ uiButSetFunc(but, parnr_to_objtar_cb, &data->tar, &objtar_nr);
+
+ MEM_freeN(objtarstr);
+
arm = get_armature(data->tar);
if (arm){
but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone");
@@ -743,6 +832,8 @@ static void draw_constraint (uiBlock *bl
{
bKinematicConstraint *data = con->data;
bArmature *arm;
+ char *objtarstr;
+ int objtar_nr;
height = 108;
uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
@@ -753,7 +844,15 @@ static void draw_constraint (uiBlock *bl
uiDefButBitS(block, TOG, CONSTRAINT_IK_ROT, B_CONSTRAINT_TEST, "Rot", *xco, *yco-24,60,19, &data->flag, 0, 0, 0, 0, "Chain follows rotation of target");
uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 19, &data->tar, "Target Object");
+ uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 19, &data->tar, "Target Object");
+
+ objtarstr = build_objtarstring();
+
+ but = uiDefButI(block, MENU,REDRAWVIEW3D, objtarstr, *xco+120+139,*yco-24,18,18, &objtar_nr, 0.0, 0.0, 0.0, 0.0, "Object Target List");
+ /* last arg NULL means button will put old string there */
+ uiButSetFunc(but, parnr_to_objtar_cb, &data->tar, &objtar_nr);
+
+ MEM_freeN(objtarstr);
arm = get_armature(data->tar);
if (arm) {
@@ -779,6 +878,8 @@ static void draw_constraint (uiBlock *bl
{
bTrackToConstraint *data = con->data;
bArmature *arm;
+ char *objtarstr;
+ int objtar_nr;
height = 66;
uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
@@ -789,6 +890,14 @@ static void draw_constraint (uiBlock *bl
uiBlockBeginAlign(block);
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
+ objtarstr = build_objtarstring();
+
+ but = uiDefButI(block, MENU,REDRAWVIEW3D, objtarstr, *xco+120+139,*yco-24,18,18, &objtar_nr, 0.0, 0.0, 0.0, 0.0, "Object Target List");
+ /* last arg NULL means button will put old string there */
+ uiButSetFunc(but, parnr_to_objtar_cb, &data->tar, &objtar_nr);
+
+ MEM_freeN(objtarstr);
+
arm = get_armature(data->tar);
if (arm){
but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone");
@@ -822,6 +931,8 @@ static void draw_constraint (uiBlock *bl
{
bMinMaxConstraint *data = con->data;
bArmature *arm;
+ char *objtarstr;
+ int objtar_nr;
height = 66;
uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
@@ -834,6 +945,14 @@ static void draw_constraint (uiBlock *bl
uiBlockBeginAlign(block);
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
+ objtarstr = build_objtarstring();
+
+ but = uiDefButI(block, MENU,REDRAWVIEW3D, objtarstr, *xco+120+139,*yco-24,18,18, &objtar_nr, 0.0, 0.0, 0.0, 0.0, "Object Target List");
+ /* last arg NULL means button will put old string there */
+ uiButSetFunc(but, parnr_to_objtar_cb, &data->tar, &objtar_nr);
+
+ MEM_freeN(objtarstr);
+
arm = get_armature(data->tar);
if (arm){
but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone");
@@ -861,6 +980,9 @@ static void draw_constraint (uiBlock *bl
{
bLockTrackConstraint *data = con->data;
bArmature *arm;
+ char *objtarstr;
+ int objtar_nr;
+
height = 66;
uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
@@ -870,6 +992,14 @@ static void draw_constraint (uiBlock *bl
uiBlockBeginAlign(block);
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
+ objtarstr = build_objtarstring();
+
+ but = uiDefButI(block, MENU,REDRAWVIEW3D, objtarstr, *xco+120+139,*yco-24,18,18, &objtar_nr, 0.0, 0.0, 0.0, 0.0, "Object Target List");
+ /* last arg NULL means button will put old string there */
+ uiButSetFunc(but, parnr_to_objtar_cb, &data->tar, &objtar_nr);
+
+ MEM_freeN(objtarstr);
+
arm = get_armature(data->tar);
if (arm){
but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone");
@@ -901,6 +1031,9 @@ static void draw_constraint (uiBlock *bl
break;
case CONSTRAINT_TYPE_FOLLOWPATH:
{
+ char *objtarstr;
+ int objtar_nr;
+
bFollowPathConstraint *data = con->data;
height = 66;
@@ -910,6 +1043,14 @@ static void draw_constraint (uiBlock *bl
/* Draw target parameters */
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
+
+ objtarstr = build_objtarstring();
+
+ but = uiDefButI(block, MENU,REDRAWVIEW3D, objtarstr, *xco+120+139,*yco-24,18,18, &objtar_nr, 0.0, 0.0, 0.0, 0.0, "Object Target List");
+ /* last arg NULL means button will put old string there */
+ uiButSetFunc(but, parnr_to_objtar_cb, &data->tar, &objtar_nr);
+
+ MEM_freeN(objtarstr);
/* Draw Curve Follow toggle */
but=uiDefButBitI(block, TOG, 1, B_CONSTRAINT_TEST, "CurveFollow", *xco+39, *yco-44, 100, 18, &data->followflag, 0, 24, 0, 0, "Object will follow the heading and banking of the curve");
@@ -941,6 +1082,8 @@ static void draw_constraint (uiBlock *bl
{
bStretchToConstraint *data = con->data;
bArmature *arm;
+ char *objtarstr;
+ int objtar_nr;
height = 105;
uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
@@ -951,6 +1094,14 @@ static void draw_constraint (uiBlock *bl
/* Draw target parameters */
uiBlockBeginAlign(block);
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
+
+ objtarstr = build_objtarstring();
+
+ but = uiDefButI(block, MENU,REDRAWVIEW3D, objtarstr, *xco+120+139,*yco-24,18,18, &objtar_nr, 0.0, 0.0, 0.0, 0.0, "Object Target List");
+ /* last arg NULL means button will put old string there */
+ uiButSetFunc(but, parnr_to_objtar_cb, &data->tar, &objtar_nr);
+
+ MEM_freeN(objtarstr);
arm = get_armature(data->tar);
if (arm){
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ec/ed/456fab36499be08ed62bc58fb9ea
Event Timeline
Log In to Comment