Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/node_tree_update.cc
| Show First 20 Lines • Show All 820 Lines • ▼ Show 20 Lines | public: | ||||
| { | { | ||||
| if (root_ntrees.is_empty()) { | if (root_ntrees.is_empty()) { | ||||
| return; | return; | ||||
| } | } | ||||
| bool is_single_tree_update = false; | bool is_single_tree_update = false; | ||||
| if (root_ntrees.size() == 1) { | if (root_ntrees.size() == 1) { | ||||
| bNodeTree *ntree = root_ntrees[0]; | bNodeTree *ntree = root_ntrees.first(); | ||||
| if (ntree->runtime->changed_flag == NTREE_CHANGED_NOTHING) { | if (ntree->runtime->changed_flag == NTREE_CHANGED_NOTHING) { | ||||
| return; | return; | ||||
| } | } | ||||
| const TreeUpdateResult result = this->update_tree(*ntree); | const TreeUpdateResult result = this->update_tree(*ntree); | ||||
| update_result_by_tree_.add_new(ntree, result); | update_result_by_tree_.add_new(ntree, result); | ||||
| if (!result.interface_changed && !result.output_changed) { | if (!result.interface_changed && !result.output_changed) { | ||||
| is_single_tree_update = true; | is_single_tree_update = true; | ||||
| } | } | ||||
| Show All 19 Lines | if (!is_single_tree_update) { | ||||
| if (result.interface_changed) { | if (result.interface_changed) { | ||||
| for (const TreeNodePair &pair : dependent_trees) { | for (const TreeNodePair &pair : dependent_trees) { | ||||
| add_node_tag(pair.first, pair.second, NTREE_CHANGED_NODE_PROPERTY); | add_node_tag(pair.first, pair.second, NTREE_CHANGED_NODE_PROPERTY); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| update_result_by_tree_.parallel_foreach_item( | |||||
| [this](bNodeTree *ntree, const TreeUpdateResult result) { | |||||
| this->reset_changed_flags(*ntree); | |||||
| }, | |||||
| update_result_by_tree_.size() > 16); | |||||
| for (const auto item : update_result_by_tree_.items()) { | for (const auto item : update_result_by_tree_.items()) { | ||||
| bNodeTree *ntree = item.key; | bNodeTree *ntree = item.key; | ||||
| const TreeUpdateResult &result = item.value; | const TreeUpdateResult result = item.value; | ||||
| this->reset_changed_flags(*ntree); | |||||
| if (result.interface_changed) { | if (result.interface_changed) { | ||||
| if (ntree->type == NTREE_GEOMETRY) { | if (ntree->type == NTREE_GEOMETRY) { | ||||
| relations_.ensure_modifier_users(); | relations_.ensure_modifier_users(); | ||||
| for (const ObjectModifierPair &pair : relations_.get_modifier_users(ntree)) { | for (const ObjectModifierPair &pair : relations_.get_modifier_users(ntree)) { | ||||
| Object *object = pair.first; | Object *object = pair.first; | ||||
| ModifierData *md = pair.second; | ModifierData *md = pair.second; | ||||
| ▲ Show 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | TreeUpdateResult update_tree(bNodeTree &ntree) | ||||
| if (ntree.type == NTREE_GEOMETRY) { | if (ntree.type == NTREE_GEOMETRY) { | ||||
| if (node_field_inferencing::update_field_inferencing(ntree)) { | if (node_field_inferencing::update_field_inferencing(ntree)) { | ||||
| result.interface_changed = true; | result.interface_changed = true; | ||||
| } | } | ||||
| } | } | ||||
| result.output_changed = this->check_if_output_changed(ntree); | result.output_changed = this->check_if_output_changed(ntree); | ||||
| this->update_socket_link_and_use(ntree); | // this->update_socket_link_and_use(ntree); | ||||
| this->update_link_validation(ntree); | this->update_link_validation(ntree); | ||||
| if (ntree.type == NTREE_TEXTURE) { | if (ntree.type == NTREE_TEXTURE) { | ||||
| ntreeTexCheckCyclics(&ntree); | ntreeTexCheckCyclics(&ntree); | ||||
| } | } | ||||
| if (ntree.runtime->changed_flag & NTREE_CHANGED_INTERFACE || | if (ntree.runtime->changed_flag & NTREE_CHANGED_INTERFACE || | ||||
| ntree.runtime->changed_flag & NTREE_CHANGED_ANY) { | ntree.runtime->changed_flag & NTREE_CHANGED_ANY) { | ||||
| ▲ Show 20 Lines • Show All 766 Lines • Show Last 20 Lines | |||||