diff options
author | Martin Poirier <theeth@yahoo.com> | 2004-09-06 01:20:03 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2004-09-06 01:20:03 +0400 |
commit | ea815d51ce3b75e67ec78c29ade9f6abb4fddc36 (patch) | |
tree | bd0638bac13894bb0d1ca148c18123c01beb6ce1 /source/blender/src/editconstraint.c | |
parent | ae9347662b4d7baf9ad2d5cbdb89c923d463db60 (diff) |
All constraints (except FollowPath) now check if subtarget (bone) is valid and disable constraint if not. Previously, this only worked with IK Solver.
The problem was that it defaulted to the armature object as target but didn't clear the subtarget field. This makes it clear that there's a problem.
Diffstat (limited to 'source/blender/src/editconstraint.c')
-rw-r--r-- | source/blender/src/editconstraint.c | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/source/blender/src/editconstraint.c b/source/blender/src/editconstraint.c index 6123da0062b..c23ab26f57b 100644 --- a/source/blender/src/editconstraint.c +++ b/source/blender/src/editconstraint.c @@ -406,6 +406,13 @@ static short detect_constraint_loop (Object *owner, const char* substring, int d break; } + if ( (data->tar == owner) && + (!get_named_bone(get_armature(owner), + data->subtarget))) { + curcon->flag |= CONSTRAINT_DISABLE; + result = 1; + break; + } if (add_constraint_element (data->tar, data->subtarget, owner, substring)){ curcon->flag |= CONSTRAINT_DISABLE; result = 1; @@ -429,6 +436,13 @@ static short detect_constraint_loop (Object *owner, const char* substring, int d break; } + if ( (data->tar == owner) && + (!get_named_bone(get_armature(owner), + data->subtarget))) { + curcon->flag |= CONSTRAINT_DISABLE; + result = 1; + break; + } if (add_constraint_element (data->tar, data->subtarget, owner, substring)){ curcon->flag |= CONSTRAINT_DISABLE; result = 1; @@ -452,6 +466,13 @@ static short detect_constraint_loop (Object *owner, const char* substring, int d break; } + if ( (data->tar == owner) && + (!get_named_bone(get_armature(owner), + data->subtarget))) { + curcon->flag |= CONSTRAINT_DISABLE; + result = 1; + break; + } if (add_constraint_element (data->tar, data->subtarget, owner, substring)){ curcon->flag |= CONSTRAINT_DISABLE; result = 1; @@ -481,8 +502,6 @@ static short detect_constraint_loop (Object *owner, const char* substring, int d result = 1; break; } - - if (add_constraint_element (data->tar, data->subtarget, owner, substring)){ curcon->flag |= CONSTRAINT_DISABLE; result = 1; @@ -505,6 +524,13 @@ static short detect_constraint_loop (Object *owner, const char* substring, int d break; } + if ( (data->tar == owner) && + (!get_named_bone(get_armature(owner), + data->subtarget))) { + curcon->flag |= CONSTRAINT_DISABLE; + result = 1; + break; + } if (typefrom != CONSTRAINT_TYPE_TRACKTO && typefrom != CONSTRAINT_TYPE_LOCKTRACK){ if (add_constraint_element (data->tar, data->subtarget, owner, substring)){ curcon->flag |= CONSTRAINT_DISABLE; @@ -546,6 +572,13 @@ static short detect_constraint_loop (Object *owner, const char* substring, int d break; } + if ( (data->tar == owner) && + (!get_named_bone(get_armature(owner), + data->subtarget))) { + curcon->flag |= CONSTRAINT_DISABLE; + result = 1; + break; + } if (typefrom != CONSTRAINT_TYPE_TRACKTO && typefrom != CONSTRAINT_TYPE_LOCKTRACK){ if (add_constraint_element (data->tar, data->subtarget, owner, substring)){ curcon->flag |= CONSTRAINT_DISABLE; @@ -587,6 +620,13 @@ static short detect_constraint_loop (Object *owner, const char* substring, int d break; } + if ( (data->tar == owner) && + (!get_named_bone(get_armature(owner), + data->subtarget))) { + curcon->flag |= CONSTRAINT_DISABLE; + result = 1; + break; + } if (detect_constraint_loop (data->tar, data->subtarget, disable, CONSTRAINT_TYPE_LOCKTRACK)){ curcon->flag |= CONSTRAINT_DISABLE; result = 1; |