Depsgraph: Use dedicated ocmponent for object's base flags flush
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 14 Jun 2018 13:00:50 +0000 (15:00 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 14 Jun 2018 14:04:09 +0000 (16:04 +0200)
source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
source/blender/depsgraph/intern/builder/deg_builder_relations.cc
source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc
source/blender/depsgraph/intern/depsgraph_tag.cc
source/blender/depsgraph/intern/depsgraph_type_defines.cc
source/blender/depsgraph/intern/depsgraph_types.h
source/blender/depsgraph/intern/nodes/deg_node_component.cc
source/blender/depsgraph/intern/nodes/deg_node_component.h

index 4ea2840..ba34d24 100644 (file)
@@ -552,7 +552,7 @@ void DepsgraphNodeBuilder::build_object_flags(
        const bool is_from_set = (linked_state == DEG_ID_LINKED_VIA_SET);
        /* TODO(sergey): Is this really best component to be used? */
        add_operation_node(&object->id,
-                          DEG_NODE_TYPE_LAYER_COLLECTIONS,
+                          DEG_NODE_TYPE_OBJECT_FROM_LAYER,
                           function_bind(BKE_object_eval_flush_base_flags,
                                         _1,
                                         scene_cow,
index f1eb637..5312c7a 100644 (file)
@@ -606,7 +606,7 @@ void DepsgraphRelationBuilder::build_object_flags(Base *base, Object *object)
                                         DEG_NODE_TYPE_LAYER_COLLECTIONS,
                                         DEG_OPCODE_VIEW_LAYER_EVAL);
        OperationKey object_flags_key(&object->id,
-                                     DEG_NODE_TYPE_LAYER_COLLECTIONS,
+                                     DEG_NODE_TYPE_OBJECT_FROM_LAYER,
                                      DEG_OPCODE_OBJECT_BASE_FLAGS);
        add_relation(view_layer_done_key, object_flags_key, "Base flags flush");
 }
index d64ab79..72b86f6 100644 (file)
@@ -386,6 +386,7 @@ static void deg_debug_graphviz_node(const DebugContext &ctx,
                case DEG_NODE_TYPE_LAYER_COLLECTIONS:
                case DEG_NODE_TYPE_EVAL_PARTICLES:
                case DEG_NODE_TYPE_COPY_ON_WRITE:
+               case DEG_NODE_TYPE_OBJECT_FROM_LAYER:
                case DEG_NODE_TYPE_BATCH_CACHE:
                {
                        ComponentDepsNode *comp_node = (ComponentDepsNode *)node;
index 437999a..0c349ba 100644 (file)
@@ -142,7 +142,7 @@ void depsgraph_select_tag_to_component_opcode(
                *operation_code = DEG_OPCODE_VIEW_LAYER_EVAL;
        }
        else if (id_type == ID_OB) {
-               *component_type = DEG_NODE_TYPE_LAYER_COLLECTIONS;
+               *component_type = DEG_NODE_TYPE_OBJECT_FROM_LAYER;
                *operation_code = DEG_OPCODE_OBJECT_BASE_FLAGS;
        }
        else {
@@ -162,7 +162,7 @@ void depsgraph_base_flags_tag_to_component_opcode(
                *operation_code = DEG_OPCODE_VIEW_LAYER_EVAL;
        }
        else if (id_type == ID_OB) {
-               *component_type = DEG_NODE_TYPE_LAYER_COLLECTIONS;
+               *component_type = DEG_NODE_TYPE_OBJECT_FROM_LAYER;
                *operation_code = DEG_OPCODE_OBJECT_BASE_FLAGS;
        }
 }
index 79d29f7..9b1733b 100644 (file)
@@ -92,6 +92,7 @@ const char *nodeTypeAsString(eDepsNode_Type type)
                STRINGIFY_TYPE(SEQUENCER);
                STRINGIFY_TYPE(LAYER_COLLECTIONS);
                STRINGIFY_TYPE(COPY_ON_WRITE);
+               STRINGIFY_TYPE(OBJECT_FROM_LAYER);
                /* **** Evaluation-Related Outer Types (with Subdata) **** */
                STRINGIFY_TYPE(EVAL_POSE);
                STRINGIFY_TYPE(BONE);
index cec279a..c6eb0d5 100644 (file)
@@ -134,6 +134,10 @@ typedef enum eDepsNode_Type {
         * execution.
         */
        DEG_NODE_TYPE_COPY_ON_WRITE,
+       /* Used by all operations which are updating object when something is
+        * changed in view layer.
+        */
+       DEG_NODE_TYPE_OBJECT_FROM_LAYER,
 
        /* **** Evaluation-Related Outer Types (with Subdata) **** */
 
index 699ee1a..9600ead 100644 (file)
@@ -392,6 +392,7 @@ DEG_COMPONENT_NODE_DEFINE(Sequencer,         SEQUENCER,          ID_RECALC);
 DEG_COMPONENT_NODE_DEFINE(Shading,           SHADING,            ID_RECALC_DRAW);
 DEG_COMPONENT_NODE_DEFINE(ShadingParameters, SHADING_PARAMETERS, ID_RECALC_DRAW);
 DEG_COMPONENT_NODE_DEFINE(Transform,         TRANSFORM,          ID_RECALC_TRANSFORM);
+DEG_COMPONENT_NODE_DEFINE(ObjectFromLayer,   OBJECT_FROM_LAYER,  ID_RECALC);
 
 /* Node Types Register =================================== */
 
@@ -412,6 +413,7 @@ void deg_register_component_depsnodes()
        deg_register_node_typeinfo(&DNTI_SHADING);
        deg_register_node_typeinfo(&DNTI_SHADING_PARAMETERS);
        deg_register_node_typeinfo(&DNTI_TRANSFORM);
+       deg_register_node_typeinfo(&DNTI_OBJECT_FROM_LAYER);
 }
 
 }  // namespace DEG
index 5b6461f..7338a99 100644 (file)
@@ -182,6 +182,7 @@ DEG_COMPONENT_NODE_DECLARE_GENERIC(Sequencer);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(Shading);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(ShadingParameters);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(Transform);
+DEG_COMPONENT_NODE_DECLARE_GENERIC(ObjectFromLayer);
 
 /* Bone Component */
 struct BoneComponentDepsNode : public ComponentDepsNode {