diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_modifier.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 0e83ee150d6..b433c938bd6 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -193,6 +193,11 @@ const EnumPropertyItem rna_enum_object_modifier_type_items[] = { ICON_MOD_WIREFRAME, "Wireframe", "Convert faces into thickened edges"}, + {eModifierType_MeshToVolume, + "MESH_TO_VOLUME", + ICON_VOLUME_DATA, + "Mesh to Volume", + ""}, /* TODO: Use correct icon. */ {0, "", 0, N_("Deform"), ""}, {eModifierType_Armature, "ARMATURE", @@ -6973,6 +6978,77 @@ static void rna_def_modifier_simulation(BlenderRNA *brna) } # endif +static void rna_def_modifier_mesh_to_volume(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem resolution_mode_items[] = { + {MESH_TO_VOLUME_RESOLUTION_MODE_VOXEL_AMOUNT, + "VOXEL_AMOUNT", + 0, + "Voxel Amount", + "Desired number of voxels along one axis"}, + {MESH_TO_VOLUME_RESOLUTION_MODE_VOXEL_SIZE, + "VOXEL_SIZE", + 0, + "Voxel Size", + "Desired voxel side length"}, + {0, NULL, 0, NULL, NULL}, + }; + + srna = RNA_def_struct(brna, "MeshToVolumeModifier", "Modifier"); + RNA_def_struct_ui_text(srna, "Mesh to Volume Modifier", ""); + RNA_def_struct_sdna(srna, "MeshToVolumeModifierData"); + RNA_def_struct_ui_icon(srna, ICON_VOLUME_DATA); /* TODO: Use correct icon. */ + + RNA_define_lib_overridable(true); + + prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); + RNA_def_property_ui_text(prop, "Object", "Object"); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + + 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", "Mode for how the desired voxel size is specified"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "voxel_size", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text( + prop, "Voxel Size", "Smaller values result in a higher resolution output"); + RNA_def_property_range(prop, 0.1, FLT_MAX); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "voxel_amount", PROP_INT, PROP_NONE); + RNA_def_property_ui_text(prop, "Voxel Amount", "Approximate number of voxels along one axis"); + RNA_def_property_range(prop, 0, INT_MAX); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "fill_volume", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text( + prop, "Fill Volume", "Initialize the density grid in every cell inside the enclosed volume"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "interior_band_width", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, "Interior Band Width", "Width of the volume inside of the mesh"); + RNA_def_property_range(prop, 0.0, FLT_MAX); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "exterior_band_width", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, "Exterior Band Width", "Width of the volume outside of the mesh"); + RNA_def_property_range(prop, 0.0, FLT_MAX); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, "Density", "Density of the new volume"); + RNA_def_property_range(prop, 0.0, FLT_MAX); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); +} + void RNA_def_modifier(BlenderRNA *brna) { StructRNA *srna; @@ -7104,6 +7180,7 @@ void RNA_def_modifier(BlenderRNA *brna) # ifdef WITH_PARTICLE_NODES rna_def_modifier_simulation(brna); # endif + rna_def_modifier_mesh_to_volume(brna); } #endif |