diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-01-28 00:19:19 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-01-28 00:19:19 +0300 |
commit | a21cdd9369243596c632314eea94b67a6744eb1f (patch) | |
tree | aa60b94d5ec90cfc2af68d7d96b8604caf949a00 | |
parent | 2e610b3fb27991992ee29063a5a1c7b5eb7e9018 (diff) |
Fix for bug #18183: crash when using "Bake Constraints" script. The constraint
remove function was not working correct, this code uses a pretty bad hack, did
not clean it up, but at least it should work now.
-rw-r--r-- | source/blender/python/api2_2x/Constraint.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Constraint.c b/source/blender/python/api2_2x/Constraint.c index b0b9aa04a08..1845ce6f0de 100644 --- a/source/blender/python/api2_2x/Constraint.c +++ b/source/blender/python/api2_2x/Constraint.c @@ -2291,6 +2291,7 @@ static PyObject *ConstraintSeq_remove( BPy_ConstraintSeq *self, BPy_Constraint * { bConstraint *con = locate_constr(self, value); bPoseChannel *active= NULL; + int tmpflag= 0; /* if we can't locate the constraint, return (exception already set) */ if (!con) @@ -2304,6 +2305,11 @@ static PyObject *ConstraintSeq_remove( BPy_ConstraintSeq *self, BPy_Constraint * if (active) active->bone->flag &= ~BONE_ACTIVE; self->pchan->bone->flag |= BONE_ACTIVE; } + + if(!(self->obj->flag & OB_POSEMODE)) { + self->obj->flag |= OB_POSEMODE; + tmpflag= 1; + } } /* del_constr_func() frees constraint + its data */ @@ -2314,6 +2320,8 @@ static PyObject *ConstraintSeq_remove( BPy_ConstraintSeq *self, BPy_Constraint * if (active) active->bone->flag |= BONE_ACTIVE; self->pchan->bone->flag &= ~BONE_ACTIVE; } + if(tmpflag) + self->obj->flag &= ~OB_POSEMODE; /* erase the link to the constraint */ value->con = NULL; |