diff options
author | Jacques Lucke <jacques@blender.org> | 2021-02-05 18:20:14 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-02-05 18:20:14 +0300 |
commit | 16abe9343a5e01426e85e4bb9d0e95c3217e35ea (patch) | |
tree | 2dc86e6324a2f8bdf12403d1bdf7d2b39a3129d0 /source/blender/makesrna/intern | |
parent | 46e0efb462cb92e9ade39588b51391820491aed8 (diff) |
Geometry Nodes: add Volume to Mesh node
This node takes a volume and generates a mesh on it's "surface".
The surface is defined by a threshold value.
Currently, the node only works on volumes generated by the
Points to Volume node. This limitation will be resolved soonish.
Ref T84605.
Differential Revision: https://developer.blender.org/D10243
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 77334f10cd0..5dbc574d073 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -29,6 +29,7 @@ #include "DNA_material_types.h" #include "DNA_mesh_types.h" +#include "DNA_modifier_types.h" #include "DNA_node_types.h" #include "DNA_object_types.h" #include "DNA_particle_types.h" @@ -9000,6 +9001,37 @@ static void def_geo_attribute_proximity(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } +static void def_geo_volume_to_mesh(StructRNA *srna) +{ + PropertyRNA *prop; + + static EnumPropertyItem resolution_mode_items[] = { + {VOLUME_TO_MESH_RESOLUTION_MODE_GRID, + "GRID", + 0, + "Grid", + "Use resolution of the volume grid"}, + {VOLUME_TO_MESH_RESOLUTION_MODE_VOXEL_AMOUNT, + "VOXEL_AMOUNT", + 0, + "Voxel Amount", + "Desired number of voxels along one axis"}, + {VOLUME_TO_MESH_RESOLUTION_MODE_VOXEL_SIZE, + "VOXEL_SIZE", + 0, + "Voxel Size", + "Desired voxel side length"}, + {0, NULL, 0, NULL, NULL}, + }; + + RNA_def_struct_sdna_from(srna, "NodeGeometryVolumeToMesh", "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 rna_def_shader_node(BlenderRNA *brna) |