From fb34cdc7daa5bdefde561645def81405b9c6f26c Mon Sep 17 00:00:00 2001 From: "Johnny Matthews (guitargeek)" Date: Sun, 3 Oct 2021 07:54:05 -0500 Subject: Geometry Nodes: Points to Volume Fields Update This update of the Points to Volume node allows a field to populate the radius input of the node and removes the implicit realization of instances. Differential Revision: https://developer.blender.org/D12531 --- source/blender/makesrna/intern/rna_nodetree.c | 28 ++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern/rna_nodetree.c') diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index df1be412bc4..7b3463ef241 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -9987,7 +9987,7 @@ static void def_geo_object_info(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); } -static void def_geo_points_to_volume(StructRNA *srna) +static void def_geo_legacy_points_to_volume(StructRNA *srna) { PropertyRNA *prop; @@ -10018,6 +10018,32 @@ static void def_geo_points_to_volume(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } +static void def_geo_points_to_volume(StructRNA *srna) +{ + PropertyRNA *prop; + + static EnumPropertyItem resolution_mode_items[] = { + {GEO_NODE_POINTS_TO_VOLUME_RESOLUTION_MODE_AMOUNT, + "VOXEL_AMOUNT", + 0, + "Amount", + "Specify the approximate number of voxels along the diagonal"}, + {GEO_NODE_POINTS_TO_VOLUME_RESOLUTION_MODE_SIZE, + "VOXEL_SIZE", + 0, + "Size", + "Specify the voxel side length"}, + {0, NULL, 0, NULL, NULL}, + }; + + RNA_def_struct_sdna_from(srna, "NodeGeometryPointsToVolume", "storage"); + + prop = RNA_def_property(srna, "resolution_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, resolution_mode_items); + RNA_def_property_ui_text(prop, "Resolution Mode", "How the voxel size is specified"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); +} + static void def_geo_collection_info(StructRNA *srna) { PropertyRNA *prop; -- cgit v1.2.3