diff options
author | Joshua Leung <aligorith@gmail.com> | 2007-10-23 14:16:46 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2007-10-23 14:16:46 +0400 |
commit | 535deca633873a3acb29f414c530c7147360302a (patch) | |
tree | 8859b279f804f46cbb86cae64b28be6a91881cea /source/blender/src/buttons_object.c | |
parent | cf8032f3155356833737caae65668400fd2d57a6 (diff) |
More constraints bugfixes:
* Fixed crash that occurs when using an unknown constraint type or a Null constraint - missing NULL check
* ClampTo constraint now draws ok again
* Null constraints now get drawn in the stack again
Diffstat (limited to 'source/blender/src/buttons_object.c')
-rw-r--r-- | source/blender/src/buttons_object.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index bccd662102b..94a40a7ebb6 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -482,12 +482,14 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s cti= constraint_get_typeinfo(con); if (cti == NULL) { - printf("Argh! No valid constraint type-info... aborting constraint drawing. \n"); - return; + /* exception for 'Null' constraint - it doesn't have constraint typeinfo! */ + if (con->type == CONSTRAINT_TYPE_NULL) + strcpy(typestr, "Null"); + else + strcpy(typestr, "Unknown"); } - else { + else strcpy(typestr, cti->name); - } /* unless button has own callback, it adds this callback to button */ uiBlockSetFunc(block, constraint_active_func, ob, con); @@ -1398,10 +1400,10 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s uiBlockEndAlign(block); /* Extra Options Controlling Behaviour */ - uiBlockBeginAlign(block); - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Options:", *xco, *yco-86, 90, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - uiDefButBitI(block, TOG, CLAMPTO_CYCLIC, B_CONSTRAINT_TEST, "Cyclic", *xco+((width/2)), *yco-86,60,19, &data->flag2, 0, 0, 0, 0, "Treat curve as cyclic curve (no clamping to curve bounding box)"); - uiBlockEndAlign(block); + //uiBlockBeginAlign(block); + uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Options:", *xco, *yco-88, 90, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); + uiDefButBitI(block, TOG, CLAMPTO_CYCLIC, B_CONSTRAINT_TEST, "Cyclic", *xco+((width/2)), *yco-88,60,19, &data->flag2, 0, 0, 0, 0, "Treat curve as cyclic curve (no clamping to curve bounding box)"); + //uiBlockEndAlign(block); } break; case CONSTRAINT_TYPE_TRANSFORM: @@ -1639,7 +1641,7 @@ void do_constraintbuts(unsigned short event) { con = add_new_constraint(CONSTRAINT_TYPE_NULL); add_constraint_to_active(ob, con); - + BIF_undo_push("Add constraint"); } break; |