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:
authorWilliam Reynish <billreynish>2018-06-20 17:32:42 +0300
committerPablo Vazquez <venomgfx@gmail.com>2018-06-20 17:34:27 +0300
commitb998ccefee1afde40fe4db1dc40020d7674ffa82 (patch)
tree0812bcc6bd72653da9781b654fae2437d926a604 /release
parentab9e2dccd319df0fa4b782a49694cc0b0ca06adb (diff)
UI: Single column, flow and sub-panel for collision physics
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_field.py87
1 files changed, 69 insertions, 18 deletions
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.