Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-07-31 15:56:17 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-07-31 16:11:38 +0300
commit64e029ea92071870b5004baaf6401fcf4b370fd8 (patch)
tree70f4105f06047679dc5f4f82a9382b9d5ae46db2 /source/blender/blenkernel/intern/object.c
parent9c0e7f7dd6465af491b3f9ad4c26b26fe891bddf (diff)
Animation: Remove depsgraph argument from a lot of API
Use explicit boolean flag to indicate whether flush to original data is needed or not. Makes it possible to avoid confusion on whether an evaluated or any depsgraph can be passed to the API. Allows to remove depsgraph from bAnimContext as well. Reviewers: brecht Differential Revision: https://developer.blender.org/D5379
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 69ba7ccab8e..24aedded2f0 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2562,7 +2562,8 @@ static void object_where_is_calc_ex(Depsgraph *depsgraph,
void BKE_object_where_is_calc_time(Depsgraph *depsgraph, Scene *scene, Object *ob, float ctime)
{
/* Execute drivers and animation. */
- BKE_animsys_evaluate_animdata(depsgraph, scene, &ob->id, ob->adt, ctime, ADT_RECALC_ALL);
+ const bool flush_to_original = DEG_is_active(depsgraph);
+ BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, ctime, ADT_RECALC_ALL, flush_to_original);
object_where_is_calc_ex(depsgraph, scene, ob, ctime, NULL, NULL);
}
@@ -4335,6 +4336,7 @@ bool BKE_object_modifier_update_subframe(Depsgraph *depsgraph,
float frame,
int type)
{
+ const bool flush_to_original = DEG_is_active(depsgraph);
ModifierData *md = modifiers_findByType(ob, (ModifierType)type);
bConstraint *con;
@@ -4399,7 +4401,8 @@ bool BKE_object_modifier_update_subframe(Depsgraph *depsgraph,
/* TODO(sergey): What about animation? */
ob->id.recalc |= ID_RECALC_ALL;
if (update_mesh) {
- BKE_animsys_evaluate_animdata(depsgraph, scene, &ob->id, ob->adt, frame, ADT_RECALC_ANIM);
+ BKE_animsys_evaluate_animdata(
+ scene, &ob->id, ob->adt, frame, ADT_RECALC_ANIM, flush_to_original);
/* ignore cache clear during subframe updates
* to not mess up cache validity */
object_cacheIgnoreClear(ob, 1);
@@ -4413,12 +4416,14 @@ bool BKE_object_modifier_update_subframe(Depsgraph *depsgraph,
/* for curve following objects, parented curve has to be updated too */
if (ob->type == OB_CURVE) {
Curve *cu = ob->data;
- BKE_animsys_evaluate_animdata(depsgraph, scene, &cu->id, cu->adt, frame, ADT_RECALC_ANIM);
+ BKE_animsys_evaluate_animdata(
+ scene, &cu->id, cu->adt, frame, ADT_RECALC_ANIM, flush_to_original);
}
/* and armatures... */
if (ob->type == OB_ARMATURE) {
bArmature *arm = ob->data;
- BKE_animsys_evaluate_animdata(depsgraph, scene, &arm->id, arm->adt, frame, ADT_RECALC_ANIM);
+ BKE_animsys_evaluate_animdata(
+ scene, &arm->id, arm->adt, frame, ADT_RECALC_ANIM, flush_to_original);
BKE_pose_where_is(depsgraph, scene, ob);
}