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.
This commit is contained in:
Brecht Van Lommel 2009-01-27 21:19:19 +00:00
parent 2e610b3fb2
commit a21cdd9369

@ -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;