[Bf-blender-cvs] [c11997ccfcb] blender2.8: UI: Physics panel minor adjustments

William Reynish noreply at git.blender.org
Thu Aug 23 17:25:48 CEST 2018


Commit: c11997ccfcbf76bac8509d967d74cc608a5d15f8
Author: William Reynish
Date:   Thu Aug 23 17:21:55 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBc11997ccfcbf76bac8509d967d74cc608a5d15f8

UI: Physics panel minor adjustments

Flow panel had a wrong name when the checkmark was used in the header, fixed alignment in softbody panel & fixed wrong active state for Cloth Pin.

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

M	release/scripts/startup/bl_ui/properties_physics_cloth.py
M	release/scripts/startup/bl_ui/properties_physics_fluid.py
M	release/scripts/startup/bl_ui/properties_physics_softbody.py

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

diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py
index 0a7318864a3..86ded4f9d01 100644
--- a/release/scripts/startup/bl_ui/properties_physics_cloth.py
+++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py
@@ -112,7 +112,7 @@ class PHYSICS_PT_cloth_pinning(PhysicButtonsPanel, Panel):
         md = context.cloth
         cloth = md.settings
 
-        self.layout.active = cloth_panel_enabled(md) and cloth.use_pin_cloth
+        self.layout.active = cloth_panel_enabled(md)
         self.layout.prop(cloth, "use_pin_cloth", text="")
 
     def draw(self, context):
diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py
index 451b17b72b7..23fc39f0f54 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fluid.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py
@@ -86,23 +86,91 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
         col.prop(fluid, "type")
 
 
-class PHYSICS_PT_fluid_settings(PhysicButtonsPanel, Panel):
-    bl_label = "Settings"
+class PHYSICS_PT_fluid_flow(PhysicButtonsPanel, Panel):
+    bl_label = "Flow"
     bl_parent_id = "PHYSICS_PT_fluid"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
 
     @classmethod
     def poll(cls, context):
+        md = context.fluid
+        fluid = md.settings
+
         if not PhysicButtonsPanel.poll_fluid_settings(context):
             return False
-
-        return (context.engine in cls.COMPAT_ENGINES)
+        return fluid.type in {'INFLOW', 'OUTFLOW', 'CONTROL'} and (context.engine in cls.COMPAT_ENGINES)
 
     def draw_header(self, context):
         md = context.fluid
         fluid = md.settings
-        if fluid.type not in {'NONE', 'DOMAIN', 'PARTICLE', 'FLUID', 'OBSTACLE'}:
-            self.layout.prop(fluid, "use", text="")
+
+        self.layout.prop(fluid, "use", text="")
+
+    def draw(self, context):
+        layout = self.layout
+        layout.use_property_split = True
+
+        md = context.fluid
+        fluid = md.settings
+
+        flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
+
+        flow.active = fluid.use
+
+        if fluid.type == 'INFLOW':
+            col = flow.column()
+            col.prop(fluid, "volume_initialization", text="Volume Initialization")
+            col.prop(fluid, "use_animated_mesh")
+
+            row = col.row()
+            row.active = not fluid.use_animated_mesh
+            row.prop(fluid, "use_local_coords")
+
+            col = flow.column()
+            col.prop(fluid, "inflow_velocity", text="Inflow Velocity")
+
+        elif fluid.type == 'OUTFLOW':
+            col = flow.column()
+            col.prop(fluid, "volume_initialization", text="Volume Initialization")
+
+            col = flow.column()
+            col.prop(fluid, "use_animated_mesh")
+
+        elif fluid.type == 'CONTROL':
+            col = flow.column()
+            col.prop(fluid, "quality", slider=True)
+            col.prop(fluid, "use_reverse_frames")
+
+            col = flow.column()
+            col.prop(fluid, "start_time", text="Time Start")
+            col.prop(fluid, "end_time", text="End")
+
+            col.separator()
+
+            col = flow.column()
+            col.prop(fluid, "attraction_strength", text="Attraction Strength")
+            col.prop(fluid, "attraction_radius", text="Radius")
+
+            col.separator()
+
+            col = flow.column(align=True)
+            col.prop(fluid, "velocity_strength", text="Velocity Strength")
+            col.prop(fluid, "velocity_radius", text="Radius")
+
+
+class PHYSICS_PT_fluid_settings(PhysicButtonsPanel, Panel):
+    bl_label = "Settings"
+    bl_parent_id = "PHYSICS_PT_fluid"
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
+
+    @classmethod
+    def poll(cls, context):
+        md = context.fluid
+        fluid = md.settings
+
+        if not PhysicButtonsPanel.poll_fluid_settings(context):
+            return False
+        return fluid.type in {'DOMAIN', 'FLUID', 'OBSTACLE', 'PARTICLE'} and (context.engine in cls.COMPAT_ENGINES)
 
     def draw(self, context):
         layout = self.layout
