From 6c036a65c9741786deb53191fa77d83e7ffb1be3 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Tue, 31 Mar 2020 17:06:17 +0200 Subject: Add Voxel Mode to the Remesh modifier This adds the Voxel Mode to the current remesh modifier. It works exactly the same way as the voxel remesh operator and uses the same properties to control the remeshing. We can exand this with more options in the future (fix poles, reprojection...) Reviewed By: brecht Differential Revision: https://developer.blender.org/D7292 --- source/blender/makesrna/intern/rna_modifier.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'source/blender/makesrna') diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 455fb1c50c9..d2eaa9538ff 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -5128,6 +5128,11 @@ static void rna_def_modifier_remesh(BlenderRNA *brna) 0, "Sharp", "Output a surface that reproduces sharp edges and corners from the input mesh"}, + {MOD_REMESH_VOXEL, + "VOXEL", + 0, + "Voxel", + "Output a mesh corresponding to the volume of the original mesh"}, {0, NULL, 0, NULL, NULL}, }; @@ -5181,6 +5186,25 @@ static void rna_def_modifier_remesh(BlenderRNA *brna) "edges closer to the input"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + prop = RNA_def_property(srna, "voxel_size", PROP_FLOAT, PROP_DISTANCE); + RNA_def_property_float_sdna(prop, NULL, "voxel_size"); + RNA_def_property_ui_range(prop, 0.0001, 2, 0.1, 3); + RNA_def_property_ui_text(prop, + "Voxel Size", + "Size of the voxel in object space used for volume evaluation. Lower " + "values preserve finer details"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "adaptivity", PROP_FLOAT, PROP_DISTANCE); + RNA_def_property_float_sdna(prop, NULL, "adaptivity"); + RNA_def_property_ui_range(prop, 0, 1, 0.1, 3); + RNA_def_property_ui_text( + prop, + "Adaptivity", + "Reduces the final face count by simplifying geometry where detail is not needed, " + "generating triangles. A value greater than 0 disables Fix Poles"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + prop = RNA_def_property(srna, "use_remove_disconnected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_REMESH_FLOOD_FILL); RNA_def_property_ui_text(prop, "Remove Disconnected Pieces", ""); -- cgit v1.2.3