Single Column layout for Fields, Smoke, Cloth and Fluids.

Patch by nudelZ.
This commit is contained in:
Thomas Dinges
2009-11-19 12:58:19 +00:00
parent 3b4c9d9699
commit d3600a92dc
5 changed files with 142 additions and 84 deletions

View File

@@ -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 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
md = context.cloth
ob = context.object
col2 = context.region.width > narrowui
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
@@ -61,7 +65,8 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
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,31 +77,32 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
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()
col.itemL(text="Presets: TODO")
# col.itemL(text="TODO!")
col.itemR(cloth, "pre_roll")
if col2:
col = split.column()
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.itemR(cloth, "pin_stiffness", text="Stiffness")
sub.item_pointerR(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
sub.itemR(cloth, "pin_stiffness", text="Stiffness")
col.itemL(text="Pre roll:")
col.itemR(cloth, "pre_roll", text="Frame")
# Disabled for now
"""
@@ -140,6 +146,7 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
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 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
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 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
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 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
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):

View File

@@ -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 @@ class PHYSICS_PT_field(PhysicButtonsPanel):
ob = context.object
field = ob.field
col2 = context.region.width > narrowui
if col2:
split = layout.split(percentage=0.2)
split.itemL(text="Type:")
else:
split = layout.split()
split = layout.split(percentage=0.2)
split.itemL(text="Type:")
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 @@ class PHYSICS_PT_collision(PhysicButtonsPanel):
layout = self.layout
md = context.collision
col2 = context.region.width > narrowui
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
@@ -170,7 +181,8 @@ class PHYSICS_PT_collision(PhysicButtonsPanel):
# 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 @@ class PHYSICS_PT_collision(PhysicButtonsPanel):
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 @@ class PHYSICS_PT_collision(PhysicButtonsPanel):
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)

View File

@@ -19,6 +19,8 @@
# <pep8 compliant>
import bpy
narrowui = 180
class PhysicButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -38,6 +40,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
layout = self.layout
md = context.fluid
col2 = context.region.width > narrowui
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
@@ -56,13 +59,17 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
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 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
col.itemR(fluid, "resolution", text="Final")
col.itemL(text="Render Display:")
col.itemR(fluid, "render_display_mode", text="")
if col2:
col = split.column()
col.itemL(text="Required Memory: " + fluid.memory_estimate)
col.itemR(fluid, "preview_resolution", text="Preview")
col.itemL(text="Viewport Display:")
col.itemR(fluid, "viewport_display_mode", text="")
split = layout.split()
col = split.column()
col.itemL(text="Time:")
sub = col.column(align=True)
sub.itemR(fluid, "start_time", text="Start")
sub.itemR(fluid, "end_time", text="End")
col = split.column()
col.itemL(text="Required Memory: " + fluid.memory_estimate)
col.itemR(fluid, "preview_resolution", text="Preview")
col.itemL(text="Viewport Display:")
col.itemR(fluid, "viewport_display_mode", text="")
col.itemL()
if col2:
col = split.column()
col.itemL()
col.itemR(fluid, "generate_speed_vectors")
col.itemR(fluid, "reverse_frames")
@@ -96,8 +111,9 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
col.itemL(text="Volume Initialization:")
col.itemR(fluid, "volume_initialization", text="")
col.itemR(fluid, "export_animated_mesh")
col = split.column()
if col2:
col = split.column()
col.itemL(text="Initial Velocity:")
col.itemR(fluid, "initial_velocity", text="")
@@ -109,7 +125,8 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
col.itemR(fluid, "volume_initialization", text="")
col.itemR(fluid, "export_animated_mesh")
col = split.column()
if col2:
col = split.column()
col.itemL(text="Slip Type:")
col.itemR(fluid, "slip_type", text="")
if fluid.slip_type == 'PARTIALSLIP':
@@ -127,7 +144,8 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
col.itemR(fluid, "export_animated_mesh")
col.itemR(fluid, "local_coordinates")
col = split.column()
if col2:
col = split.column()
col.itemL(text="Inflow Velocity:")
col.itemR(fluid, "inflow_velocity", text="")
@@ -139,22 +157,22 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
col.itemR(fluid, "volume_initialization", text="")
col.itemR(fluid, "export_animated_mesh")
split.column()
if col2:
split.column()
elif fluid.type == 'PARTICLE':
split = layout.split(percentage=0.5)
split = layout.split()
col = split.column()
col.itemL(text="Influence:")
col.itemR(fluid, "particle_influence", text="Size")
col.itemR(fluid, "alpha_influence", text="Alpha")
col = split.column()
if col2:
col = split.column()
col.itemL(text="Type:")
col.itemR(fluid, "drops")
col.itemR(fluid, "floats")
col = split.column()
col.itemL()
col.itemR(fluid, "tracer")
layout.itemR(fluid, "path", text="")
@@ -167,7 +185,8 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
col.itemR(fluid, "quality", slider=True)
col.itemR(fluid, "reverse_frames")
col = split.column()
if col2:
col = split.column()
col.itemL(text="Time:")
sub = col.column(align=True)
sub.itemR(fluid, "start_time", text="Start")
@@ -181,7 +200,8 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
sub.itemR(fluid, "attraction_strength", text="Strength")
sub.itemR(fluid, "attraction_radius", text="Radius")
col = split.column()
if col2:
col = split.column()
col.itemL(text="Velocity Force:")
sub = col.column(align=True)
sub.itemR(fluid, "velocity_strength", text="Strength")
@@ -200,6 +220,7 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
layout = self.layout
fluid = context.fluid.settings
col2 = context.region.width > narrowui
split = layout.split()
@@ -209,7 +230,8 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
col.itemL(text="Real World Size:")
col.itemR(fluid, "real_world_size", text="Metres")
col = split.column()
if col2:
col = split.column()
col.itemL(text="Viscosity Presets:")
sub = col.column(align=True)
sub.itemR(fluid, "viscosity_preset", text="")
@@ -217,14 +239,10 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
if fluid.viscosity_preset == 'MANUAL':
sub.itemR(fluid, "viscosity_base", text="Base")
sub.itemR(fluid, "viscosity_exponent", text="Exponent", slider=True)
else:
sub.itemL()
sub.itemL()
col.itemL(text="Optimization:")
sub = col.column(align=True)
sub.itemR(fluid, "grid_levels", slider=True)
sub.itemR(fluid, "compressibility", slider=True)
col.itemR(fluid, "grid_levels", slider=True)
col.itemR(fluid, "compressibility", slider=True)
class PHYSICS_PT_domain_boundary(PhysicButtonsPanel):
@@ -239,21 +257,21 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel):
layout = self.layout
fluid = context.fluid.settings
col2 = context.region.width > narrowui
split = layout.split()
col = split.column()
col.itemL(text="Slip Type:")
sub = col.column(align=True)
sub.itemR(fluid, "slip_type", text="")
col.itemR(fluid, "slip_type", text="")
if fluid.slip_type == 'PARTIALSLIP':
sub.itemR(fluid, "partial_slip_factor", slider=True, text="Amount")
col.itemR(fluid, "partial_slip_factor", slider=True, text="Amount")
col = split.column()
if col2:
col = split.column()
col.itemL(text="Surface:")
sub = col.column(align=True)
sub.itemR(fluid, "surface_smoothing", text="Smoothing")
sub.itemR(fluid, "surface_subdivisions", text="Subdivisions")
col.itemR(fluid, "surface_smoothing", text="Smoothing")
col.itemR(fluid, "surface_subdivisions", text="Subdivisions")
class PHYSICS_PT_domain_particles(PhysicButtonsPanel):

View File

@@ -19,6 +19,8 @@
# <pep8 compliant>
import bpy
narrowui = 180
from properties_physics_common import point_cache_ui
from properties_physics_common import effector_weights_ui
@@ -43,6 +45,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
md = context.smoke
ob = context.object
col2 = context.region.width > narrowui
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
@@ -59,10 +62,14 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
else:
# add modifier
split.item_enumO("object.modifier_add", "type", 'SMOKE', text="Add")
split.itemL()
if col2:
split.itemL()
if md:
layout.itemR(md, "smoke_type", expand=True)
if col2:
layout.itemR(md, "smoke_type", expand=True)
else:
layout.itemR(md, "smoke_type", text="")
if md.smoke_type == 'TYPE_DOMAIN':
@@ -74,7 +81,8 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
col.itemL(text="Resolution:")
col.itemR(domain, "maxres", text="Divisions")
col = split.column()
if col2:
col = split.column()
col.itemL(text="Behavior:")
col.itemR(domain, "alpha")
col.itemR(domain, "beta")
@@ -96,9 +104,11 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
col.item_pointerR(flow, "psys", ob, "particle_systems", text="")
if md.flow_settings.outflow:
col = split.column()
if col2:
col = split.column()
else:
col = split.column()
if col2:
col = split.column()
col.itemL(text="Behavior:")
col.itemR(flow, "temperature")
col.itemR(flow, "density")
@@ -119,6 +129,7 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
layout = self.layout
group = context.smoke.domain_settings
col2 = context.region.width > narrowui
split = layout.split()
@@ -129,7 +140,8 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
#col.itemL(text="Effector Group:")
#col.itemR(group, "eff_group", text="")
col = split.column()
if col2:
col = split.column()
col.itemL(text="Collision Group:")
col.itemR(group, "coll_group", text="")
@@ -166,18 +178,20 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
layout = self.layout
md = context.smoke.domain_settings
col2 = context.region.width > narrowui
split = layout.split()
col = split.column()
col.itemL(text="Resolution:")
col.itemR(md, "amplify", text="Divisions")
col.itemR(md, "viewhighres")
col = split.column()
if col2:
col = split.column()
col.itemL(text="Noise Method:")
col.row().itemR(md, "noise_type", text="")
col.itemR(md, "strength")
col.itemR(md, "viewhighres")
class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):

View File

@@ -19,6 +19,8 @@
# <pep8 compliant>
import bpy
narrowui = 180
from properties_physics_common import point_cache_ui
from properties_physics_common import effector_weights_ui
@@ -47,6 +49,7 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel):
md = context.soft_body
ob = context.object
col2 = context.region.width > narrowui
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
@@ -62,7 +65,8 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel):
else:
# add modifier
split.item_enumO("object.modifier_add", "type", 'SOFT_BODY', text="Add")
split.itemL("")
if col2:
split.column()
if md:
softbody = md.settings