[Bf-blender-cvs] [18e0d06cfa8] soc-2019-adaptive-cloth: Cloth: Basic UI Implemented

ishbosamiya noreply at git.blender.org
Tue Jun 11 13:04:25 CEST 2019


Commit: 18e0d06cfa8c33ec37a6c23a7776735a7dc7d860
Author: ishbosamiya
Date:   Tue Jun 11 16:32:30 2019 +0530
Branches: soc-2019-adaptive-cloth
https://developer.blender.org/rB18e0d06cfa8c33ec37a6c23a7776735a7dc7d860

Cloth: Basic UI Implemented

This is not the final UI, only a rough UI for current usage, need to add option for whether or not remeshing should be enabled.

===================================================================

M	release/scripts/startup/bl_ui/properties_physics_cloth.py
M	source/blender/makesrna/intern/rna_cloth.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py
index 92c4f1aae63..26f943c4517 100644
--- a/release/scripts/startup/bl_ui/properties_physics_cloth.py
+++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py
@@ -309,6 +309,37 @@ class PHYSICS_PT_cloth_self_collision(PhysicButtonsPanel, Panel):
         col.prop_search(cloth, "vertex_group_self_collisions", ob, "vertex_groups", text="Vertex Group")
 
 
+class PHYSICS_PT_cloth_remeshing(PhysicButtonsPanel, Panel):
+    bl_label = "Remeshing"
+    bl_parent_id = 'PHYSICS_PT_cloth'
+    bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
+
+    def draw(self, context):
+        layout = self.layout
+        layout.use_property_split = True
+
+        md = context.cloth
+        cloth = md.settings
+
+#layout.active = cloth_panel_enabled(md)
+
+        flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
+
+        col = flow.column()
+        col.prop(cloth, "refine_angle", text="Refine Angle")
+        col = flow.column()
+        col.prop(cloth, "refine_compression", text="Refine Compression")
+        col = flow.column()
+        col.prop(cloth, "refine_velocity", text="Refine Velocity")
+        col = flow.column()
+        col.prop(cloth, "size_min", text="Size Minimum")
+        col = flow.column()
+        col.prop(cloth, "size_max", text="Size Maximum")
+        col = flow.column()
+        col.prop(cloth, "aspect_min", text="Aspect Minimum")
+
+
 class PHYSICS_PT_cloth_property_weights(PhysicButtonsPanel, Panel):
     bl_label = "Property Weights"
     bl_parent_id = 'PHYSICS_PT_cloth'
@@ -385,6 +416,7 @@ classes = (
     PHYSICS_PT_cloth_collision,
     PHYSICS_PT_cloth_object_collision,
     PHYSICS_PT_cloth_self_collision,
+    PHYSICS_PT_cloth_remeshing,
     PHYSICS_PT_cloth_property_weights,
     PHYSICS_PT_cloth_field_weights,
 )
diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index c93833ef493..dfa3b62ae80 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -774,6 +774,43 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
   RNA_def_property_update(prop, 0, "rna_cloth_update");
   RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 
+  /* remeshing */
+  prop = RNA_def_property(srna, "refine_angle", PROP_FLOAT, PROP_NONE);
+  RNA_def_property_float_sdna(prop, NULL, "refine_angle");
+  RNA_def_property_range(prop, 0.0f, 10.0f);
+  RNA_def_property_ui_text(prop, "Remeshing Refine Angle", "Remeshing refine angle");
+  RNA_def_property_update(prop, 0, "rna_cloth_update");
+
+  prop = RNA_def_property(srna, "refine_compression", PROP_FLOAT, PROP_NONE);
+  RNA_def_property_float_sdna(prop, NULL, "refine_compression");
+  RNA_def_property_range(prop, 0.0f, 10.0f);
+  RNA_def_property_ui_text(prop, "Remeshing Refine Compression", "Remeshing refine compression");
+  RNA_def_property_update(prop, 0, "rna_cloth_update");
+
+  prop = RNA_def_property(srna, "refine_velocity", PROP_FLOAT, PROP_NONE);
+  RNA_def_property_float_sdna(prop, NULL, "refine_velocity");
+  RNA_def_property_range(prop, 0.0f, 10.0f);
+  RNA_def_property_ui_text(prop, "Remeshing Refine Velocity", "Remeshing refine velocity");
+  RNA_def_property_update(prop, 0, "rna_cloth_update");
+
+  prop = RNA_def_property(srna, "size_min", PROP_FLOAT, PROP_NONE);
+  RNA_def_property_float_sdna(prop, NULL, "size_min");
+  RNA_def_property_range(prop, 0.0f, 10.0f);
+  RNA_def_property_ui_text(prop, "Remeshing Size Min", "Remeshing size minimum");
+  RNA_def_property_update(prop, 0, "rna_cloth_update");
+
+  prop = RNA_def_property(srna, "size_max", PROP_FLOAT, PROP_NONE);
+  RNA_def_property_float_sdna(prop, NULL, "size_max");
+  RNA_def_property_range(prop, 0.0f, 10.0f);
+  RNA_def_property_ui_text(prop, "Remeshing Size Max", "Remeshing size maximum");
+  RNA_def_property_update(prop, 0, "rna_cloth_update");
+
+  prop = RNA_def_property(srna, "aspect_min", PROP_FLOAT, PROP_NONE);
+  RNA_def_property_float_sdna(prop, NULL, "aspect_min");
+  RNA_def_property_range(prop, 0.0f, 10.0f);
+  RNA_def_property_ui_text(prop, "Remeshing Aspect Min", "Remeshing aspect minimum");
+  RNA_def_property_update(prop, 0, "rna_cloth_update");
+
   /* unused */
 
   /* unused still */



More information about the Bf-blender-cvs mailing list