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>2017-12-01 14:11:38 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-12-01 14:11:38 +0300
commitb2952023b688d886e34d734ca8c6d28df58ae547 (patch)
treef5ad1f2fa381c8e2f96023dfcb64887580bdfc9d /source/blender
parent146f2e1d02656ab802f434b653409a215ae31477 (diff)
Depsgraph: Use per-ID flags to see whether update is needed
This is actually functions which needs bigger reconsideration, but for now let's try to keep them working as much as possible.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/object.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index f58a0d76b6a..5f12a5715ca 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2699,7 +2699,9 @@ void BKE_object_handle_update_ex(const EvaluationContext *eval_ctx,
RigidBodyWorld *rbw,
const bool do_proxy_update)
{
- if ((ob->recalc & OB_RECALC_ALL) == 0) {
+ const bool recalc_object = (ob->id.tag & LIB_TAG_ID_RECALC) != 0;
+ const bool recalc_data = (ob->id.tag & LIB_TAG_ID_RECALC_DATA) != 0;
+ if (!recalc_object && ! recalc_data) {
object_handle_update_proxy(eval_ctx, scene, ob, do_proxy_update);
return;
}
@@ -2710,7 +2712,7 @@ void BKE_object_handle_update_ex(const EvaluationContext *eval_ctx,
BKE_pose_update_constraint_flags(ob->pose);
}
}
- if (ob->recalc & OB_RECALC_DATA) {
+ if (recalc_data) {
if (ob->type == OB_ARMATURE) {
/* this happens for reading old files and to match library armatures
* with poses we do it ahead of BKE_object_where_is_calc to ensure animation
@@ -2723,7 +2725,7 @@ void BKE_object_handle_update_ex(const EvaluationContext *eval_ctx,
/* XXX new animsys warning: depsgraph tag OB_RECALC_DATA should not skip drivers,
* which is only in BKE_object_where_is_calc now */
/* XXX: should this case be OB_RECALC_OB instead? */
- if (ob->recalc & OB_RECALC_ALL) {
+ if (recalc_object || recalc_data) {
if (G.debug & G_DEBUG_DEPSGRAPH) {
printf("recalcob %s\n", ob->id.name + 2);
}
@@ -2733,11 +2735,11 @@ void BKE_object_handle_update_ex(const EvaluationContext *eval_ctx,
}
}
- if (ob->recalc & OB_RECALC_DATA) {
+ if (recalc_data) {
BKE_object_handle_data_update(eval_ctx, scene, ob);
}
- ob->recalc &= ~OB_RECALC_ALL;
+ ob->id.tag &= ~LIB_TAG_ID_RECALC_ALL;
object_handle_update_proxy(eval_ctx, scene, ob, do_proxy_update);
}
@@ -3719,7 +3721,8 @@ bool BKE_object_modifier_update_subframe(
}
/* was originally OB_RECALC_ALL - TODO - which flags are really needed??? */
- ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
+ /* TODO(sergey): What about animation? */
+ ob->id.tag |= LIB_TAG_ID_RECALC_ALL;
BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, frame, ADT_RECALC_ANIM);
if (update_mesh) {
/* ignore cache clear during subframe updates