diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-29 17:47:00 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-29 17:47:00 +0300 |
commit | aad711d06428545c415b277fb6cf899a1cf1c03a (patch) | |
tree | 376d84216ed2d41328ff3b66e4b97efbba49e683 /source | |
parent | a02cbb3c3aab93e0c532fbcf8be04a77d5d6a27b (diff) | |
parent | 60703e45f36a92f8e49a7be7c951538e5b747a41 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_object.h | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object_update.c | 16 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_snap.c | 7 |
3 files changed, 23 insertions, 5 deletions
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index 31125545670..e446451d999 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -205,6 +205,10 @@ void BKE_object_eval_cloth(const struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *object); +void BKE_object_eval_transform_all(struct EvaluationContext *eval_ctx, + struct Scene *scene, + struct Object *object); + void BKE_object_eval_update_shading(const struct EvaluationContext *eval_ctx, struct Object *object); void BKE_object_data_select_update(const struct EvaluationContext *eval_ctx, @@ -226,6 +230,7 @@ void BKE_object_handle_update_ex( struct Scene *scene, struct Object *ob, struct RigidBodyWorld *rbw, const bool do_proxy_update); + void BKE_object_sculpt_modifiers_changed(struct Object *ob); int BKE_object_obdata_texspace_get(struct Object *ob, short **r_texflag, float **r_loc, float **r_size, float **r_rot); diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c index 1e8de416ea9..4d2cf0c5dc6 100644 --- a/source/blender/blenkernel/intern/object_update.c +++ b/source/blender/blenkernel/intern/object_update.c @@ -391,6 +391,22 @@ void BKE_object_eval_cloth(const EvaluationContext *UNUSED(eval_ctx), BKE_ptcache_object_reset(scene, object, PTCACHE_RESET_DEPSGRAPH); } +void BKE_object_eval_transform_all(EvaluationContext *eval_ctx, + Scene *scene, + Object *object) +{ + /* This mimics full transform update chain from new depsgraph. */ + BKE_object_eval_local_transform(eval_ctx, scene, object); + if (object->parent != NULL) { + BKE_object_eval_parent(eval_ctx, scene, object); + } + if (!BLI_listbase_is_empty(&object->constraints)) { + BKE_object_eval_constraints(eval_ctx, scene, object); + } + BKE_object_eval_uber_transform(eval_ctx, scene, object); + BKE_object_eval_done(eval_ctx, object); +} + void BKE_object_eval_update_shading(const EvaluationContext *UNUSED(eval_ctx), Object *object) { diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 63026cdcc46..30aad46843d 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -300,9 +300,7 @@ void applyProject(TransInfo *t) mul_m4_v3(ob->obmat, iloc); } else if (t->flag & T_OBJECT) { - /* TODO(sergey): Ideally force update is not needed here. */ - td->ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME; - BKE_object_handle_update(G.main->eval_ctx, t->scene, td->ob); + BKE_object_eval_transform_all(G.main->eval_ctx, t->scene, td->ob); copy_v3_v3(iloc, td->ob->obmat[3]); } @@ -391,8 +389,7 @@ void applyGridAbsolute(TransInfo *t) mul_m4_v3(obmat, iloc); } else if (t->flag & T_OBJECT) { - td->ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME; - BKE_object_handle_update(G.main->eval_ctx, t->scene, td->ob); + BKE_object_eval_transform_all(G.main->eval_ctx, t->scene, td->ob); copy_v3_v3(iloc, td->ob->obmat[3]); } |