@@ -168,25 +236,6 @@ class PHYSICS_PT_fluid_settings(PhysicButtonsPanel, Panel):
 
             col.prop(fluid, "impact_factor", text="Impact Factor")
 
-        elif fluid.type == 'INFLOW':
-            col = flow.column()
-            col.prop(fluid, "volume_initialization", text="Volume Initialization")
-            col.prop(fluid, "use_animated_mesh")
-
-            row = col.row()
-            row.active = not fluid.use_animated_mesh
-            row.prop(fluid, "use_local_coords")
-
-            col = flow.column()
-            col.prop(fluid, "inflow_velocity", text="Inflow Velocity")
-
-        elif fluid.type == 'OUTFLOW':
-            col = flow.column()
-            col.prop(fluid, "volume_initialization", text="Volume Initialization")
-
-            col = flow.column()
-            col.prop(fluid, "use_animated_mesh")
-
         elif fluid.type == 'PARTICLE':
             col = flow.column()
             col.prop(fluid, "particle_influence", text="Influence Size")
@@ -197,27 +246,6 @@ class PHYSICS_PT_fluid_settings(PhysicButtonsPanel, Panel):
             col.prop(fluid, "use_floats")
             col.prop(fluid, "show_tracer")
 
-        elif fluid.type == 'CONTROL':
-            col = flow.column()
-            col.prop(fluid, "quality", slider=True)
-            col.prop(fluid, "use_reverse_frames")
-
-            col = flow.column()
-            col.prop(fluid, "start_time", text="Time Start")
-            col.prop(fluid, "end_time", text="End")
-
-            col.separator()
-
-            col = flow.column()
-            col.prop(fluid, "attraction_strength", text="Attraction Strength")
-            col.prop(fluid, "attraction_radius", text="Radius")
-
-            col.separator()
-
-            col = flow.column(align=True)
-            col.prop(fluid, "velocity_strength", text="Velocity Strength")
-            col.prop(fluid, "velocity_radius", text="Radius")
-
 
 class PHYSICS_PT_fluid_particle_cache(PhysicButtonsPanel, Panel):
     bl_label = "Cache"
@@ -421,6 +449,7 @@ classes = (
     FLUID_PT_presets,
     PHYSICS_PT_fluid,
     PHYSICS_PT_fluid_settings,
+    PHYSICS_PT_fluid_flow,
     PHYSICS_PT_fluid_particle_cache,
     PHYSICS_PT_domain_bake,
     PHYSICS_PT_domain_boundary,
diff --git a/release/scripts/startup/bl_ui/properties_physics_softbody.py b/release/scripts/startup/bl_ui/properties_physics_softbody.py
index 761eb56ca5b..595e462e1c3 100644
--- a/release/scripts/startup/bl_ui/properties_physics_softbody.py
+++ b/release/scripts/startup/bl_ui/properties_physics_softbody.py
@@ -320,10 +320,10 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, Panel):
 
         flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
 
-        col = flow.column(align=True)
+        col = flow.column()
         col.prop(softbody, "ball_size", text="Ball Size")
 
-        col = flow.column(align=True)
+        col = flow.column()
         col.prop(softbody, "ball_stiff", text="Stiffness")
         col.prop(softbody, "ball_damp", text="Dampening")



More information about the Bf-blender-cvs mailing list