[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24677] trunk/blender/release/scripts/ui: Single Column layout for Fields, Smoke, Cloth and Fluids.
Thomas Dinges
dingto at gmx.de
Thu Nov 19 13:58:20 CET 2009
Revision: 24677
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24677
Author: dingto
Date: 2009-11-19 13:58:19 +0100 (Thu, 19 Nov 2009)
Log Message:
-----------
Single Column layout for Fields, Smoke, Cloth and Fluids.
Patch by nudelZ.
Modified Paths:
--------------
trunk/blender/release/scripts/ui/properties_physics_cloth.py
trunk/blender/release/scripts/ui/properties_physics_field.py
trunk/blender/release/scripts/ui/properties_physics_fluid.py
trunk/blender/release/scripts/ui/properties_physics_smoke.py
trunk/blender/release/scripts/ui/properties_physics_softbody.py
Modified: trunk/blender/release/scripts/ui/properties_physics_cloth.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_physics_cloth.py 2009-11-19 11:56:13 UTC (rev 24676)
+++ trunk/blender/release/scripts/ui/properties_physics_cloth.py 2009-11-19 12:58:19 UTC (rev 24677)
@@ -19,6 +19,9 @@
# <pep8 compliant>
import bpy
+narrowui = 180
+
+
from properties_physics_common import point_cache_ui
from properties_physics_common import effector_weights_ui
@@ -46,6 +49,7 @@
md = context.cloth
ob = context.object
+ col2 = context.region.width > narrowui
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
@@ -61,7 +65,8 @@
else:
# add modifier
split.item_enumO("object.modifier_add", "type", 'CLOTH', text="Add")
- split.itemL()
+ if col2:
+ split.column()
if md:
cloth = md.settings
@@ -72,32 +77,33 @@
col = split.column()
+ col.itemL(text="Presets:")
+ col.itemL(text="TODO!")
+
col.itemL(text="Quality:")
col.itemR(cloth, "quality", text="Steps", slider=True)
col.itemL(text="Material:")
- sub = col.column(align=True)
- sub.itemR(cloth, "mass")
- sub.itemR(cloth, "structural_stiffness", text="Structural")
- sub.itemR(cloth, "bending_stiffness", text="Bending")
+ col.itemR(cloth, "mass")
+ col.itemR(cloth, "structural_stiffness", text="Structural")
+ col.itemR(cloth, "bending_stiffness", text="Bending")
- col = split.column()
+ if col2:
+ col = split.column()
- col.itemL(text="Presets: TODO")
- # col.itemL(text="TODO!")
- col.itemR(cloth, "pre_roll")
-
col.itemL(text="Damping:")
- sub = col.column(align=True)
- sub.itemR(cloth, "spring_damping", text="Spring")
- sub.itemR(cloth, "air_damping", text="Air")
+ col.itemR(cloth, "spring_damping", text="Spring")
+ col.itemR(cloth, "air_damping", text="Air")
- col.itemR(cloth, "pin_cloth", text="Pin")
- sub = col.column(align=True)
+ col.itemR(cloth, "pin_cloth", text="Pinning")
+ sub = col.column()
sub.active = cloth.pin_cloth
+ sub.item_pointerR(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
sub.itemR(cloth, "pin_stiffness", text="Stiffness")
- sub.item_pointerR(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
+ col.itemL(text="Pre roll:")
+ col.itemR(cloth, "pre_roll", text="Frame")
+
# Disabled for now
"""
if cloth.mass_vertex_group:
@@ -140,6 +146,7 @@
cloth = context.cloth.collision_settings
md = context.cloth
+ col2 = context.region.width > narrowui
layout.active = cloth.enable_collision and cloth_panel_enabled(md)
@@ -150,7 +157,8 @@
col.itemR(cloth, "min_distance", slider=True, text="Distance")
col.itemR(cloth, "friction")
- col = split.column()
+ if col2:
+ col = split.column()
col.itemR(cloth, "enable_self_collision", text="Self Collision")
sub = col.column()
sub.active = cloth.enable_self_collision
@@ -177,6 +185,7 @@
md = context.cloth
ob = context.object
cloth = context.cloth.settings
+ col2 = context.region.width > narrowui
layout.active = cloth.stiffness_scaling and cloth_panel_enabled(md)
@@ -184,15 +193,14 @@
col = split.column()
col.itemL(text="Structural Stiffness:")
- sub = col.column(align=True)
- sub.itemR(cloth, "structural_stiffness_max", text="Max")
- sub.item_pointerR(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="")
+ col.item_pointerR(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="")
+ col.itemR(cloth, "structural_stiffness_max", text="Max")
- col = split.column()
+ if col2:
+ col = split.column()
col.itemL(text="Bending Stiffness:")
- sub = col.column(align=True)
- sub.itemR(cloth, "bending_stiffness_max", text="Max")
- sub.item_pointerR(cloth, "bending_vertex_group", ob, "vertex_groups", text="")
+ col.item_pointerR(cloth, "bending_vertex_group", ob, "vertex_groups", text="")
+ col.itemR(cloth, "bending_stiffness_max", text="Max")
class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel):
Modified: trunk/blender/release/scripts/ui/properties_physics_field.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_physics_field.py 2009-11-19 11:56:13 UTC (rev 24676)
+++ trunk/blender/release/scripts/ui/properties_physics_field.py 2009-11-19 12:58:19 UTC (rev 24677)
@@ -19,6 +19,9 @@
# <pep8 compliant>
import bpy
+narrowui = 180
+
+
from properties_physics_common import basic_force_field_settings_ui
from properties_physics_common import basic_force_field_falloff_ui
@@ -41,17 +44,24 @@
ob = context.object
field = ob.field
+ col2 = context.region.width > narrowui
- split = layout.split(percentage=0.2)
- split.itemL(text="Type:")
+ if col2:
+ split = layout.split(percentage=0.2)
+ split.itemL(text="Type:")
+ else:
+ split = layout.split()
+
split.itemR(field, "type", text="")
if field.type not in ('NONE', 'GUIDE', 'TEXTURE'):
- split = layout.split(percentage=0.2)
- #split = layout.row()
- split.itemL(text="Shape:")
+ if col2:
+ split = layout.split(percentage=0.2)
+ split.itemL(text="Shape:")
+ else:
+ split = layout.split()
split.itemR(field, "shape", text="")
-
+
split = layout.split()
if field.type == 'NONE':
@@ -162,6 +172,7 @@
layout = self.layout
md = context.collision
+ col2 = context.region.width > narrowui
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
@@ -170,7 +181,8 @@
# remove modifier + settings
split.set_context_pointer("modifier", md)
split.itemO("object.modifier_remove", text="Remove")
- col = split.column()
+ if col2:
+ col = split.column()
#row = split.row(align=True)
#row.itemR(md, "render", text="")
@@ -181,7 +193,8 @@
else:
# add modifier
split.item_enumO("object.modifier_add", "type", 'COLLISION', text="Add")
- split.itemL()
+ if col2:
+ split.itemL()
coll = None
@@ -195,28 +208,29 @@
col = split.column()
col.itemL(text="Particle:")
col.itemR(settings, "permeability", slider=True)
+ col.itemR(settings, "kill_particles")
col.itemL(text="Particle Damping:")
sub = col.column(align=True)
sub.itemR(settings, "damping_factor", text="Factor", slider=True)
sub.itemR(settings, "random_damping", text="Random", slider=True)
+ col.itemL(text="Particle Friction:")
+ sub = col.column(align=True)
+ sub.itemR(settings, "friction_factor", text="Factor", slider=True)
+ sub.itemR(settings, "random_friction", text="Random", slider=True)
+
+ if col2:
+ col = split.column()
col.itemL(text="Soft Body and Cloth:")
sub = col.column(align=True)
sub.itemR(settings, "outer_thickness", text="Outer", slider=True)
sub.itemR(settings, "inner_thickness", text="Inner", slider=True)
- layout.itemL(text="Force Fields:")
- layout.itemR(settings, "absorption", text="Absorption")
-
- col = split.column()
- col.itemL(text="")
- col.itemR(settings, "kill_particles")
- col.itemL(text="Particle Friction:")
- sub = col.column(align=True)
- sub.itemR(settings, "friction_factor", text="Factor", slider=True)
- sub.itemR(settings, "random_friction", text="Random", slider=True)
col.itemL(text="Soft Body Damping:")
col.itemR(settings, "damping", text="Factor", slider=True)
+ col.itemL(text="Force Fields:")
+ col.itemR(settings, "absorption", text="Absorption")
+
bpy.types.register(PHYSICS_PT_field)
bpy.types.register(PHYSICS_PT_collision)
Modified: trunk/blender/release/scripts/ui/properties_physics_fluid.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_physics_fluid.py 2009-11-19 11:56:13 UTC (rev 24676)
+++ trunk/blender/release/scripts/ui/properties_physics_fluid.py 2009-11-19 12:58:19 UTC (rev 24677)
@@ -19,7 +19,9 @@
# <pep8 compliant>
import bpy
+narrowui = 180
+
class PhysicButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
@@ -38,6 +40,7 @@
layout = self.layout
md = context.fluid
+ col2 = context.region.width > narrowui
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
@@ -56,13 +59,17 @@
else:
# add modifier
split.item_enumO("object.modifier_add", "type", 'FLUID_SIMULATION', text="Add")
- split.itemL()
+ if col2:
+ split.itemL()
fluid = None
if fluid:
- layout.itemR(fluid, "type")
+ if col2:
+ layout.itemR(fluid, "type")
+ else:
+ layout.itemR(fluid, "type", text="")
if fluid.type == 'DOMAIN':
layout.itemO("fluid.bake", text="Bake Fluid Simulation", icon='ICON_MOD_FLUIDSIM')
@@ -73,17 +80,25 @@
col.itemR(fluid, "resolution", text="Final")
col.itemL(text="Render Display:")
col.itemR(fluid, "render_display_mode", text="")
+
+ if col2:
+ col = split.column()
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list