Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Molenkamp <github@lazydodo.com>2021-04-09 01:25:09 +0300
committerRay Molenkamp <github@lazydodo.com>2021-04-09 01:25:09 +0300
commit3d7e3d5ad0b4a6b790eb95076394948f5a0e046e (patch)
tree4bfdf4fb57baab6c55a6852bf9ff5fdb58561de5 /source/blender/makesrna
parent500045a0d3b57f4333527cb710f05f666acaf904 (diff)
Fix: Missing GeometryNodeCustomGroup
This is a minor change to add some plumbing code to support custom geo nodes. This is working the same way as the custom cycles and compositor nodes. An example add-in is attached to D10784 Reviewed By: JacquesLucke Differential Revision: http://developer.blender.org/D10784
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 609b0d53a6d..b79381ac26f 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -497,6 +497,7 @@ static const EnumPropertyItem rna_node_geometry_attribute_input_type_items_no_bo
# include "NOD_common.h"
# include "NOD_composite.h"
+# include "NOD_geometry.h"
# include "NOD_shader.h"
# include "NOD_socket.h"
@@ -3290,6 +3291,35 @@ static StructRNA *rna_NodeCustomGroup_register(Main *bmain,
return nt->rna_ext.srna;
}
+static StructRNA *rna_GeometryNodeCustomGroup_register(Main *bmain,
+ ReportList *reports,
+ void *data,
+ const char *identifier,
+ StructValidateFunc validate,
+ StructCallbackFunc call,
+ StructFreeFunc free)
+{
+ bNodeType *nt = rna_Node_register_base(
+ bmain, reports, &RNA_GeometryNodeCustomGroup, data, identifier, validate, call, free);
+
+ if (!nt) {
+ return NULL;
+ }
+
+ nt->group_update_func = node_group_update;
+ nt->type = NODE_CUSTOM_GROUP;
+
+ register_node_type_geo_custom_group(nt);
+
+ nodeRegisterType(nt);
+
+ WM_main_add_notifier(NC_NODE | NA_EDITED, NULL);
+
+ return nt->rna_ext.srna;
+}
+
+void register_node_type_geo_custom_group(bNodeType *ntype);
+
static StructRNA *rna_ShaderNodeCustomGroup_register(Main *bmain,
ReportList *reports,
void *data,
@@ -11501,6 +11531,12 @@ void RNA_def_nodetree(BlenderRNA *brna)
"Custom Group",
"Base node type for custom registered node group types",
"rna_NodeCustomGroup_register");
+ def_custom_group(brna,
+ "GeometryNodeCustomGroup",
+ "GeometryNode",
+ "Geometry Custom Group",
+ "Custom Geometry Group Node for Python nodes",
+ "rna_GeometryNodeCustomGroup_register");
/* special socket types */
rna_def_cmp_output_file_slot_file(brna);