Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_nodetree.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 1,732 Lines • ▼ Show 20 Lines | static void rna_Node_update_reg(bNodeTree *ntree, bNode *node) | ||||
| func = &rna_Node_update_func; /* RNA_struct_find_function(&ptr, "update"); */ | func = &rna_Node_update_func; /* RNA_struct_find_function(&ptr, "update"); */ | ||||
| RNA_parameter_list_create(&list, &ptr, func); | RNA_parameter_list_create(&list, &ptr, func); | ||||
| node->typeinfo->rna_ext.call(NULL, &ptr, func, &list); | node->typeinfo->rna_ext.call(NULL, &ptr, func, &list); | ||||
| RNA_parameter_list_free(&list); | RNA_parameter_list_free(&list); | ||||
| } | } | ||||
| static void rna_Node_insert_link(bNodeTree *ntree, bNode *node, bNodeLink *link) | static bool rna_Node_insert_link(bNodeTree *ntree, bNode *node, bNodeLink *link) | ||||
| { | { | ||||
| extern FunctionRNA rna_Node_insert_link_func; | extern FunctionRNA rna_Node_insert_link_func; | ||||
| PointerRNA ptr; | PointerRNA ptr; | ||||
| ParameterList list; | ParameterList list; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| RNA_pointer_create((ID *)ntree, node->typeinfo->rna_ext.srna, node, &ptr); | RNA_pointer_create((ID *)ntree, node->typeinfo->rna_ext.srna, node, &ptr); | ||||
| func = &rna_Node_insert_link_func; | func = &rna_Node_insert_link_func; | ||||
| RNA_parameter_list_create(&list, &ptr, func); | RNA_parameter_list_create(&list, &ptr, func); | ||||
| RNA_parameter_set_lookup(&list, "link", &link); | RNA_parameter_set_lookup(&list, "link", &link); | ||||
| node->typeinfo->rna_ext.call(NULL, &ptr, func, &list); | node->typeinfo->rna_ext.call(NULL, &ptr, func, &list); | ||||
| RNA_parameter_list_free(&list); | RNA_parameter_list_free(&list); | ||||
| return true; | |||||
| } | } | ||||
| static void rna_Node_init(const bContext *C, PointerRNA *ptr) | static void rna_Node_init(const bContext *C, PointerRNA *ptr) | ||||
| { | { | ||||
| extern FunctionRNA rna_Node_init_func; | extern FunctionRNA rna_Node_init_func; | ||||
| bNode *node = (bNode *)ptr->data; | bNode *node = (bNode *)ptr->data; | ||||
| ParameterList list; | ParameterList list; | ||||
| ▲ Show 20 Lines • Show All 1,616 Lines • ▼ Show 20 Lines | static StructRNA *rna_NodeCustomGroup_register(Main *bmain, | ||||
| StructFreeFunc free) | StructFreeFunc free) | ||||
| { | { | ||||
| bNodeType *nt = rna_Node_register_base( | bNodeType *nt = rna_Node_register_base( | ||||
| bmain, reports, &RNA_NodeCustomGroup, data, identifier, validate, call, free); | bmain, reports, &RNA_NodeCustomGroup, data, identifier, validate, call, free); | ||||
| if (!nt) { | if (!nt) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| /* this updates the group node instance from the tree's interface */ | |||||
| nt->group_update_func = node_group_update; | |||||
| nodeRegisterType(nt); | nodeRegisterType(nt); | ||||
| /* update while blender is running */ | /* update while blender is running */ | ||||
| WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); | WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); | ||||
| return nt->rna_ext.srna; | return nt->rna_ext.srna; | ||||
| } | } | ||||
| static StructRNA *rna_GeometryNodeCustomGroup_register(Main *bmain, | static StructRNA *rna_GeometryNodeCustomGroup_register(Main *bmain, | ||||
| ReportList *reports, | ReportList *reports, | ||||
| void *data, | void *data, | ||||
| const char *identifier, | const char *identifier, | ||||
| StructValidateFunc validate, | StructValidateFunc validate, | ||||
| StructCallbackFunc call, | StructCallbackFunc call, | ||||
| StructFreeFunc free) | StructFreeFunc free) | ||||
| { | { | ||||
| bNodeType *nt = rna_Node_register_base( | bNodeType *nt = rna_Node_register_base( | ||||
| bmain, reports, &RNA_GeometryNodeCustomGroup, data, identifier, validate, call, free); | bmain, reports, &RNA_GeometryNodeCustomGroup, data, identifier, validate, call, free); | ||||
| if (!nt) { | if (!nt) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| nt->group_update_func = node_group_update; | |||||
| nt->type = NODE_CUSTOM_GROUP; | nt->type = NODE_CUSTOM_GROUP; | ||||
| register_node_type_geo_custom_group(nt); | register_node_type_geo_custom_group(nt); | ||||
| nodeRegisterType(nt); | nodeRegisterType(nt); | ||||
| WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); | WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); | ||||
| Show All 12 Lines | |||||
| { | { | ||||
| bNodeType *nt = rna_Node_register_base( | bNodeType *nt = rna_Node_register_base( | ||||
| bmain, reports, &RNA_ShaderNodeCustomGroup, data, identifier, validate, call, free); | bmain, reports, &RNA_ShaderNodeCustomGroup, data, identifier, validate, call, free); | ||||
| if (!nt) { | if (!nt) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| nt->group_update_func = node_group_update; | |||||
| nt->type = NODE_CUSTOM_GROUP; | nt->type = NODE_CUSTOM_GROUP; | ||||
| register_node_type_sh_custom_group(nt); | register_node_type_sh_custom_group(nt); | ||||
| nodeRegisterType(nt); | nodeRegisterType(nt); | ||||
| WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); | WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); | ||||
| Show All 9 Lines | static StructRNA *rna_CompositorNodeCustomGroup_register(Main *bmain, | ||||
| StructFreeFunc free) | StructFreeFunc free) | ||||
| { | { | ||||
| bNodeType *nt = rna_Node_register_base( | bNodeType *nt = rna_Node_register_base( | ||||
| bmain, reports, &RNA_CompositorNodeCustomGroup, data, identifier, validate, call, free); | bmain, reports, &RNA_CompositorNodeCustomGroup, data, identifier, validate, call, free); | ||||
| if (!nt) { | if (!nt) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| nt->group_update_func = node_group_update; | |||||
| nt->type = NODE_CUSTOM_GROUP; | nt->type = NODE_CUSTOM_GROUP; | ||||
| register_node_type_cmp_custom_group(nt); | register_node_type_cmp_custom_group(nt); | ||||
| nodeRegisterType(nt); | nodeRegisterType(nt); | ||||
| WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); | WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); | ||||
| ▲ Show 20 Lines • Show All 9,564 Lines • Show Last 20 Lines | |||||