diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-28 17:05:32 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-28 18:06:41 +0300 |
commit | e256bc22503772b4550fadb778e8247dc26f905f (patch) | |
tree | 8309bfb3c83c9a17ad7308251083e3279462d94a /source/blender | |
parent | b683e965ab9720e82e734069990ff6c469980318 (diff) |
Depsgraph: Add query for whether graph is up to date
Depsgraph: Only invoke callbacks when there are changes
Only affects when an evaluated dependency graph is requested via
context.
Makes it cheap to call when there are no changes made to the graph
Transform: Ensure depsgraph is evaluated when needed
Fix based on D4455 from Campbell, utilizes some recently
introduced functions and allows to not have any extra checks
in the transform code.
Fixes T61904
Fixes T62135
Reviewers: brecht
Maniphest Tasks: T62135, T61904
Differential Revision: https://developer.blender.org/D4967
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 4037fab2b68..52a3763b836 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -3052,6 +3052,8 @@ static void createTransEditVerts(TransInfo *t) if (modifiers_getCageIndex(t->scene, tc->obedit, NULL, 1) != -1) { int totleft = -1; if (modifiers_isCorrectableDeformed(t->scene, tc->obedit)) { + BKE_scene_graph_evaluated_ensure(t->depsgraph, CTX_data_main(t->context)); + /* Use evaluated state because we need b-bone cache. */ Scene *scene_eval = (Scene *)DEG_get_evaluated_id(t->depsgraph, &t->scene->id); Object *obedit_eval = (Object *)DEG_get_evaluated_id(t->depsgraph, &tc->obedit->id); @@ -9651,6 +9653,9 @@ void createTransData(bContext *C, TransInfo *t) has_transform_context = false; } else { + /* Needed for correct Object.obmat after duplication, see: T62135. */ + BKE_scene_graph_evaluated_ensure(t->depsgraph, CTX_data_main(t->context)); + createTransObject(C, t); countAndCleanTransDataContainer(t); t->flag |= T_OBJECT; |