[Bf-blender-cvs] [9070bb122d1] blender-v2.82-release: Fix T73932: modifying keyframes in nodes fails when there is an image sequence

Brecht Van Lommel noreply at git.blender.org
Mon Mar 9 20:56:35 CET 2020


Commit: 9070bb122d1046857cfc0ddc2e28bebdcb790cb9
Author: Brecht Van Lommel
Date:   Wed Feb 19 18:10:35 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB9070bb122d1046857cfc0ddc2e28bebdcb790cb9

Fix T73932: modifying keyframes in nodes fails when there is an image sequence

Image animation should not be an depsgraph node of type ANIMATION, there is
no need for it to be affected by the special casing for that.

===================================================================

M	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M	source/blender/depsgraph/intern/builder/deg_builder_rna.cc
M	source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc
M	source/blender/depsgraph/intern/node/deg_node.cc
M	source/blender/depsgraph/intern/node/deg_node.h
M	source/blender/depsgraph/intern/node/deg_node_component.cc
M	source/blender/depsgraph/intern/node/deg_node_component.h

===================================================================

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index b260df6fa06..567be2042ce 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -895,7 +895,7 @@ void DepsgraphNodeBuilder::build_animation_images(ID *id)
   if (BKE_image_user_id_has_animation(id)) {
     ID *id_cow = get_cow_id(id);
     add_operation_node(id,
-                       NodeType::ANIMATION,
+                       NodeType::IMAGE_ANIMATION,
                        OperationCode::IMAGE_ANIMATION,
                        function_bind(BKE_image_user_id_eval_animation, _1, id_cow));
   }
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index d01e8d8eddd..2577b0a9f92 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1381,9 +1381,8 @@ void DepsgraphRelationBuilder::build_animation_images(ID *id)
 {
   /* TODO: can we check for existence of node for performance? */
   if (BKE_image_user_id_has_animation(id)) {
-    OperationKey image_animation_key(id, NodeType::ANIMATION, OperationCode::IMAGE_ANIMATION);
-    ComponentKey cow_key(id, NodeType::COPY_ON_WRITE);
-    add_relation(cow_key, image_animation_key, "CoW -> Image Animation");
+    OperationKey image_animation_key(
+        id, NodeType::IMAGE_ANIMATION, OperationCode::IMAGE_ANIMATION);
     TimeSourceKey time_src_key;
     add_relation(time_src_key, image_animation_key, "TimeSrc -> Image Animation");
   }
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc
index d092240e665..35e93c5b049 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc
@@ -361,7 +361,7 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr,
   }
   else if (RNA_struct_is_a(ptr->type, &RNA_ImageUser)) {
     if (GS(node_identifier.id->name) == ID_NT) {
-      node_identifier.type = NodeType::ANIMATION;
+      node_identifier.type = NodeType::IMAGE_ANIMATION;
       node_identifier.operation_code = OperationCode::IMAGE_ANIMATION;
       return node_identifier;
     }
diff --git a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc
index ee3959a0861..55921f9bdd0 100644
--- a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc
+++ b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc
@@ -426,6 +426,7 @@ static void deg_debug_graphviz_node(const DebugContext &ctx, const Node *node)
     case NodeType::SHADING_PARAMETERS:
     case NodeType::CACHE:
     case NodeType::POINT_CACHE:
+    case NodeType::IMAGE_ANIMATION:
     case NodeType::LAYER_COLLECTIONS:
     case NodeType::PARTICLE_SYSTEM:
     case NodeType::PARTICLE_SETTINGS:
diff --git a/source/blender/depsgraph/intern/node/deg_node.cc b/source/blender/depsgraph/intern/node/deg_node.cc
index 16c934e72fe..71b6070af2b 100644
--- a/source/blender/depsgraph/intern/node/deg_node.cc
+++ b/source/blender/depsgraph/intern/node/deg_node.cc
@@ -99,6 +99,8 @@ const char *nodeTypeAsString(NodeType type)
       return "CACHE";
     case NodeType::POINT_CACHE:
       return "POINT_CACHE";
+    case NodeType::IMAGE_ANIMATION:
+      return "IMAGE_ANIMATION";
     case NodeType::BATCH_CACHE:
       return "BATCH_CACHE";
     case NodeType::DUPLI:
@@ -156,6 +158,7 @@ eDepsSceneComponentType nodeTypeToSceneComponent(NodeType type)
     case NodeType::PARTICLE_SETTINGS:
     case NodeType::SHADING_PARAMETERS:
     case NodeType::POINT_CACHE:
+    case NodeType::IMAGE_ANIMATION:
     case NodeType::BATCH_CACHE:
     case NodeType::DUPLI:
     case NodeType::SYNCHRONIZATION:
@@ -237,6 +240,7 @@ eDepsObjectComponentType nodeTypeToObjectComponent(NodeType type)
     case NodeType::PARTICLE_SETTINGS:
     case NodeType::SHADING_PARAMETERS:
     case NodeType::POINT_CACHE:
+    case NodeType::IMAGE_ANIMATION:
     case NodeType::BATCH_CACHE:
     case NodeType::DUPLI:
     case NodeType::SYNCHRONIZATION:
diff --git a/source/blender/depsgraph/intern/node/deg_node.h b/source/blender/depsgraph/intern/node/deg_node.h
index acfc8d19bc7..b35b0ff5894 100644
--- a/source/blender/depsgraph/intern/node/deg_node.h
+++ b/source/blender/depsgraph/intern/node/deg_node.h
@@ -114,6 +114,8 @@ enum class NodeType {
   SHADING_PARAMETERS,
   /* Point cache Component */
   POINT_CACHE,
+  /* Image Animation Component */
+  IMAGE_ANIMATION,
   /* Cache Component */
   /* TODO(sergey); Verify that we really need this. */
   CACHE,
diff --git a/source/blender/depsgraph/intern/node/deg_node_component.cc b/source/blender/depsgraph/intern/node/deg_node_component.cc
index 830c53cfc76..dad08e10990 100644
--- a/source/blender/depsgraph/intern/node/deg_node_component.cc
+++ b/source/blender/depsgraph/intern/node/deg_node_component.cc
@@ -349,6 +349,7 @@ DEG_COMPONENT_NODE_DEFINE(BatchCache, BATCH_CACHE, ID_RECALC_SHADING);
 DEG_COMPONENT_NODE_DEFINE(Bone, BONE, ID_RECALC_GEOMETRY);
 DEG_COMPONENT_NODE_DEFINE(Cache, CACHE, 0);
 DEG_COMPONENT_NODE_DEFINE(CopyOnWrite, COPY_ON_WRITE, ID_RECALC_COPY_ON_WRITE);
+DEG_COMPONENT_NODE_DEFINE(ImageAnimation, IMAGE_ANIMATION, 0);
 DEG_COMPONENT_NODE_DEFINE(Geometry, GEOMETRY, ID_RECALC_GEOMETRY);
 DEG_COMPONENT_NODE_DEFINE(LayerCollections, LAYER_COLLECTIONS, 0);
 DEG_COMPONENT_NODE_DEFINE(Parameters, PARAMETERS, 0);
@@ -383,6 +384,7 @@ void deg_register_component_depsnodes()
   register_node_typeinfo(&DNTI_PARTICLE_SYSTEM);
   register_node_typeinfo(&DNTI_PARTICLE_SETTINGS);
   register_node_typeinfo(&DNTI_POINT_CACHE);
+  register_node_typeinfo(&DNTI_IMAGE_ANIMATION);
   register_node_typeinfo(&DNTI_PROXY);
   register_node_typeinfo(&DNTI_EVAL_POSE);
   register_node_typeinfo(&DNTI_SEQUENCER);
diff --git a/source/blender/depsgraph/intern/node/deg_node_component.h b/source/blender/depsgraph/intern/node/deg_node_component.h
index 53fbc6e617c..b2619ade795 100644
--- a/source/blender/depsgraph/intern/node/deg_node_component.h
+++ b/source/blender/depsgraph/intern/node/deg_node_component.h
@@ -172,6 +172,7 @@ DEG_COMPONENT_NODE_DECLARE_NO_COW_TAG_ON_UPDATE(BatchCache);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(Cache);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(CopyOnWrite);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(Geometry);
+DEG_COMPONENT_NODE_DECLARE_GENERIC(ImageAnimation);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(LayerCollections);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(Parameters);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(Particles);



More information about the Bf-blender-cvs mailing list