diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-29 18:22:59 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-29 18:22:59 +0300 |
commit | 86847bf5ba3efed90e2cfc238b4d478029287bf8 (patch) | |
tree | 99aacfb97316656fd3bdd266ac32a012f043d0b4 /source/blender/blenkernel/intern | |
parent | 0af91d7fe68d661122e8f7ab9fe343b7edc3ca79 (diff) |
Cleanup: Split depsgraph uber transform function callback
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/object_update.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c index ef6827dca5c..84d2f624577 100644 --- a/source/blender/blenkernel/intern/object_update.c +++ b/source/blender/blenkernel/intern/object_update.c @@ -295,32 +295,36 @@ void BKE_object_handle_data_update(EvaluationContext *eval_ctx, /* quick cache removed */ } -void BKE_object_eval_uber_transform(EvaluationContext *UNUSED(eval_ctx), - Object *ob) +bool BKE_object_eval_proxy_copy(EvaluationContext *UNUSED(eval_ctx), + Object *object) { - /* TODO(sergey): Currently it's a duplicate of logic in BKE_object_handle_update_ex(). */ - // XXX: it's almost redundant now... - /* Handle proxy copy for target, */ - if (ID_IS_LINKED(ob) && ob->proxy_from) { - if (ob->proxy_from->proxy_group) { + if (ID_IS_LINKED(object) && object->proxy_from) { + if (object->proxy_from->proxy_group) { /* Transform proxy into group space. */ - Object *obg = ob->proxy_from->proxy_group; + Object *obg = object->proxy_from->proxy_group; float imat[4][4]; invert_m4_m4(imat, obg->obmat); - mul_m4_m4m4(ob->obmat, imat, ob->proxy_from->obmat); + mul_m4_m4m4(object->obmat, imat, object->proxy_from->obmat); /* Should always be true. */ if (obg->dup_group) { - add_v3_v3(ob->obmat[3], obg->dup_group->dupli_ofs); + add_v3_v3(object->obmat[3], obg->dup_group->dupli_ofs); } } - else - copy_m4_m4(ob->obmat, ob->proxy_from->obmat); + else { + copy_m4_m4(object->obmat, object->proxy_from->obmat); + } + return true; } + return false; +} - ob->recalc &= ~(OB_RECALC_OB | OB_RECALC_TIME); - if (ob->data == NULL) { - ob->recalc &= ~OB_RECALC_DATA; +void BKE_object_eval_uber_transform(EvaluationContext *eval_ctx, Object *object) +{ + BKE_object_eval_proxy_copy(eval_ctx, object); + object->recalc &= ~(OB_RECALC_OB | OB_RECALC_TIME); + if (object->data == NULL) { + object->recalc &= ~OB_RECALC_DATA; } } |