From 63e80e271dd3f9f79fe3a85c10253ee6eea2ba4e Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 12 Jan 2010 19:51:26 +0000 Subject: [PATCH] Bugfix: drivers on constraint properties could get set to invalid when 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 | 2 +- .../editors/transform/transform_conversions.c | 13 ++++--------- source/blender/makesdna/DNA_object_types.h | 1 + 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 762ad2432b0..13e86dd3576 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -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); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 49e7f040390..3d677d0789d 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -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; } diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 8eb02b28331..2b4b0a7b612 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -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