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:
Diffstat (limited to 'source/blender/modifiers/intern/MOD_remesh.c')
-rw-r--r--source/blender/modifiers/intern/MOD_remesh.c65
1 files changed, 63 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_remesh.c b/source/blender/modifiers/intern/MOD_remesh.c
index 5a262adf47c..a76b3acb783 100644
--- a/source/blender/modifiers/intern/MOD_remesh.c
+++ b/source/blender/modifiers/intern/MOD_remesh.c
@@ -27,16 +27,27 @@
#include "BLI_math_base.h"
#include "BLI_threads.h"
+#include "BLT_translation.h"
+
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
+#include "DNA_screen_types.h"
-#include "MOD_modifiertypes.h"
-
+#include "BKE_context.h"
#include "BKE_mesh.h"
#include "BKE_mesh_remesh_voxel.h"
#include "BKE_mesh_runtime.h"
+#include "BKE_screen.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+
+#include "RNA_access.h"
+
+#include "MOD_modifiertypes.h"
+#include "MOD_ui_common.h"
#include <assert.h>
#include <stdlib.h>
@@ -226,6 +237,54 @@ static Mesh *modifyMesh(ModifierData *UNUSED(md),
#endif /* !WITH_MOD_REMESH */
+static void panel_draw(const bContext *C, Panel *panel)
+{
+ uiLayout *layout = panel->layout;
+#ifdef WITH_MOD_REMESH
+ uiLayout *row;
+
+ PointerRNA ptr;
+ PointerRNA ob_ptr;
+ modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr);
+
+ int mode = RNA_enum_get(&ptr, "mode");
+
+ uiItemR(layout, &ptr, "mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
+
+ uiLayoutSetPropSep(layout, true);
+
+ if (mode == MOD_REMESH_VOXEL) {
+ uiItemR(layout, &ptr, "voxel_size", 0, NULL, ICON_NONE);
+ uiItemR(layout, &ptr, "adaptivity", 0, NULL, ICON_NONE);
+ }
+ else {
+ uiItemR(layout, &ptr, "octree_depth", 0, NULL, ICON_NONE);
+ uiItemR(layout, &ptr, "scale", 0, NULL, ICON_NONE);
+
+ if (mode == MOD_REMESH_SHARP_FEATURES) {
+ uiItemR(layout, &ptr, "sharpness", 0, NULL, ICON_NONE);
+ }
+
+ uiItemR(layout, &ptr, "use_remove_disconnected", 0, NULL, ICON_NONE);
+ row = uiLayoutRow(layout, false);
+ uiLayoutSetActive(row, RNA_boolean_get(&ptr, "use_remove_disconnected"));
+ uiItemR(layout, &ptr, "threshold", 0, NULL, ICON_NONE);
+ }
+ uiItemR(layout, &ptr, "use_smooth_shade", 0, NULL, ICON_NONE);
+
+ modifier_panel_end(layout, &ptr);
+
+#else /* WITH_MOD_REMESH */
+ uiItemL(layout, IFACE_("Built without Remesh modifier"), ICON_NONE);
+ UNUSED_VARS(C);
+#endif /* WITH_MOD_REMESH */
+}
+
+static void panelRegister(ARegionType *region_type)
+{
+ modifier_panel_register(region_type, eModifierType_Remesh, panel_draw);
+}
+
ModifierTypeInfo modifierType_Remesh = {
/* name */ "Remesh",
/* structName */ "RemeshModifierData",
@@ -254,5 +313,7 @@ ModifierTypeInfo modifierType_Remesh = {
/* dependsOnNormals */ NULL,
/* foreachObjectLink */ NULL,
/* foreachIDLink */ NULL,
+ /* foreachTexLink */ NULL,
/* freeRuntimeData */ NULL,
+ /* panelRegister */ panelRegister,
};