Revision: 18703
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18703
Author:   blendix
Date:     2009-01-27 22:19:19 +0100 (Tue, 27 Jan 2009)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/python/api2_2x/Constraint.c

Modified: trunk/blender/source/blender/python/api2_2x/Constraint.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/Constraint.c    2009-01-27 
20:17:32 UTC (rev 18702)
+++ trunk/blender/source/blender/python/api2_2x/Constraint.c    2009-01-27 
21:19:19 UTC (rev 18703)
@@ -2291,6 +2291,7 @@
 {
        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 @@
                        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 @@
                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;


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to