Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/intern/node_common.cc
| Show First 20 Lines • Show All 232 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| void register_node_type_frame() | void register_node_type_frame() | ||||
| { | { | ||||
| /* frame type is used for all tree types, needs dynamic allocation */ | /* frame type is used for all tree types, needs dynamic allocation */ | ||||
| bNodeType *ntype = MEM_cnew<bNodeType>("frame node type"); | bNodeType *ntype = MEM_cnew<bNodeType>("frame node type"); | ||||
| ntype->free_self = (void (*)(bNodeType *))MEM_freeN; | ntype->free_self = (void (*)(bNodeType *))MEM_freeN; | ||||
| node_type_base(ntype, NODE_FRAME, "Frame", NODE_CLASS_LAYOUT, NODE_BACKGROUND); | node_type_base(ntype, NODE_FRAME, "Frame", NODE_CLASS_LAYOUT); | ||||
| node_type_init(ntype, node_frame_init); | node_type_init(ntype, node_frame_init); | ||||
| node_type_storage(ntype, "NodeFrame", node_free_standard_storage, node_copy_standard_storage); | node_type_storage(ntype, "NodeFrame", node_free_standard_storage, node_copy_standard_storage); | ||||
| node_type_size(ntype, 150, 100, 0); | node_type_size(ntype, 150, 100, 0); | ||||
| ntype->flag |= NODE_BACKGROUND; | |||||
| nodeRegisterType(ntype); | nodeRegisterType(ntype); | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Node Re-Route | /** \name Node Re-Route | ||||
| Show All 9 Lines | |||||
| } | } | ||||
| void register_node_type_reroute() | void register_node_type_reroute() | ||||
| { | { | ||||
| /* frame type is used for all tree types, needs dynamic allocation */ | /* frame type is used for all tree types, needs dynamic allocation */ | ||||
| bNodeType *ntype = MEM_cnew<bNodeType>("frame node type"); | bNodeType *ntype = MEM_cnew<bNodeType>("frame node type"); | ||||
| ntype->free_self = (void (*)(bNodeType *))MEM_freeN; | ntype->free_self = (void (*)(bNodeType *))MEM_freeN; | ||||
| node_type_base(ntype, NODE_REROUTE, "Reroute", NODE_CLASS_LAYOUT, 0); | node_type_base(ntype, NODE_REROUTE, "Reroute", NODE_CLASS_LAYOUT); | ||||
| node_type_init(ntype, node_reroute_init); | node_type_init(ntype, node_reroute_init); | ||||
| nodeRegisterType(ntype); | nodeRegisterType(ntype); | ||||
| } | } | ||||
| static void propagate_reroute_type_from_start_socket( | static void propagate_reroute_type_from_start_socket( | ||||
| bNodeSocket *start_socket, | bNodeSocket *start_socket, | ||||
| const MultiValueMap<bNodeSocket *, bNodeLink *> &links_map, | const MultiValueMap<bNodeSocket *, bNodeLink *> &links_map, | ||||
| ▲ Show 20 Lines • Show All 224 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| void register_node_type_group_input() | void register_node_type_group_input() | ||||
| { | { | ||||
| /* used for all tree types, needs dynamic allocation */ | /* used for all tree types, needs dynamic allocation */ | ||||
| bNodeType *ntype = MEM_cnew<bNodeType>("node type"); | bNodeType *ntype = MEM_cnew<bNodeType>("node type"); | ||||
| ntype->free_self = (void (*)(bNodeType *))MEM_freeN; | ntype->free_self = (void (*)(bNodeType *))MEM_freeN; | ||||
| node_type_base(ntype, NODE_GROUP_INPUT, "Group Input", NODE_CLASS_INTERFACE, 0); | node_type_base(ntype, NODE_GROUP_INPUT, "Group Input", NODE_CLASS_INTERFACE); | ||||
| node_type_size(ntype, 140, 80, 400); | node_type_size(ntype, 140, 80, 400); | ||||
| node_type_init(ntype, node_group_input_init); | node_type_init(ntype, node_group_input_init); | ||||
| node_type_update(ntype, node_group_input_update); | node_type_update(ntype, node_group_input_update); | ||||
| nodeRegisterType(ntype); | nodeRegisterType(ntype); | ||||
| } | } | ||||
| static void node_group_output_init(bNodeTree *ntree, bNode *node) | static void node_group_output_init(bNodeTree *ntree, bNode *node) | ||||
| ▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| void register_node_type_group_output() | void register_node_type_group_output() | ||||
| { | { | ||||
| /* used for all tree types, needs dynamic allocation */ | /* used for all tree types, needs dynamic allocation */ | ||||
| bNodeType *ntype = MEM_cnew<bNodeType>("node type"); | bNodeType *ntype = MEM_cnew<bNodeType>("node type"); | ||||
| ntype->free_self = (void (*)(bNodeType *))MEM_freeN; | ntype->free_self = (void (*)(bNodeType *))MEM_freeN; | ||||
| node_type_base(ntype, NODE_GROUP_OUTPUT, "Group Output", NODE_CLASS_INTERFACE, 0); | node_type_base(ntype, NODE_GROUP_OUTPUT, "Group Output", NODE_CLASS_INTERFACE); | ||||
| node_type_size(ntype, 140, 80, 400); | node_type_size(ntype, 140, 80, 400); | ||||
| node_type_init(ntype, node_group_output_init); | node_type_init(ntype, node_group_output_init); | ||||
| node_type_update(ntype, node_group_output_update); | node_type_update(ntype, node_group_output_update); | ||||
| ntype->no_muting = true; | ntype->no_muting = true; | ||||
| nodeRegisterType(ntype); | nodeRegisterType(ntype); | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||