[Bf-blender-cvs] [118178d1763] blender2.8: Depsgraph / Animation: Rmove direct ID tagging from animation code
Sergey Sharybin
noreply at git.blender.org
Wed Dec 13 16:08:49 CET 2017
Commit: 118178d17639964b2e30bdba65a1de5c39c3435b
Author: Sergey Sharybin
Date: Wed Dec 13 15:53:04 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB118178d17639964b2e30bdba65a1de5c39c3435b
Depsgraph / Animation: Rmove direct ID tagging from animation code
New dependency graph is supposed to have relation from animation node to
the node which corresponds to a property which is modified by that curve.
This means it is up to dependency graph to flush recalc flags, and no
manual control is needed in the animation code.
===================================================================
M source/blender/blenkernel/intern/anim_sys.c
===================================================================
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 07de2ad6342..34f928ad4b6 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -1563,12 +1563,6 @@ static bool animsys_write_rna_setting(PathResolvedRNA *anim_rna, const float val
/* caller must ensure this is animatable */
BLI_assert(RNA_property_animateable(ptr, prop) || ptr->id.data == NULL);
- /* set value for animatable numerical values only
- * HACK: some local F-Curves (e.g. those on NLA Strips) are evaluated
- * without an ID provided, which causes the animateable test to fail!
- */
- bool written = false;
-
switch (RNA_property_type(prop)) {
case PROP_BOOLEAN:
{
@@ -1576,13 +1570,11 @@ static bool animsys_write_rna_setting(PathResolvedRNA *anim_rna, const float val
if (array_index != -1) {
if (RNA_property_boolean_get_index(ptr, prop, array_index) != value_coerce) {
RNA_property_boolean_set_index(ptr, prop, array_index, value_coerce);
- written = true;
}
}
else {
if (RNA_property_boolean_get(ptr, prop) != value_coerce) {
RNA_property_boolean_set(ptr, prop, value_coerce);
- written = true;
}
}
break;
@@ -1594,13 +1586,11 @@ static bool animsys_write_rna_setting(PathResolvedRNA *anim_rna, const float val
if (array_index != -1) {
if (RNA_property_int_get_index(ptr, prop, array_index) != value_coerce) {
RNA_property_int_set_index(ptr, prop, array_index, value_coerce);
- written = true;
}
}
else {
if (RNA_property_int_get(ptr, prop) != value_coerce) {
RNA_property_int_set(ptr, prop, value_coerce);
- written = true;
}
}
break;
@@ -1612,13 +1602,11 @@ static bool animsys_write_rna_setting(PathResolvedRNA *anim_rna, const float val
if (array_index != -1) {
if (RNA_property_float_get_index(ptr, prop, array_index) != value_coerce) {
RNA_property_float_set_index(ptr, prop, array_index, value_coerce);
- written = true;
}
}
else {
if (RNA_property_float_get(ptr, prop) != value_coerce) {
RNA_property_float_set(ptr, prop, value_coerce);
- written = true;
}
}
break;
@@ -1628,7 +1616,6 @@ static bool animsys_write_rna_setting(PathResolvedRNA *anim_rna, const float val
const int value_coerce = (int)value;
if (RNA_property_enum_get(ptr, prop) != value_coerce) {
RNA_property_enum_set(ptr, prop, value_coerce);
- written = true;
}
break;
}
@@ -1657,20 +1644,6 @@ static bool animsys_write_rna_setting(PathResolvedRNA *anim_rna, const float val
}
#endif
- /* as long as we don't do property update, we still tag datablock
- * as having been updated. this flag does not cause any updates to
- * be run, it's for e.g. render engines to synchronize data */
- if (written && ptr->id.data) {
- ID *id = ptr->id.data;
-
- /* for cases like duplifarmes it's only a temporary so don't
- * notify anyone of updates */
- if (!(id->tag & LIB_TAG_ANIM_NO_RECALC)) {
- BKE_id_tag_set_atomic(id, LIB_TAG_ID_RECALC);
- DEG_id_type_tag(G.main, GS(id->name));
- }
- }
-
/* successful */
return true;
}
@@ -2614,17 +2587,6 @@ static void animsys_evaluate_nla(ListBase *echannels, PointerRNA *ptr, AnimData
/* 3. free temporary evaluation data that's not used elsewhere */
BLI_freelistN(&estrips);
-
- /* Tag ID as updated so render engines will recognize changes in data
- * which is animated but doesn't have actions.
- */
- if (ptr->id.data != NULL) {
- ID *id = ptr->id.data;
- if (!(id->tag & LIB_TAG_ANIM_NO_RECALC)) {
- id->tag |= LIB_TAG_ID_RECALC;
- DEG_id_type_tag(G.main, GS(id->name));
- }
- }
}
/* NLA Evaluation function (mostly for use through do_animdata)
More information about the Bf-blender-cvs
mailing list