[Bf-blender-cvs] [b998ccefee1] blender2.8: UI: Single column, flow and sub-panel for collision physics

William Reynish noreply at git.blender.org
Wed Jun 20 16:34:30 CEST 2018


Commit: b998ccefee1afde40fe4db1dc40020d7674ffa82
Author: William Reynish
Date:   Wed Jun 20 16:32:42 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBb998ccefee1afde40fe4db1dc40020d7674ffa82

UI: Single column, flow and sub-panel for collision physics

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

M	release/scripts/startup/bl_ui/properties_physics_field.py

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

diff --git a/release/scripts/startup/bl_ui/properties_physics_field.py b/release/scripts/startup/bl_ui/properties_physics_field.py
index 023eb08967c..169a55e8c1a 100644
--- a/release/scripts/startup/bl_ui/properties_physics_field.py
+++ b/release/scripts/startup/bl_ui/properties_physics_field.py
@@ -181,6 +181,7 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, Panel):
         md = context.collision
 
         split = layout.split()
+        layout.use_property_split = True
 
         coll = md.settings
 
@@ -189,40 +190,90 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, Panel):
 
             layout.active = settings.use
 
-            split = layout.split()
+            col = layout.column()
+            col.prop(settings, "absorption", text="Force Field Absorption")
+
+class PHYSICS_PT_collision_particle(PhysicButtonsPanel, Panel):
+    bl_label = "Particle"
+    bl_parent_id = "PHYSICS_PT_collision"
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
+
+    @classmethod
+    def poll(cls, context):
+        ob = context.object
+        return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.collision)
+
+    def draw(self, context):
+        layout = self.layout
+
+        md = context.collision
+
+        layout.use_property_split = True
+        flow = layout.grid_flow(row_major=True, num_columns=0, even_columns=True, even_rows=False, align=False)
+
+        coll = md.settings
+
+        if coll:
+            settings = context.object.collision
+
+            layout.active = settings.use
 
-            col = split.column()
-            col.label(text="Particle:")
+            col = flow.column()
             col.prop(settings, "permeability", slider=True)
             col.prop(settings, "stickiness")
+            col = flow.column()
             col.prop(settings, "use_particle_kill")
-            col.label(text="Particle Damping:")
-            sub = col.column(align=True)
-            sub.prop(settings, "damping_factor", text="Factor", slider=True)
-            sub.prop(settings, "damping_random", text="Random", slider=True)
 
-            col.label(text="Particle Friction:")
+            col = flow.column()
             sub = col.column(align=True)
-            sub.prop(settings, "friction_factor", text="Factor", slider=True)
-            sub.prop(settings, "friction_random", text="Random", slider=True)
+            sub.prop(settings, "damping_factor", text="Damping", slider=True)
+            sub.prop(settings, "damping_random", text="Randomize", slider=True)
 
-            col = split.column()
-            col.label(text="Soft Body and Cloth:")
+            col = flow.column()
             sub = col.column(align=True)
-            sub.prop(settings, "thickness_outer", text="Outer", slider=True)
-            sub.prop(settings, "thickness_inner", text="Inner", slider=True)
+            sub.prop(settings, "friction_factor", text="Friction", slider=True)
+            sub.prop(settings, "friction_random", text="Randomize", slider=True)
+
+
+class PHYSICS_PT_collision_softbody(PhysicButtonsPanel, Panel):
+    bl_label = "Softbody"
+    bl_parent_id = "PHYSICS_PT_collision"
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
+
+    @classmethod
+    def poll(cls, context):
+        ob = context.object
+        return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.collision)
+
+    def draw(self, context):
+        layout = self.layout
+
+        layout.use_property_split = True
+        flow = layout.grid_flow(row_major=True, num_columns=0, even_columns=True, even_rows=False, align=False)
+
+        md = context.collision
+        coll = md.settings
+
+        if coll:
+            settings = context.object.collision
+
+            layout.active = settings.use
+
+            col = flow.column()
+            col.prop(settings, "damping", text="Damping", slider=True)
 
-            col.label(text="Soft Body Damping:")
-            col.prop(settings, "damping", text="Factor", slider=True)
+            col = flow.column()
+            col.prop(settings, "thickness_outer", text="Thickness Outer", slider=True)
+            col.prop(settings, "thickness_inner", text="Inner", slider=True)
 
-            col.label(text="Force Fields:")
-            col.prop(settings, "absorption", text="Absorption")
 
 
 classes = (
     PHYSICS_PT_field,
     PHYSICS_PT_field_falloff,
     PHYSICS_PT_collision,
+    PHYSICS_PT_collision_particle,
+    PHYSICS_PT_collision_softbody,
 )
 
 if __name__ == "__main__":  # only for live edit.



More information about the Bf-blender-cvs mailing list