Bugfix: drivers on constraint properties could get set to invalid when
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 12 Jan 2010 19:51:26 +0000 (19:51 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 12 Jan 2010 19:51:26 +0000 (19:51 +0000)
transforming, due to the evaluation of the object transform without
constraints, and the driver not finding the property.

Constraints are now disabled in a way that should avoid this problem

source/blender/blenkernel/intern/object.c
source/blender/editors/transform/transform_conversions.c
source/blender/makesdna/DNA_object_types.h

index 762ad2432b09704a7f687f80adbbb1c2c5d0d8fe..13e86dd3576ca831090d04744d2bb1e7196b9e0c 100644 (file)
@@ -2035,7 +2035,7 @@ void where_is_object_time(Scene *scene, Object *ob, float ctime)
        }
 
        /* solve constraints */
-       if (ob->constraints.first) {
+       if (ob->constraints.first && !(ob->flag & OB_NO_CONSTRAINTS)) {
                bConstraintOb *cob;
                
                cob= constraints_make_evalob(scene, ob, NULL, CONSTRAINT_OBTYPE_OBJECT);
index 49e7f04039075d83ad9cd33ad501141df5f8b9bc..3d677d0789d9e5fd3bb399fc64ab05c0a1bbe18f 100644 (file)
@@ -4256,18 +4256,13 @@ static void ObjectToTransData(bContext *C, TransInfo *t, TransData *td, Object *
                track= ob->track;
                ob->track= NULL;
                
-               if (constinv == 0) {
-                       fakecons.first = ob->constraints.first;
-                       fakecons.last = ob->constraints.last;
-                       ob->constraints.first = ob->constraints.last = NULL;
-               }
+               if (constinv == 0)
+                       ob->transflag |= OB_NO_CONSTRAINTS; /* where_is_object_time checks this */
                
                where_is_object(t->scene, ob);
                
-               if (constinv == 0) {
-                       ob->constraints.first = fakecons.first;
-                       ob->constraints.last = fakecons.last;
-               }
+               if (constinv == 0)
+                       ob->transflag &= ~OB_NO_CONSTRAINTS;
                
                ob->track= track;
        }
index 8eb02b28331f6f203d4eff047e5fb55ded4cff61..2b4b0a7b612446ff920a932360ad9c83d7d931c5 100644 (file)
@@ -334,6 +334,7 @@ extern Object workob;
 #define OB_DUPLIFACES_SCALE    1024
 #define OB_DUPLIPARTS          2048
 #define OB_RENDER_DUPLI                4096
+#define OB_NO_CONSTRAINTS      8096 /* runtime constraints disable */
 
 /* (short) ipoflag */
        // XXX depreceated - old animation system crap