diff options
Diffstat (limited to 'source/blender/depsgraph/intern')
34 files changed, 210 insertions, 140 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder.cc b/source/blender/depsgraph/intern/builder/deg_builder.cc index 41512168f57..b2e136c3d3b 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder.cc @@ -176,7 +176,22 @@ void deg_graph_build_flush_visibility(Depsgraph *graph) for (Relation *rel : op_node->inlinks) { if (rel->from->type == NodeType::OPERATION) { OperationNode *op_from = (OperationNode *)rel->from; - op_from->owner->affects_directly_visible |= op_node->owner->affects_directly_visible; + ComponentNode *comp_from = op_from->owner; + const bool target_directly_visible = op_node->owner->affects_directly_visible; + + /* Visibility component forces all components of the current ID to be considered as + * affecting directly visible. */ + if (comp_from->type == NodeType::VISIBILITY) { + if (target_directly_visible) { + IDNode *id_node_from = comp_from->owner; + for (ComponentNode *comp_node : id_node_from->components.values()) { + comp_node->affects_directly_visible |= target_directly_visible; + } + } + } + else { + comp_from->affects_directly_visible |= target_directly_visible; + } } } /* Schedule parent nodes. */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index a09f79ffa39..51582508b6f 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -179,15 +179,30 @@ IDNode *DepsgraphNodeBuilder::add_id_node(ID *id) id_node->previously_visible_components_mask = previously_visible_components_mask; id_node->previous_eval_flags = previous_eval_flags; id_node->previous_customdata_masks = previous_customdata_masks; + /* NOTE: Zero number of components indicates that ID node was just created. */ - if (id_node->components.is_empty() && deg_copy_on_write_is_needed(id_type)) { - ComponentNode *comp_cow = id_node->add_component(NodeType::COPY_ON_WRITE); - OperationNode *op_cow = comp_cow->add_operation( - [id_node](::Depsgraph *depsgraph) { deg_evaluate_copy_on_write(depsgraph, id_node); }, - OperationCode::COPY_ON_WRITE, - "", - -1); - graph_->operations.append(op_cow); + const bool is_newly_created = id_node->components.is_empty(); + + if (is_newly_created) { + if (deg_copy_on_write_is_needed(id_type)) { + ComponentNode *comp_cow = id_node->add_component(NodeType::COPY_ON_WRITE); + OperationNode *op_cow = comp_cow->add_operation( + [id_node](::Depsgraph *depsgraph) { deg_evaluate_copy_on_write(depsgraph, id_node); }, + OperationCode::COPY_ON_WRITE, + "", + -1); + graph_->operations.append(op_cow); + } + + ComponentNode *visibility_component = id_node->add_component(NodeType::VISIBILITY); + OperationNode *visibility_operation = visibility_component->add_operation( + nullptr, OperationCode::OPERATION, "", -1); + /* Pin the node so that it and its relations are preserved by the unused nodes/relations + * deletion. This is mainly to make it easier to debug visibility. */ + /* NOTE: Keep un-pinned for the 3.0 release. This way we are more sure that side effects of the + * change is minimal outside of the dependency graph area. */ + // visibility_operation->flag |= OperationFlag::DEPSOP_FLAG_PINNED; + graph_->operations.append(visibility_operation); } return id_node; } @@ -375,8 +390,6 @@ void DepsgraphNodeBuilder::begin_build() * NOTE: This is split in two, a static function and a public method of the node builder, to allow * the code to access the builder's data more easily. */ -/* `id_cow_self` is the user of `id_pointer`, see also `LibraryIDLinkCallbackData` struct - * definition. */ int DepsgraphNodeBuilder::foreach_id_cow_detect_need_for_update_callback(ID *id_cow_self, ID *id_pointer) { @@ -425,21 +438,18 @@ static int foreach_id_cow_detect_need_for_update_callback(LibraryIDLinkCallbackD return builder->foreach_id_cow_detect_need_for_update_callback(id_cow_self, id); } -/* Check for IDs that need to be flushed (COW-updated) because the depsgraph itself created or - * removed some of their evaluated dependencies. - * - * NOTE: Currently the only ID types that depsgraph may decide to not evaluate/generate COW - * copies for, even though they are referenced by other data-blocks, are Collections and Objects - * (through their various visibility flags, and the ones from LayerCollections too). However, this - * code is kept generic as it makes it more future-proof, and optimization here would give - * negligible performance improvements in typical cases. - * - * NOTE: This mechanism may also 'fix' some missing update tagging from non-depsgraph code in - * some cases. This is slightly unfortunate (as it may hide issues in other parts of Blender - * code), but cannot really be avoided currently. - */ void DepsgraphNodeBuilder::update_invalid_cow_pointers() { + /* NOTE: Currently the only ID types that depsgraph may decide to not evaluate/generate COW + * copies for, even though they are referenced by other data-blocks, are Collections and Objects + * (through their various visibility flags, and the ones from #LayerCollections too). However, + * this code is kept generic as it makes it more future-proof, and optimization here would give + * negligible performance improvements in typical cases. + * + * NOTE: This mechanism may also 'fix' some missing update tagging from non-depsgraph code in + * some cases. This is slightly unfortunate (as it may hide issues in other parts of Blender + * code), but cannot really be avoided currently. */ + for (const IDNode *id_node : graph_->id_nodes) { if (id_node->previously_visible_components_mask == 0) { /* Newly added node/ID, no need to check it. */ @@ -1056,10 +1066,6 @@ void DepsgraphNodeBuilder::build_object_pointcache(Object *object) }); } -/** - * Build graph nodes for AnimData block and any animated images used. - * \param id: ID-Block which hosts the AnimData - */ void DepsgraphNodeBuilder::build_animdata(ID *id) { /* Special handling for animated images/sequences. */ @@ -1113,9 +1119,6 @@ void DepsgraphNodeBuilder::build_animdata_nlastrip_targets(ListBase *strips) } } -/** - * Build graph nodes to update the current frame in image users. - */ void DepsgraphNodeBuilder::build_animation_images(ID *id) { if (BKE_image_user_id_has_animation(id)) { @@ -1137,12 +1140,6 @@ void DepsgraphNodeBuilder::build_action(bAction *action) add_operation_node(&action->id, NodeType::ANIMATION, OperationCode::ANIMATION_EVAL); } -/** - * Build graph node(s) for Driver - * \param id: ID-Block that driver is attached to - * \param fcu: Driver-FCurve - * \param driver_index: Index in animation data drivers list - */ void DepsgraphNodeBuilder::build_driver(ID *id, FCurve *fcurve, int driver_index) { /* Create data node for this driver */ @@ -1715,7 +1712,6 @@ void DepsgraphNodeBuilder::build_nodetree(bNodeTree *ntree) build_animdata(&ntree->id); /* Shading update. */ add_operation_node(&ntree->id, NodeType::SHADING, OperationCode::MATERIAL_UPDATE); - add_operation_node(&ntree->id, NodeType::SHADING_PARAMETERS, OperationCode::MATERIAL_UPDATE); /* nodetree's nodes... */ LISTBASE_FOREACH (bNode *, bnode, &ntree->nodes) { build_idproperties(bnode->prop); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h index d31290ecbff..2d24dc49802 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h @@ -102,6 +102,10 @@ class DepsgraphNodeBuilder : public DepsgraphBuilder { virtual void begin_build(); virtual void end_build(); + /** + * `id_cow_self` is the user of `id_pointer`, + * see also `LibraryIDLinkCallbackData` struct definition. + */ int foreach_id_cow_detect_need_for_update_callback(ID *id_cow_self, ID *id_pointer); IDNode *add_id_node(ID *id); @@ -199,10 +203,23 @@ class DepsgraphNodeBuilder : public DepsgraphBuilder { virtual void build_rigidbody(Scene *scene); virtual void build_particle_systems(Object *object, bool is_object_visible); virtual void build_particle_settings(ParticleSettings *part); + /** + * Build graph nodes for #AnimData block and any animated images used. + * \param id: ID-Block which hosts the #AnimData + */ virtual void build_animdata(ID *id); virtual void build_animdata_nlastrip_targets(ListBase *strips); + /** + * Build graph nodes to update the current frame in image users. + */ virtual void build_animation_images(ID *id); virtual void build_action(bAction *action); + /** + * Build graph node(s) for Driver + * \param id: ID-Block that driver is attached to + * \param fcurve: Driver-FCurve + * \param driver_index: Index in animation data drivers list + */ virtual void build_driver(ID *id, FCurve *fcurve, int driver_index); virtual void build_driver_variables(ID *id, FCurve *fcurve); virtual void build_driver_id_property(ID *id, const char *rna_path); @@ -280,6 +297,10 @@ class DepsgraphNodeBuilder : public DepsgraphBuilder { void *user_data); void tag_previously_tagged_nodes(); + /** + * Check for IDs that need to be flushed (COW-updated) + * because the depsgraph itself created or removed some of their evaluated dependencies. + */ void update_invalid_cow_pointers(); /* State which demotes currently built entities. */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.cc b/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.cc index 17c2925b7f4..79f358213d3 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.cc @@ -30,7 +30,6 @@ namespace blender::deg { -/* Debug contents of map */ void RootPChanMap::print_debug() { map_.foreach_item([](StringRefNull key, const Set<StringRefNull> &values) { @@ -42,13 +41,11 @@ void RootPChanMap::print_debug() }); } -/* Add a mapping. */ void RootPChanMap::add_bone(const char *bone, const char *root) { map_.lookup_or_add_default(bone).add(root); } -/* Check if there's a common root bone between two bones. */ bool RootPChanMap::has_common_root(const char *bone1, const char *bone2) const { const Set<StringRefNull> *bone1_roots = map_.lookup_ptr(bone1); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.h b/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.h index 0dd4062c353..42f9ec9cc6a 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.h @@ -29,13 +29,13 @@ namespace blender { namespace deg { struct RootPChanMap { - /* Debug contents of map. */ + /** Debug contents of map. */ void print_debug(); - /* Add a mapping. */ + /** Add a mapping. */ void add_bone(const char *bone, const char *root); - /* Check if there's a common root bone between two bones. */ + /** Check if there's a common root bone between two bones. */ bool has_common_root(const char *bone1, const char *bone2) const; protected: diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 55e8c5ed033..b195b2d9e11 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -368,6 +368,13 @@ Relation *DepsgraphRelationBuilder::add_time_relation(TimeSourceNode *timesrc, return nullptr; } +void DepsgraphRelationBuilder::add_visibility_relation(ID *id_from, ID *id_to) +{ + ComponentKey from_key(id_from, NodeType::VISIBILITY); + ComponentKey to_key(id_to, NodeType::VISIBILITY); + add_relation(from_key, to_key, "visibility"); +} + Relation *DepsgraphRelationBuilder::add_operation_relation(OperationNode *node_from, OperationNode *node_to, const char *description, @@ -2066,7 +2073,8 @@ void DepsgraphRelationBuilder::build_shapekeys(Key *key) * and also for the links coming from the shapekey data-blocks * - Animation/Drivers affecting the parameters of the geometry are made to * trigger updates on the obdata geometry component, which then trigger - * downstream re-evaluation of the individual instances of this geometry. */ + * downstream re-evaluation of the individual instances of this geometry. + */ void DepsgraphRelationBuilder::build_object_data_geometry(Object *object) { ID *obdata = (ID *)object->data; @@ -2521,16 +2529,13 @@ void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree) } OperationKey shading_update_key(&ntree->id, NodeType::SHADING, OperationCode::MATERIAL_UPDATE); - OperationKey shading_parameters_key( - &ntree->id, NodeType::SHADING_PARAMETERS, OperationCode::MATERIAL_UPDATE); - add_relation(shading_parameters_key, shading_update_key, "NTree Shading Parameters"); if (check_id_has_anim_component(&ntree->id)) { ComponentKey animation_key(&ntree->id, NodeType::ANIMATION); - add_relation(animation_key, shading_parameters_key, "NTree Shading Parameters"); + add_relation(animation_key, shading_update_key, "NTree Shading Parameters"); } ComponentKey parameters_key(&ntree->id, NodeType::PARAMETERS); - add_relation(parameters_key, shading_parameters_key, "NTree Shading Parameters"); + add_relation(parameters_key, shading_update_key, "NTree Shading Parameters"); } /* Recursively build graph for material */ @@ -2864,7 +2869,8 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations() } } -/* Nested datablocks (node trees, shape keys) requires special relation to +/** + * Nested datablocks (node trees, shape keys) requires special relation to * ensure owner's datablock remapping happens after node tree itself is ready. * * This is similar to what happens in ntree_hack_remap_pointers(). diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h index f0393544511..09003de3ce4 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h @@ -336,6 +336,11 @@ class DepsgraphRelationBuilder : public DepsgraphBuilder { Node *node_to, const char *description, int flags = 0); + + /* Add relation which ensures visibility of `id_from` when `id_to` is visible. + * For the more detailed explanation see comment for `NodeType::VISIBILITY`. */ + void add_visibility_relation(ID *id_from, ID *id_to); + Relation *add_operation_relation(OperationNode *node_from, OperationNode *node_to, const char *description, diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc index bf3af571f0b..6e5c1f05cf3 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc @@ -83,7 +83,6 @@ bool DriverDescriptor::is_array() const return is_array_; } -/* Assumes that 'other' comes from the same RNA group, that is, has the same RNA path prefix. */ bool DriverDescriptor::is_same_array_as(const DriverDescriptor &other) const { if (!is_array_ || !other.is_array_) { diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.h b/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.h index c80c69be9e2..4ad5bdda1ef 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.h @@ -37,14 +37,17 @@ namespace deg { /* Helper class for determining which relations are needed between driver evaluation nodes. */ class DriverDescriptor { public: - /* Drivers are grouped by their RNA prefix. The prefix is the part of the RNA + /** + * Drivers are grouped by their RNA prefix. The prefix is the part of the RNA * path up to the last dot, the suffix is the remainder of the RNA path: * + * \code{.unparsed} * fcu->rna_path rna_prefix rna_suffix * ------------------------------- ---------------------- ---------- * 'color' '' 'color' * 'rigidbody_world.time_scale' 'rigidbody_world' 'time_scale' * 'pose.bones["master"].location' 'pose.bones["master"]' 'location' + * \endcode */ StringRef rna_prefix; StringRef rna_suffix; @@ -54,7 +57,7 @@ class DriverDescriptor { bool driver_relations_needed() const; bool is_array() const; - /* Assumes that 'other' comes from the same RNA group, that is, has the same RNA path prefix. */ + /** Assumes that 'other' comes from the same RNA group, that is, has the same RNA path prefix. */ bool is_same_array_as(const DriverDescriptor &other) const; OperationKey depsgraph_key() const; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc index 4754749e2e5..3039eebe857 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc @@ -450,6 +450,7 @@ void DepsgraphRelationBuilder::build_rig(Object *object) /* Custom shape. */ if (pchan->custom != nullptr) { build_object(pchan->custom); + add_visibility_relation(&pchan->custom->id, &armature->id); } } } @@ -506,6 +507,12 @@ void DepsgraphRelationBuilder::build_proxy_rig(Object *object) &proxy_from->id, NodeType::PARAMETERS, OperationCode::PARAMETERS_EVAL, pchan->name); add_relation(from_bone_parameters, bone_parameters, "Proxy Bone Parameters"); } + + /* Custom shape. */ + if (pchan->custom != nullptr) { + build_object(pchan->custom); + add_visibility_relation(&pchan->custom->id, &armature->id); + } } } 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 57c6f062611..7be661d9668 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc @@ -105,11 +105,10 @@ static const int deg_debug_node_type_color_map[][2] = { {NodeType::GEOMETRY, 6}, {NodeType::SEQUENCER, 7}, {NodeType::SHADING, 8}, - {NodeType::SHADING_PARAMETERS, 9}, - {NodeType::CACHE, 10}, - {NodeType::POINT_CACHE, 11}, - {NodeType::LAYER_COLLECTIONS, 12}, - {NodeType::COPY_ON_WRITE, 13}, + {NodeType::CACHE, 9}, + {NodeType::POINT_CACHE, 10}, + {NodeType::LAYER_COLLECTIONS, 11}, + {NodeType::COPY_ON_WRITE, 12}, {-1, 0}, }; #endif @@ -411,7 +410,6 @@ static void deg_debug_graphviz_node(DotExportContext &ctx, case NodeType::EVAL_POSE: case NodeType::BONE: case NodeType::SHADING: - case NodeType::SHADING_PARAMETERS: case NodeType::CACHE: case NodeType::POINT_CACHE: case NodeType::IMAGE_ANIMATION: @@ -426,6 +424,7 @@ static void deg_debug_graphviz_node(DotExportContext &ctx, case NodeType::AUDIO: case NodeType::ARMATURE: case NodeType::GENERIC_DATABLOCK: + case NodeType::VISIBILITY: case NodeType::SIMULATION: { ComponentNode *comp_node = (ComponentNode *)node; if (comp_node->operations.is_empty()) { diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index 4c036417ba0..b348ab0f432 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -182,7 +182,6 @@ void Depsgraph::clear_id_nodes() clear_physics_relations(this); } -/* Add new relation between two nodes */ Relation *Depsgraph::add_new_relation(Node *from, Node *to, const char *description, int flags) { Relation *rel = nullptr; @@ -228,7 +227,6 @@ Relation *Depsgraph::check_nodes_connected(const Node *from, /* Low level tagging -------------------------------------- */ -/* Tag a specific node as needing updates. */ void Depsgraph::add_entry_tag(OperationNode *node) { /* Sanity check. */ @@ -280,7 +278,6 @@ ID *Depsgraph::get_cow_id(const ID *id_orig) const /* **************** */ /* Public Graph API */ -/* Initialize a new Depsgraph */ Depsgraph *DEG_graph_new(Main *bmain, Scene *scene, ViewLayer *view_layer, eEvaluationMode mode) { deg::Depsgraph *deg_depsgraph = new deg::Depsgraph(bmain, scene, view_layer, mode); @@ -288,10 +285,6 @@ Depsgraph *DEG_graph_new(Main *bmain, Scene *scene, ViewLayer *view_layer, eEval return reinterpret_cast<Depsgraph *>(deg_depsgraph); } -/* Replace the "owner" pointers (currently Main/Scene/ViewLayer) of this depsgraph. - * Used for: - * - Undo steps when we do want to re-use the old depsgraph data as much as possible. - * - Rendering where we want to re-use objects between different view layers. */ void DEG_graph_replace_owners(struct Depsgraph *depsgraph, Main *bmain, Scene *scene, @@ -313,7 +306,6 @@ void DEG_graph_replace_owners(struct Depsgraph *depsgraph, } } -/* Free graph's contents and graph itself */ void DEG_graph_free(Depsgraph *graph) { if (graph == nullptr) { diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h index 913b61ca563..bfe6ed649f6 100644 --- a/source/blender/depsgraph/intern/depsgraph.h +++ b/source/blender/depsgraph/intern/depsgraph.h @@ -72,7 +72,7 @@ struct Depsgraph { IDNode *add_id_node(ID *id, ID *id_cow_hint = nullptr); void clear_id_nodes(); - /* Add new relationship between two nodes. */ + /** Add new relationship between two nodes. */ Relation *add_new_relation(Node *from, Node *to, const char *description, int flags = 0); /* Check whether two nodes are connected by relation with given diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc index 9e9191c5ab9..db00c595383 100644 --- a/source/blender/depsgraph/intern/depsgraph_build.cc +++ b/source/blender/depsgraph/intern/depsgraph_build.cc @@ -252,7 +252,6 @@ struct Depsgraph *DEG_get_graph_from_handle(struct DepsNodeHandle *node_handle) /* ******************** */ /* Graph Building API's */ -/* Build depsgraph for the given scene layer, and dump results in given graph container. */ void DEG_graph_build_from_view_layer(Depsgraph *graph) { deg::ViewLayerBuilderPipeline builder(graph); @@ -283,7 +282,6 @@ void DEG_graph_build_from_ids(Depsgraph *graph, ID **ids, const int num_ids) builder.build(); } -/* Tag graph relations for update. */ void DEG_graph_tag_relations_update(Depsgraph *graph) { DEG_DEBUG_PRINTF(graph, TAG, "%s: Tagging relations for update.\n", __func__); @@ -301,7 +299,6 @@ void DEG_graph_tag_relations_update(Depsgraph *graph) } } -/* Create or update relations in the specified graph. */ void DEG_graph_relations_update(Depsgraph *graph) { deg::Depsgraph *deg_graph = (deg::Depsgraph *)graph; @@ -312,7 +309,6 @@ void DEG_graph_relations_update(Depsgraph *graph) DEG_graph_build_from_view_layer(graph); } -/* Tag all relations for update. */ void DEG_relations_tag_update(Main *bmain) { DEG_GLOBAL_DEBUG_PRINTF(TAG, "%s: Tagging relations for update.\n", __func__); diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cc b/source/blender/depsgraph/intern/depsgraph_debug.cc index 3677f80469c..9e3cbdbec09 100644 --- a/source/blender/depsgraph/intern/depsgraph_debug.cc +++ b/source/blender/depsgraph/intern/depsgraph_debug.cc @@ -196,12 +196,6 @@ bool DEG_debug_consistency_check(Depsgraph *graph) /* ------------------------------------------------ */ -/** - * Obtain simple statistics about the complexity of the depsgraph. - * \param[out] r_outer: The number of outer nodes in the graph - * \param[out] r_operations: The number of operation nodes in the graph - * \param[out] r_relations: The number of relations between (executable) nodes in the graph - */ void DEG_stats_simple(const Depsgraph *graph, size_t *r_outer, size_t *r_operations, diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cc b/source/blender/depsgraph/intern/depsgraph_eval.cc index 0314219b725..7952f27507f 100644 --- a/source/blender/depsgraph/intern/depsgraph_eval.cc +++ b/source/blender/depsgraph/intern/depsgraph_eval.cc @@ -60,7 +60,6 @@ static void deg_flush_updates_and_refresh(deg::Depsgraph *deg_graph) deg::deg_evaluate_on_refresh(deg_graph); } -/* Evaluate all nodes tagged for updating. */ void DEG_evaluate_on_refresh(Depsgraph *graph) { deg::Depsgraph *deg_graph = reinterpret_cast<deg::Depsgraph *>(graph); @@ -77,7 +76,6 @@ void DEG_evaluate_on_refresh(Depsgraph *graph) deg_flush_updates_and_refresh(deg_graph); } -/* Frame-change happened for root scene that graph belongs to. */ void DEG_evaluate_on_framechange(Depsgraph *graph, float frame) { deg::Depsgraph *deg_graph = reinterpret_cast<deg::Depsgraph *>(graph); diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc index aab4c3ca0f6..6c1947728b5 100644 --- a/source/blender/depsgraph/intern/depsgraph_query.cc +++ b/source/blender/depsgraph/intern/depsgraph_query.cc @@ -200,7 +200,6 @@ ID *DEG_get_evaluated_id(const Depsgraph *depsgraph, ID *id) return id_node->id_cow; } -/* Get evaluated version of data pointed to by RNA pointer */ void DEG_get_evaluated_rna_pointer(const Depsgraph *depsgraph, PointerRNA *ptr, PointerRNA *r_ptr_eval) diff --git a/source/blender/depsgraph/intern/depsgraph_query_foreach.cc b/source/blender/depsgraph/intern/depsgraph_query_foreach.cc index 6ce7cc0837b..65a21323258 100644 --- a/source/blender/depsgraph/intern/depsgraph_query_foreach.cc +++ b/source/blender/depsgraph/intern/depsgraph_query_foreach.cc @@ -77,6 +77,12 @@ void deg_foreach_dependent_operation(const Depsgraph *UNUSED(graph), TraversalQueue queue; Set<OperationNode *> scheduled; for (ComponentNode *comp_node : target_id_node->components.values()) { + if (comp_node->type == NodeType::VISIBILITY) { + /* Visibility component is only used internally. It is not to be reporting dependencies to + * the outer world. */ + continue; + } + if (source_component_type != DEG_OB_COMP_ANY && nodeTypeToObjectComponent(comp_node->type) != source_component_type) { continue; diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index dd96c5a3b2b..2b0d0e6e780 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -193,12 +193,7 @@ void depsgraph_tag_to_component_opcode(const ID *id, *component_type = NodeType::COPY_ON_WRITE; break; case ID_RECALC_SHADING: - if (id_type == ID_NT) { - *component_type = NodeType::SHADING_PARAMETERS; - } - else { - *component_type = NodeType::SHADING; - } + *component_type = NodeType::SHADING; break; case ID_RECALC_SELECT: depsgraph_select_tag_to_component_opcode(id, component_type, operation_code); @@ -760,7 +755,6 @@ const char *DEG_update_tag_as_string(IDRecalcFlag flag) /* Data-Based Tagging. */ -/* Tag given ID for an update in all the dependency graphs. */ void DEG_id_tag_update(ID *id, int flag) { DEG_id_tag_update_ex(G.main, id, flag); @@ -797,7 +791,6 @@ void DEG_graph_time_tag_update(struct Depsgraph *depsgraph) deg_graph->tag_time_source(); } -/* Mark a particular data-block type as having changing. */ void DEG_graph_id_type_tag(Depsgraph *depsgraph, short id_type) { if (id_type == ID_NT) { @@ -822,7 +815,6 @@ void DEG_id_type_tag(Main *bmain, short id_type) } } -/* Update dependency graph when visible scenes/layers changes. */ void DEG_graph_tag_on_visible_update(Depsgraph *depsgraph, const bool do_time) { deg::Depsgraph *graph = (deg::Depsgraph *)depsgraph; @@ -842,8 +834,6 @@ void DEG_enable_editors_update(Depsgraph *depsgraph) graph->use_editors_update = true; } -/* Check if something was changed in the database and inform - * editors about this. */ void DEG_editors_update(Depsgraph *depsgraph, bool time) { deg::Depsgraph *graph = (deg::Depsgraph *)depsgraph; diff --git a/source/blender/depsgraph/intern/depsgraph_type.cc b/source/blender/depsgraph/intern/depsgraph_type.cc index 07664cb4f0b..0405a7d90b4 100644 --- a/source/blender/depsgraph/intern/depsgraph_type.cc +++ b/source/blender/depsgraph/intern/depsgraph_type.cc @@ -39,8 +39,7 @@ namespace deg = blender::deg; -/* Register all node types */ -void DEG_register_node_types(void) +void DEG_register_node_types() { /* register node types */ deg::deg_register_base_depsnodes(); @@ -48,8 +47,7 @@ void DEG_register_node_types(void) deg::deg_register_operation_depsnodes(); } -/* Free registry on exit */ -void DEG_free_node_types(void) +void DEG_free_node_types() { } diff --git a/source/blender/depsgraph/intern/depsgraph_update.cc b/source/blender/depsgraph/intern/depsgraph_update.cc index bb72320ca67..ec287edbd12 100644 --- a/source/blender/depsgraph/intern/depsgraph_update.cc +++ b/source/blender/depsgraph/intern/depsgraph_update.cc @@ -50,7 +50,6 @@ void deg_editors_scene_update(const DEGEditorUpdateContext *update_ctx, bool upd } // namespace blender::deg -/* Set callbacks which are being called when depsgraph changes. */ void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, DEG_EditorUpdateSceneCb scene_func) { deg::deg_editor_update_id_cb = id_func; diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc index d6877adb66b..30aeeee5b2c 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval.cc @@ -361,13 +361,6 @@ static TaskPool *deg_evaluate_task_pool_create(DepsgraphEvalState *state) return BLI_task_pool_create_suspended(state, TASK_PRIORITY_HIGH); } -/** - * Evaluate all nodes tagged for updating, - * \warning This is usually done as part of main loop, but may also be - * called from frame-change update. - * - * \note Time sources should be all valid! - */ void deg_evaluate_on_refresh(Depsgraph *graph) { /* Nothing to update, early out. */ diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index 68a72638c7d..116dba054fa 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -906,7 +906,9 @@ ID *deg_update_copy_on_write_datablock(const Depsgraph *depsgraph, const IDNode return id_cow; } -/* NOTE: Depsgraph is supposed to have ID node already. */ +/** + * \note Depsgraph is supposed to have ID node already. + */ ID *deg_update_copy_on_write_datablock(const Depsgraph *depsgraph, ID *id_orig) { IDNode *id_node = depsgraph->find_id_node(id_orig); @@ -987,10 +989,12 @@ void discard_edit_mode_pointers(ID *id_cow) } // namespace -/* Free content of the CoW data-block +/** + Free content of the CoW data-block. * Notes: * - Does not recurse into nested ID data-blocks. - * - Does not free data-block itself. */ + * - Does not free data-block itself. + */ void deg_free_copy_on_write_datablock(ID *id_cow) { if (!check_datablock_expanded(id_cow)) { diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h index 70e510b5ef9..bc023766a46 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h @@ -50,34 +50,40 @@ struct Depsgraph; class DepsgraphNodeBuilder; struct IDNode; -/* Makes sure given CoW data-block is brought back to state of the original +/** + * Makes sure given CoW data-block is brought back to state of the original * data-block. */ ID *deg_update_copy_on_write_datablock(const struct Depsgraph *depsgraph, const IDNode *id_node); ID *deg_update_copy_on_write_datablock(const struct Depsgraph *depsgraph, struct ID *id_orig); -/* Helper function which frees memory used by copy-on-written data-block. */ +/** Helper function which frees memory used by copy-on-written data-block. */ void deg_free_copy_on_write_datablock(struct ID *id_cow); -/* Callback function for depsgraph operation node which ensures copy-on-write +/** + * Callback function for depsgraph operation node which ensures copy-on-write * data-block is ready for use by further evaluation routines. */ void deg_evaluate_copy_on_write(struct ::Depsgraph *depsgraph, const struct IDNode *id_node); -/* Check that given ID is properly expanded and does not have any shallow - * copies inside. */ +/** + * Check that given ID is properly expanded and does not have any shallow + * copies inside. + */ bool deg_validate_copy_on_write_datablock(ID *id_cow); -/* Tag given ID block as being copy-on-written. */ +/** Tag given ID block as being copy-on-written. */ void deg_tag_copy_on_write_id(struct ID *id_cow, const struct ID *id_orig); -/* Check whether ID data-block is expanded. +/** + * Check whether ID data-block is expanded. * * TODO(sergey): Make it an inline function or a macro. */ bool deg_copy_on_write_is_expanded(const struct ID *id_cow); -/* Check whether copy-on-write data-block is needed for given ID. +/** + * Check whether copy-on-write data-block is needed for given ID. * * There are some exceptions on data-blocks which are covered by dependency graph * but which we don't want to start duplicating. diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc index a015491e2d7..7ec77689ba5 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc @@ -346,9 +346,6 @@ void invalidate_tagged_evaluated_data(Depsgraph *graph) } // namespace -/* Flush updates from tagged nodes outwards until all affected nodes - * are tagged. - */ void deg_graph_flush_updates(Depsgraph *graph) { /* Sanity checks. */ @@ -395,7 +392,6 @@ void deg_graph_flush_updates(Depsgraph *graph) invalidate_tagged_evaluated_data(graph); } -/* Clear tags from all operation nodes. */ void deg_graph_clear_tags(Depsgraph *graph) { /* Go over all operation nodes, clearing tags. */ diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.h b/source/blender/depsgraph/intern/eval/deg_eval_flush.h index ec661360fdf..d70df62cb38 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.h +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.h @@ -30,12 +30,14 @@ namespace deg { struct Depsgraph; -/* Flush updates from tagged nodes outwards until all affected nodes - * are tagged. +/** + * Flush updates from tagged nodes outwards until all affected nodes are tagged. */ void deg_graph_flush_updates(struct Depsgraph *graph); -/* Clear tags from all operation nodes. */ +/** + * Clear tags from all operation nodes. + */ void deg_graph_clear_tags(struct Depsgraph *graph); } // namespace deg diff --git a/source/blender/depsgraph/intern/node/deg_node.cc b/source/blender/depsgraph/intern/node/deg_node.cc index 16089ba27dd..8bc03d8b736 100644 --- a/source/blender/depsgraph/intern/node/deg_node.cc +++ b/source/blender/depsgraph/intern/node/deg_node.cc @@ -94,8 +94,6 @@ const char *nodeTypeAsString(NodeType type) return "PARTICLE_SETTINGS"; case NodeType::SHADING: return "SHADING"; - case NodeType::SHADING_PARAMETERS: - return "SHADING_PARAMETERS"; case NodeType::CACHE: return "CACHE"; case NodeType::POINT_CACHE: @@ -114,6 +112,8 @@ const char *nodeTypeAsString(NodeType type) return "ARMATURE"; case NodeType::GENERIC_DATABLOCK: return "GENERIC_DATABLOCK"; + case NodeType::VISIBILITY: + return "VISIBILITY"; case NodeType::SIMULATION: return "SIMULATION"; @@ -159,7 +159,6 @@ eDepsSceneComponentType nodeTypeToSceneComponent(NodeType type) case NodeType::GENERIC_DATABLOCK: case NodeType::PARTICLE_SYSTEM: case NodeType::PARTICLE_SETTINGS: - case NodeType::SHADING_PARAMETERS: case NodeType::POINT_CACHE: case NodeType::IMAGE_ANIMATION: case NodeType::BATCH_CACHE: @@ -176,6 +175,10 @@ eDepsSceneComponentType nodeTypeToSceneComponent(NodeType type) case NodeType::PROXY: case NodeType::SIMULATION: return DEG_SCENE_COMP_PARAMETERS; + + case NodeType::VISIBILITY: + BLI_assert_msg(0, "Visibility component is supposed to be only used internally."); + return DEG_SCENE_COMP_PARAMETERS; } BLI_assert_msg(0, "Unhandled node type, not supposed to happen."); return DEG_SCENE_COMP_PARAMETERS; @@ -242,7 +245,6 @@ eDepsObjectComponentType nodeTypeToObjectComponent(NodeType type) case NodeType::GENERIC_DATABLOCK: case NodeType::PARTICLE_SYSTEM: case NodeType::PARTICLE_SETTINGS: - case NodeType::SHADING_PARAMETERS: case NodeType::POINT_CACHE: case NodeType::IMAGE_ANIMATION: case NodeType::BATCH_CACHE: @@ -252,6 +254,10 @@ eDepsObjectComponentType nodeTypeToObjectComponent(NodeType type) case NodeType::UNDEFINED: case NodeType::NUM_TYPES: return DEG_OB_COMP_PARAMETERS; + + case NodeType::VISIBILITY: + BLI_assert_msg(0, "Visibility component is supposed to be only used internally."); + return DEG_OB_COMP_PARAMETERS; } BLI_assert_msg(0, "Unhandled node type, not suppsed to happen."); return DEG_OB_COMP_PARAMETERS; @@ -305,7 +311,6 @@ Node::~Node() } } -/* Generic identifier for Depsgraph Nodes. */ string Node::identifier() const { return string(nodeTypeAsString(type)) + " : " + name; diff --git a/source/blender/depsgraph/intern/node/deg_node.h b/source/blender/depsgraph/intern/node/deg_node.h index e1469b68b0e..7e093ab8765 100644 --- a/source/blender/depsgraph/intern/node/deg_node.h +++ b/source/blender/depsgraph/intern/node/deg_node.h @@ -103,6 +103,22 @@ enum class NodeType { * not have very distinctive update procedure. */ GENERIC_DATABLOCK, + /* Component which is used to define visibility relation between IDs, on the ID level. + * + * Consider two ID nodes NodeA and NodeB, with the relation between visibility components going + * as NodeA -> NodeB. If NodeB is considered visible on screen, then the relation will ensure + * that NodeA is also visible. The way how relation is oriented could be seen as a inverted from + * visibility dependency point of view, but it follows the same direction as data dependency + * which simplifies common algorithms which are dealing with relations and visibility. + * + * The fact that the visibility operates on the ID level basically means that all components in + * NodeA will be considered as affecting directly visible when NodeB's visibility is + * affecting directly visible ID. + * + * This is the way to ensure objects needed for visualization without any actual data dependency + * are properly evaluated. Example of this is custom shapes for bones. */ + VISIBILITY, + /* **** Evaluation-Related Outer Types (with Subdata) **** */ /* Pose Component - Owner/Container of Bones Eval */ @@ -114,7 +130,6 @@ enum class NodeType { PARTICLE_SETTINGS, /* Material Shading Component */ SHADING, - SHADING_PARAMETERS, /* Point cache Component */ POINT_CACHE, /* Image Animation Component */ @@ -186,6 +201,7 @@ struct Node { Node(); virtual ~Node(); + /** Generic identifier for Depsgraph Nodes. */ virtual string identifier() const; virtual void init(const ID * /*id*/, const char * /*subdata*/) diff --git a/source/blender/depsgraph/intern/node/deg_node_component.cc b/source/blender/depsgraph/intern/node/deg_node_component.cc index 0947fad7670..b716877902c 100644 --- a/source/blender/depsgraph/intern/node/deg_node_component.cc +++ b/source/blender/depsgraph/intern/node/deg_node_component.cc @@ -43,7 +43,9 @@ namespace blender::deg { /* *********** */ /* Outer Nodes */ -/* Standard Component Methods ============================= */ +/* -------------------------------------------------------------------- */ +/** \name Standard Component Methods + * \{ */ ComponentNode::OperationIDKey::OperationIDKey() : opcode(OperationCode::OPERATION), name(""), name_tag(-1) @@ -86,7 +88,6 @@ ComponentNode::ComponentNode() operations_map = new Map<ComponentNode::OperationIDKey, OperationNode *>(); } -/* Initialize 'component' node - from pointer data given */ void ComponentNode::init(const ID * /*id*/, const char * /*subdata*/) { /* hook up eval context? */ @@ -297,9 +298,12 @@ void ComponentNode::finalize_build(Depsgraph * /*graph*/) operations_map = nullptr; } -/* Bone Component ========================================= */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Bone Component + * \{ */ -/* Initialize 'bone component' node - from pointer data given */ void BoneComponentNode::init(const ID *id, const char *subdata) { /* generic component-node... */ @@ -315,7 +319,11 @@ void BoneComponentNode::init(const ID *id, const char *subdata) this->pchan = BKE_pose_channel_find_name(object->pose, subdata); } -/* Register all components. =============================== */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Register All Components + * \{ */ DEG_COMPONENT_NODE_DEFINE(Animation, ANIMATION, ID_RECALC_ANIMATION); /* TODO(sergey): Is this a correct tag? */ @@ -334,7 +342,6 @@ DEG_COMPONENT_NODE_DEFINE(Pose, EVAL_POSE, ID_RECALC_GEOMETRY); DEG_COMPONENT_NODE_DEFINE(Proxy, PROXY, ID_RECALC_GEOMETRY); DEG_COMPONENT_NODE_DEFINE(Sequencer, SEQUENCER, 0); DEG_COMPONENT_NODE_DEFINE(Shading, SHADING, ID_RECALC_SHADING); -DEG_COMPONENT_NODE_DEFINE(ShadingParameters, SHADING_PARAMETERS, ID_RECALC_SHADING); DEG_COMPONENT_NODE_DEFINE(Transform, TRANSFORM, ID_RECALC_TRANSFORM); DEG_COMPONENT_NODE_DEFINE(ObjectFromLayer, OBJECT_FROM_LAYER, 0); DEG_COMPONENT_NODE_DEFINE(Dupli, DUPLI, 0); @@ -342,9 +349,14 @@ DEG_COMPONENT_NODE_DEFINE(Synchronization, SYNCHRONIZATION, 0); DEG_COMPONENT_NODE_DEFINE(Audio, AUDIO, 0); DEG_COMPONENT_NODE_DEFINE(Armature, ARMATURE, 0); DEG_COMPONENT_NODE_DEFINE(GenericDatablock, GENERIC_DATABLOCK, 0); +DEG_COMPONENT_NODE_DEFINE(Visibility, VISIBILITY, 0); DEG_COMPONENT_NODE_DEFINE(Simulation, SIMULATION, 0); -/* Node Types Register =================================== */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Node Types Register + * \{ */ void deg_register_component_depsnodes() { @@ -364,7 +376,6 @@ void deg_register_component_depsnodes() register_node_typeinfo(&DNTI_EVAL_POSE); register_node_typeinfo(&DNTI_SEQUENCER); register_node_typeinfo(&DNTI_SHADING); - register_node_typeinfo(&DNTI_SHADING_PARAMETERS); register_node_typeinfo(&DNTI_TRANSFORM); register_node_typeinfo(&DNTI_OBJECT_FROM_LAYER); register_node_typeinfo(&DNTI_DUPLI); @@ -372,7 +383,10 @@ void deg_register_component_depsnodes() register_node_typeinfo(&DNTI_AUDIO); register_node_typeinfo(&DNTI_ARMATURE); register_node_typeinfo(&DNTI_GENERIC_DATABLOCK); + register_node_typeinfo(&DNTI_VISIBILITY); register_node_typeinfo(&DNTI_SIMULATION); } +/** \} */ + } // namespace blender::deg diff --git a/source/blender/depsgraph/intern/node/deg_node_component.h b/source/blender/depsgraph/intern/node/deg_node_component.h index 6e31ef268ed..9f108af8012 100644 --- a/source/blender/depsgraph/intern/node/deg_node_component.h +++ b/source/blender/depsgraph/intern/node/deg_node_component.h @@ -67,6 +67,7 @@ struct ComponentNode : public Node { ComponentNode(); ~ComponentNode(); + /** Initialize 'component' node - from pointer data given. */ void init(const ID *id, const char *subdata) override; virtual string identifier() const override; @@ -188,6 +189,15 @@ struct ComponentNode : public Node { } \ } +#define DEG_COMPONENT_NODE_DECLARE_NO_COW(name) \ + struct name##ComponentNode : public ComponentNode { \ + DEG_COMPONENT_NODE_DECLARE; \ + virtual bool depends_on_cow() \ + { \ + return false; \ + } \ + } + DEG_COMPONENT_NODE_DECLARE_GENERIC(Animation); DEG_COMPONENT_NODE_DECLARE_NO_COW_TAG_ON_UPDATE(BatchCache); DEG_COMPONENT_NODE_DECLARE_GENERIC(Cache); @@ -210,10 +220,12 @@ DEG_COMPONENT_NODE_DECLARE_GENERIC(Synchronization); DEG_COMPONENT_NODE_DECLARE_GENERIC(Audio); DEG_COMPONENT_NODE_DECLARE_GENERIC(Armature); DEG_COMPONENT_NODE_DECLARE_GENERIC(GenericDatablock); +DEG_COMPONENT_NODE_DECLARE_NO_COW(Visibility); DEG_COMPONENT_NODE_DECLARE_GENERIC(Simulation); /* Bone Component */ struct BoneComponentNode : public ComponentNode { + /** Initialize 'bone component' node - from pointer data given. */ void init(const ID *id, const char *subdata); struct bPoseChannel *pchan; /* the bone that this component represents */ diff --git a/source/blender/depsgraph/intern/node/deg_node_id.cc b/source/blender/depsgraph/intern/node/deg_node_id.cc index 2b1ebc663fe..baad8318de2 100644 --- a/source/blender/depsgraph/intern/node/deg_node_id.cc +++ b/source/blender/depsgraph/intern/node/deg_node_id.cc @@ -73,7 +73,6 @@ uint64_t IDNode::ComponentIDKey::hash() const BLI_ghashutil_strhash_p(name)); } -/* Initialize 'id' node - from pointer data given. */ void IDNode::init(const ID *id, const char *UNUSED(subdata)) { BLI_assert(id != nullptr); diff --git a/source/blender/depsgraph/intern/node/deg_node_id.h b/source/blender/depsgraph/intern/node/deg_node_id.h index 073469598dc..257e42b8e67 100644 --- a/source/blender/depsgraph/intern/node/deg_node_id.h +++ b/source/blender/depsgraph/intern/node/deg_node_id.h @@ -58,6 +58,7 @@ struct IDNode : public Node { const char *name; }; + /** Initialize 'id' node - from pointer data given. */ virtual void init(const ID *id, const char *subdata) override; void init_copy_on_write(ID *id_cow_hint = nullptr); ~IDNode(); diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.cc b/source/blender/depsgraph/intern/node/deg_node_operation.cc index c25dc6fc8d5..eaae5d2d5dc 100644 --- a/source/blender/depsgraph/intern/node/deg_node_operation.cc +++ b/source/blender/depsgraph/intern/node/deg_node_operation.cc @@ -218,8 +218,6 @@ string OperationNode::identifier() const return string(operationCodeAsString(opcode)) + "(" + name + ")"; } -/* Full node identifier, including owner name. - * used for logging and debug prints. */ string OperationNode::full_identifier() const { string owner_str = owner->owner->name; diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.h b/source/blender/depsgraph/intern/node/deg_node_operation.h index a17186da941..31cbb9702ba 100644 --- a/source/blender/depsgraph/intern/node/deg_node_operation.h +++ b/source/blender/depsgraph/intern/node/deg_node_operation.h @@ -233,6 +233,10 @@ struct OperationNode : public Node { OperationNode(); virtual string identifier() const override; + /** + * Full node identifier, including owner name. + * used for logging and debug prints. + */ string full_identifier() const; virtual void tag_update(Depsgraph *graph, eUpdateSource source) override; |