Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/node_draw.cc
| Show First 20 Lines • Show All 262 Lines • ▼ Show 20 Lines | void node_sort(bNodeTree &ntree) | ||||
| BKE_ntree_update_tag_node_reordered(&ntree); | BKE_ntree_update_tag_node_reordered(&ntree); | ||||
| ntree.runtime->nodes_by_id.clear(); | ntree.runtime->nodes_by_id.clear(); | ||||
| BLI_listbase_clear(&ntree.nodes); | BLI_listbase_clear(&ntree.nodes); | ||||
| for (const int i : sort_nodes.index_range()) { | for (const int i : sort_nodes.index_range()) { | ||||
| BLI_addtail(&ntree.nodes, sort_nodes[i]); | BLI_addtail(&ntree.nodes, sort_nodes[i]); | ||||
| ntree.runtime->nodes_by_id.add_new(sort_nodes[i]); | ntree.runtime->nodes_by_id.add_new(sort_nodes[i]); | ||||
| sort_nodes[i]->runtime->index_in_tree = i; | |||||
| } | } | ||||
| } | } | ||||
| static Array<uiBlock *> node_uiblocks_init(const bContext &C, Span<bNode *> nodes) | static Array<uiBlock *> node_uiblocks_init(const bContext &C, Span<bNode *> nodes) | ||||
| { | { | ||||
| Array<uiBlock *> blocks(nodes.size()); | Array<uiBlock *> blocks(nodes.size()); | ||||
| /* Add node uiBlocks in drawing order - prevents events going to overlapping nodes. */ | /* Add node uiBlocks in drawing order - prevents events going to overlapping nodes. */ | ||||
| for (const int i : nodes.index_range()) { | for (const int i : nodes.index_range()) { | ||||
| ▲ Show 20 Lines • Show All 992 Lines • Show Last 20 Lines | |||||