diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-05-12 11:13:36 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-05-12 14:06:36 +0300 |
commit | 87fd1666542adf1507d78bf96574fd56a8be3af8 (patch) | |
tree | feabc4af67e4edd813f1f68b4eace8ae7e968e2f /source/blender/editors/object | |
parent | dbbe721c2afda4a3b5c8ea7e60cf3f2b011cc857 (diff) |
Depsgraph: Add utility function to tag pose for recalc
Currently this function only tags pose itself, totally matching previous
behavior. But this will be needed in the future once new dependency graph
is landed, because of it's granular nature which relies on the fact that
pose channels are all up to date when building the graph.
Should be no functional changes so far.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_add.c | 3 | ||||
-rw-r--r-- | source/blender/editors/object/object_constraint.c | 14 |
2 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 27d77f0635e..b8c66fdd109 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -57,6 +57,7 @@ #include "BLF_translation.h" +#include "BKE_action.h" #include "BKE_anim.h" #include "BKE_animsys.h" #include "BKE_armature.h" @@ -2082,7 +2083,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base case OB_ARMATURE: DAG_id_tag_update(&obn->id, OB_RECALC_DATA); if (obn->pose) - obn->pose->flag |= POSE_RECALC; + BKE_pose_tag_recalc(bmain, obn->pose); if (dupflag & USER_DUP_ARM) { ID_NEW_US2(obn->data) else { diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index f214741467f..22db0936e39 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1194,9 +1194,9 @@ void ED_object_constraint_update(Object *ob) DAG_id_tag_update(&ob->id, OB_RECALC_OB); } -static void object_pose_tag_update(Object *ob) +static void object_pose_tag_update(Main *bmain, Object *ob) { - ob->pose->flag |= POSE_RECALC; /* Checks & sort pose channels. */ + BKE_pose_tag_recalc(bmain, ob->pose); /* Checks & sort pose channels. */ if (ob->proxy && ob->adt) { /* We need to make use of ugly POSE_ANIMATION_WORKAROUND here too, else anim data are not reloaded * after calling `BKE_pose_rebuild()`, which causes T43872. @@ -1212,7 +1212,7 @@ void ED_object_constraint_dependency_update(Main *bmain, Object *ob) ED_object_constraint_update(ob); if (ob->pose) { - object_pose_tag_update(ob); + object_pose_tag_update(bmain, ob); } DAG_relations_tag_update(bmain); } @@ -1236,7 +1236,7 @@ void ED_object_constraint_dependency_tag_update(Main *bmain, Object *ob, bConstr ED_object_constraint_tag_update(ob, con); if (ob->pose) { - object_pose_tag_update(ob); + object_pose_tag_update(bmain, ob); } DAG_relations_tag_update(bmain); } @@ -1484,8 +1484,8 @@ static int pose_constraint_copy_exec(bContext *C, wmOperator *op) BKE_constraints_copy(&chan->constraints, &pchan->constraints, true); /* update flags (need to add here, not just copy) */ chan->constflag |= pchan->constflag; - - ob->pose->flag |= POSE_RECALC; + + BKE_pose_tag_recalc(bmain, ob->pose); DAG_id_tag_update((ID *)ob, OB_RECALC_DATA); } } @@ -1796,7 +1796,7 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase DAG_relations_tag_update(bmain); if ((ob->type == OB_ARMATURE) && (pchan)) { - ob->pose->flag |= POSE_RECALC; /* sort pose channels */ + BKE_pose_tag_recalc(bmain, ob->pose); /* sort pose channels */ if (BKE_constraints_proxylocked_owner(ob, pchan) && ob->adt) { /* We need to make use of ugly POSE_ANIMATION_WORKAROUND here too, else anim data are not reloaded * after calling `BKE_pose_rebuild()`, which causes T43872. |