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:
authorJacques Lucke <jacques@blender.org>2020-12-11 20:00:37 +0300
committerJacques Lucke <jacques@blender.org>2020-12-11 20:00:37 +0300
commitf5dc34ec9c05cc8f1163313baafe634f4798c29b (patch)
treeb3cc27fc8009fc0180f4b35c5c3646cb2527a72c /source/blender/makesrna/intern
parent5ced167336d49ef42e96e205c72d3935ff302a7e (diff)
Geometry Nodes: support instancing collections
The Point Instance node can instance entire collections now. Before, only individual collections were supported. Randomly selecting objects from the collection on a per point basis is not support, yet. Last part of D9739. Ref T82372.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 461b6af506a..34d922fe2c8 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -8415,6 +8415,32 @@ static void def_geo_attribute_math(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
}
+static void def_geo_point_instance(StructRNA *srna)
+{
+ static const EnumPropertyItem instance_type_items[] = {
+ {GEO_NODE_POINT_INSTANCE_TYPE_OBJECT,
+ "OBJECT",
+ ICON_NONE,
+ "Object",
+ "Instance an individual object on all points"},
+ {GEO_NODE_POINT_INSTANCE_TYPE_COLLECTION,
+ "COLLECTION",
+ ICON_NONE,
+ "Collection",
+ "Instance an entire collection on all points"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ PropertyRNA *prop;
+
+ prop = RNA_def_property(srna, "instance_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "custom1");
+ RNA_def_property_enum_items(prop, instance_type_items);
+ RNA_def_property_enum_default(prop, GEO_NODE_POINT_INSTANCE_TYPE_OBJECT);
+ RNA_def_property_ui_text(prop, "Instance Type", "");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
+}
+
static void def_geo_attribute_mix(StructRNA *srna)
{
PropertyRNA *prop;