Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/node.cc
| Show First 20 Lines • Show All 2,193 Lines • ▼ Show 20 Lines | bNode *nodeAddNode(const struct bContext *C, bNodeTree *ntree, const char *idname) | ||||
| node->runtime = MEM_new<bNodeRuntime>(__func__); | node->runtime = MEM_new<bNodeRuntime>(__func__); | ||||
| BLI_addtail(&ntree->nodes, node); | BLI_addtail(&ntree->nodes, node); | ||||
| BLI_strncpy(node->idname, idname, sizeof(node->idname)); | BLI_strncpy(node->idname, idname, sizeof(node->idname)); | ||||
| node_set_typeinfo(C, ntree, node, nodeTypeFind(idname)); | node_set_typeinfo(C, ntree, node, nodeTypeFind(idname)); | ||||
| BKE_ntree_update_tag_node_new(ntree, node); | BKE_ntree_update_tag_node_new(ntree, node); | ||||
| if (ELEM(node->type, GEO_NODE_INPUT_SCENE_TIME, GEO_NODE_SELF_OBJECT)) { | if (node->type == GEO_NODE_SELF_OBJECT) { | ||||
| DEG_relations_tag_update(CTX_data_main(C)); | DEG_relations_tag_update(CTX_data_main(C)); | ||||
| } | } | ||||
| return node; | return node; | ||||
| } | } | ||||
| bNode *nodeAddStaticNode(const struct bContext *C, bNodeTree *ntree, int type) | bNode *nodeAddStaticNode(const struct bContext *C, bNodeTree *ntree, int type) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 831 Lines • ▼ Show 20 Lines | void nodeRemoveNode(Main *bmain, bNodeTree *ntree, bNode *node, bool do_id_user) | ||||
| if (BKE_animdata_fix_paths_remove((ID *)ntree, prefix)) { | if (BKE_animdata_fix_paths_remove((ID *)ntree, prefix)) { | ||||
| if (bmain != nullptr) { | if (bmain != nullptr) { | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| } | } | ||||
| } | } | ||||
| /* Also update relations for the scene time node, which causes a dependency | /* Also update relations for the scene time node, which causes a dependency | ||||
| * on time that users expect to be removed when the node is removed. */ | * on time that users expect to be removed when the node is removed. */ | ||||
| if (node_has_id || ELEM(node->type, GEO_NODE_INPUT_SCENE_TIME, GEO_NODE_SELF_OBJECT)) { | if (node_has_id || node->type == GEO_NODE_SELF_OBJECT) { | ||||
| if (bmain != nullptr) { | if (bmain != nullptr) { | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| } | } | ||||
| } | } | ||||
| nodeUnlinkNode(ntree, node); | nodeUnlinkNode(ntree, node); | ||||
| node_unlink_attached(ntree, node); | node_unlink_attached(ntree, node); | ||||
| ▲ Show 20 Lines • Show All 1,768 Lines • Show Last 20 Lines | |||||