Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2010-03-26 04:11:03 +0300
committerJoshua Leung <aligorith@gmail.com>2010-03-26 04:11:03 +0300
commitfedabce47c193926eb0c845a305a62bc73d8d6ce (patch)
treecb7cc9d67884e51af0073cdcb45f88ce1020863f /source
parent7a56ca7d6f4655a1c673b38f56b36953fcac4b15 (diff)
Bugfix #21757: Crash when setting up cyclic tracking dependencies (with old tracking)
Note that users should not be doing this anyway (and to some degree, I wish that they have to learn this the hard way - i.e. a crash as was before) since it is always bound to cause troubles of various sorts. Having said this, the old tracking code was previously crashing if this sort of setup was created since a stack overflow would happen while bouncing between each object being recursively recalculated. I've fixed this by commenting out that recursive recalculation (solving the cyclic problems for n >= 2, while n=1 should still be fine without this pre-depsgraph hack), and also removing such cyclic dependencies in the n=2 case. (PS: Perhaps this is just a good opportunity to just remove this old feature instead ;)
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/object.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index e4350cfde7f..2026bb3da6e 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2039,8 +2039,27 @@ void where_is_object_time(Scene *scene, Object *ob, float ctime)
/* Handle tracking */
if(ob->track) {
- if( ctime != ob->track->ctime) where_is_object_time(scene, ob->track, ctime);
- solve_tracking (ob, ob->track->obmat);
+ /* Try to remove this tracking relationship if we can easily detect that
+ * it is cyclic (i.e. direct tracking), and bound to cause us troubles.
+ * For the other cases (i.e. a cyclic triangle, and higher orders), we can't
+ * easily detect or know how to remove those relationships, safely, so just
+ * let them be (with warnings).
+ * Of course, this could also be a simple track that doesn't do anything bad either :)
+ */
+ if (ob->track->track == ob) {
+ printf("Removed direct cyclic tracking between %s and %s\n", ob->id.name+2, ob->track->id.name+2);
+ ob->track->track = NULL;
+ ob->track = NULL;
+ }
+ else {
+ /* NOTE: disabled recursive recalc for tracking for now, since this causes crashes
+ * when users create cyclic dependencies (stack overflow). Really, this step ought
+ * not to be needed anymore with the depsgraph, though this may not be the case.
+ * -- Aligorith, 2010 Mar 26
+ */
+ //if( ctime != ob->track->ctime) where_is_object_time(scene, ob->track, ctime);
+ solve_tracking(ob, ob->track->obmat);
+ }
}
/* solve constraints */