Depsgraph: Use dedicated ocmponent for object's base flags flush

This commit is contained in:
Sergey Sharybin 2018-06-14 15:00:50 +02:00
parent 87b2444270
commit 42d8872014
8 changed files with 13 additions and 4 deletions

View 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,

View 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");
}

View 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;

View 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;
}
}

View 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);

View 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) **** */

View 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

View 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 {