Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_node.h
| Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | |||||
| * However, achieving this requires quite a few changes currently. */ | * However, achieving this requires quite a few changes currently. */ | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| namespace blender { | namespace blender { | ||||
| class CPPType; | class CPPType; | ||||
| namespace nodes { | namespace nodes { | ||||
| class DNode; | class DNode; | ||||
| class NodeMultiFunctionBuilder; | class NodeMultiFunctionBuilder; | ||||
| class GeoNodeExecParams; | class GeoNodeExecParams; | ||||
| class NodeDeclaration; | |||||
| class NodeDeclarationBuilder; | class NodeDeclarationBuilder; | ||||
| class GatherLinkSearchOpParams; | class GatherLinkSearchOpParams; | ||||
| } // namespace nodes | } // namespace nodes | ||||
| namespace realtime_compositor { | namespace realtime_compositor { | ||||
| class Context; | class Context; | ||||
| class NodeOperation; | class NodeOperation; | ||||
| class ShaderNode; | class ShaderNode; | ||||
| } // namespace realtime_compositor | } // namespace realtime_compositor | ||||
| } // namespace blender | } // namespace blender | ||||
| using CPPTypeHandle = blender::CPPType; | using CPPTypeHandle = blender::CPPType; | ||||
| using NodeMultiFunctionBuildFunction = void (*)(blender::nodes::NodeMultiFunctionBuilder &builder); | using NodeMultiFunctionBuildFunction = void (*)(blender::nodes::NodeMultiFunctionBuilder &builder); | ||||
| using NodeGeometryExecFunction = void (*)(blender::nodes::GeoNodeExecParams params); | using NodeGeometryExecFunction = void (*)(blender::nodes::GeoNodeExecParams params); | ||||
| using NodeDeclareFunction = void (*)(blender::nodes::NodeDeclarationBuilder &builder); | using NodeDeclareFunction = void (*)(blender::nodes::NodeDeclarationBuilder &builder); | ||||
| using NodeDeclareDynamicFunction = void (*)(const bNodeTree &tree, | |||||
| const bNode &node, | |||||
| blender::nodes::NodeDeclaration &r_declaration); | |||||
| using SocketGetCPPValueFunction = void (*)(const struct bNodeSocket &socket, void *r_value); | using SocketGetCPPValueFunction = void (*)(const struct bNodeSocket &socket, void *r_value); | ||||
| using SocketGetGeometryNodesCPPValueFunction = void (*)(const struct bNodeSocket &socket, | using SocketGetGeometryNodesCPPValueFunction = void (*)(const struct bNodeSocket &socket, | ||||
| void *r_value); | void *r_value); | ||||
| /* Adds socket link operations that are specific to this node type. */ | /* Adds socket link operations that are specific to this node type. */ | ||||
| using NodeGatherSocketLinkOperationsFunction = | using NodeGatherSocketLinkOperationsFunction = | ||||
| void (*)(blender::nodes::GatherLinkSearchOpParams ¶ms); | void (*)(blender::nodes::GatherLinkSearchOpParams ¶ms); | ||||
| using NodeGetCompositorOperationFunction = blender::realtime_compositor::NodeOperation | using NodeGetCompositorOperationFunction = blender::realtime_compositor::NodeOperation | ||||
| *(*)(blender::realtime_compositor::Context &context, blender::nodes::DNode node); | *(*)(blender::realtime_compositor::Context &context, blender::nodes::DNode node); | ||||
| using NodeGetCompositorShaderNodeFunction = | using NodeGetCompositorShaderNodeFunction = | ||||
| blender::realtime_compositor::ShaderNode *(*)(blender::nodes::DNode node); | blender::realtime_compositor::ShaderNode *(*)(blender::nodes::DNode node); | ||||
| #else | #else | ||||
| typedef void *NodeGetCompositorOperationFunction; | typedef void *NodeGetCompositorOperationFunction; | ||||
| typedef void *NodeGetCompositorShaderNodeFunction; | typedef void *NodeGetCompositorShaderNodeFunction; | ||||
| typedef void *NodeMultiFunctionBuildFunction; | typedef void *NodeMultiFunctionBuildFunction; | ||||
| typedef void *NodeGeometryExecFunction; | typedef void *NodeGeometryExecFunction; | ||||
| typedef void *NodeDeclareFunction; | typedef void *NodeDeclareFunction; | ||||
| typedef void *NodeDeclareDynamicFunction; | |||||
| typedef void *NodeGatherSocketLinkOperationsFunction; | typedef void *NodeGatherSocketLinkOperationsFunction; | ||||
| typedef void *SocketGetCPPTypeFunction; | typedef void *SocketGetCPPTypeFunction; | ||||
| typedef void *SocketGetGeometryNodesCPPTypeFunction; | typedef void *SocketGetGeometryNodesCPPTypeFunction; | ||||
| typedef void *SocketGetGeometryNodesCPPValueFunction; | typedef void *SocketGetGeometryNodesCPPValueFunction; | ||||
| typedef void *SocketGetCPPValueFunction; | typedef void *SocketGetCPPValueFunction; | ||||
| typedef struct CPPTypeHandle CPPTypeHandle; | typedef struct CPPTypeHandle CPPTypeHandle; | ||||
| #endif | #endif | ||||
| Show All 20 Lines | typedef struct bNodeSocketType { | ||||
| void (*interface_draw)(struct bContext *C, struct uiLayout *layout, struct PointerRNA *ptr); | void (*interface_draw)(struct bContext *C, struct uiLayout *layout, struct PointerRNA *ptr); | ||||
| void (*interface_draw_color)(struct bContext *C, struct PointerRNA *ptr, float *r_color); | void (*interface_draw_color)(struct bContext *C, struct PointerRNA *ptr, float *r_color); | ||||
| void (*interface_init_socket)(struct bNodeTree *ntree, | void (*interface_init_socket)(struct bNodeTree *ntree, | ||||
| const struct bNodeSocket *interface_socket, | const struct bNodeSocket *interface_socket, | ||||
| struct bNode *node, | struct bNode *node, | ||||
| struct bNodeSocket *sock, | struct bNodeSocket *sock, | ||||
| const char *data_path); | const char *data_path); | ||||
| void (*interface_verify_socket)(struct bNodeTree *ntree, | |||||
| const struct bNodeSocket *interface_socket, | |||||
| struct bNode *node, | |||||
| struct bNodeSocket *sock, | |||||
| const char *data_path); | |||||
| void (*interface_from_socket)(struct bNodeTree *ntree, | void (*interface_from_socket)(struct bNodeTree *ntree, | ||||
| struct bNodeSocket *interface_socket, | struct bNodeSocket *interface_socket, | ||||
| const struct bNode *node, | const struct bNode *node, | ||||
| const struct bNodeSocket *sock); | const struct bNodeSocket *sock); | ||||
| /* RNA integration */ | /* RNA integration */ | ||||
| ExtensionRNA ext_socket; | ExtensionRNA ext_socket; | ||||
| ExtensionRNA ext_interface; | ExtensionRNA ext_interface; | ||||
| ▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | bool (*poll)(const struct bNodeType *ntype, | ||||
| const char **r_disabled_hint); | const char **r_disabled_hint); | ||||
| /** Can this node be added to a node tree? | /** Can this node be added to a node tree? | ||||
| * \param r_disabled_hint: See `poll()`. | * \param r_disabled_hint: See `poll()`. | ||||
| */ | */ | ||||
| bool (*poll_instance)(const struct bNode *node, | bool (*poll_instance)(const struct bNode *node, | ||||
| const struct bNodeTree *nodetree, | const struct bNodeTree *nodetree, | ||||
| const char **r_disabled_hint); | const char **r_disabled_hint); | ||||
| /* optional handling of link insertion */ | /* optional handling of link insertion. Returns false if the link shouldn't be created. */ | ||||
| void (*insert_link)(struct bNodeTree *ntree, struct bNode *node, struct bNodeLink *link); | bool (*insert_link)(struct bNodeTree *ntree, struct bNode *node, struct bNodeLink *link); | ||||
| void (*free_self)(struct bNodeType *ntype); | void (*free_self)(struct bNodeType *ntype); | ||||
| /* **** execution callbacks **** */ | /* **** execution callbacks **** */ | ||||
| NodeInitExecFunction init_exec_fn; | NodeInitExecFunction init_exec_fn; | ||||
| NodeFreeExecFunction free_exec_fn; | NodeFreeExecFunction free_exec_fn; | ||||
| NodeExecFunction exec_fn; | NodeExecFunction exec_fn; | ||||
| /* gpu */ | /* gpu */ | ||||
| Show All 20 Lines | typedef struct bNodeType { | ||||
| /** | /** | ||||
| * If true, the geometry nodes evaluator can call the execute function multiple times to improve | * If true, the geometry nodes evaluator can call the execute function multiple times to improve | ||||
| * performance by specifying required data in one call and using it for calculations in another. | * performance by specifying required data in one call and using it for calculations in another. | ||||
| */ | */ | ||||
| bool geometry_node_execute_supports_laziness; | bool geometry_node_execute_supports_laziness; | ||||
| /* Declares which sockets the node has. */ | /* Declares which sockets the node has. */ | ||||
| NodeDeclareFunction declare; | NodeDeclareFunction declare; | ||||
| /* Different nodes of this type can have different declarations. */ | /** | ||||
| bool declaration_is_dynamic; | * Declare which sockets the node has for declarations that aren't static per node type. | ||||
| * In other words, defining this callback means that different nodes of this type can have | |||||
JacquesLucke: typo (`other`) | |||||
| * different declarations and different sockets. | |||||
| */ | |||||
| NodeDeclareDynamicFunction declare_dynamic; | |||||
| /* Declaration to be used when it is not dynamic. */ | /* Declaration to be used when it is not dynamic. */ | ||||
| NodeDeclarationHandle *fixed_declaration; | NodeDeclarationHandle *fixed_declaration; | ||||
| /** | /** | ||||
| * Add to the list of search names and operations gathered by node link drag searching. | * Add to the list of search names and operations gathered by node link drag searching. | ||||
| * Usually it isn't necessary to override the default behavior here, but a node type can have | * Usually it isn't necessary to override the default behavior here, but a node type can have | ||||
| * custom behavior here like adding custom search items. | * custom behavior here like adding custom search items. | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 1,245 Lines • Show Last 20 Lines | |||||
typo (other)