diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-02-19 17:53:10 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-02-19 17:56:00 +0300 |
commit | 13f28798de5d501ed8867bbc0d7a25ca6f1dbe9b (patch) | |
tree | ac26da9674a8859d8da6f24cb8acc9f6ab86cd83 /source/blender/editors/transform | |
parent | 7c53bca1dd20460ebc4c404c058faeff5afb0ce0 (diff) |
Fix T57583: Assert when moving object parented to curve vertex
Can not reliably evaluate object's transform from the original one.
Still not ideal, see the comment in the code.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 95a6844abd3..65229606e39 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -5782,13 +5782,26 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob) if (t->mode == TFM_DUMMY) skip_invert = true; + /* NOTE: This is not relaly following copy-on-write design and we shoud not + * be re-evaluating the evaluated object. But as the comment above mentioned + * this is part of a hack. + * More proper solution would be to make a shallwe copy of the object and + * evaluate that, and access matrix of that evaluated copy of tje object. + * Might be more tricky as it sounds, if some logic later on accesses the + * object matrix via td->ob->obmat. */ + Object *object_eval = DEG_get_evaluated_object(t->depsgraph, ob); if (skip_invert == false && constinv == false) { ob->transflag |= OB_NO_CONSTRAINTS; /* BKE_object_where_is_calc checks this */ - BKE_object_where_is_calc(t->depsgraph, t->scene, ob); + BKE_object_where_is_calc(t->depsgraph, t->scene, object_eval); ob->transflag &= ~OB_NO_CONSTRAINTS; } - else - BKE_object_where_is_calc(t->depsgraph, t->scene, ob); + else { + BKE_object_where_is_calc(t->depsgraph, t->scene, object_eval); + } + /* Copy enwely evaluated fields to the original object, similar to how + * active dependency graph will do it. */ + copy_m4_m4(ob->obmat, object_eval->obmat); + ob->transflag = object_eval->transflag; td->ob = ob; |