[Bf-blender-cvs] [b2952023b68] blender2.8: Depsgraph: Use per-ID flags to see whether update is needed
Sergey Sharybin
noreply at git.blender.org
Fri Dec 1 13:04:48 CET 2017
Commit: b2952023b688d886e34d734ca8c6d28df58ae547
Author: Sergey Sharybin
Date: Fri Dec 1 12:11:38 2017 +0100
Branches: blender2.8
https://developer.blender.org/rBb2952023b688d886e34d734ca8c6d28df58ae547
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.
===================================================================
M source/blender/blenkernel/intern/object.c
===================================================================
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
More information about the Bf-blender-cvs
mailing list