UI: use single column layout for particles

Also minor changes to other panels.

Patch by @billreynish
This commit is contained in:
Campbell Barton 2018-06-02 21:40:33 +02:00
parent c55e90da4c
commit 04d9316cf3
4 changed files with 304 additions and 313 deletions

View File

@ -37,27 +37,26 @@ class MotionPathButtonsPanel:
mps = avs.motion_path
# Display Range
layout.row().prop(mps, "type", expand=True)
layout.use_property_split = True
layout.row().prop(mps, "type")
split = layout.split()
col = layout.column()
col = split.column()
col.label(text="Display Range:")
sub = col.column(align=True)
if mps.type == 'CURRENT_FRAME':
sub.prop(mps, "frame_before", text="Before")
sub.prop(mps, "frame_before", text="Frame Range Before")
sub.prop(mps, "frame_after", text="After")
elif mps.type == 'RANGE':
sub.prop(mps, "frame_start", text="Start")
sub.prop(mps, "frame_start", text="Frame Range Start")
sub.prop(mps, "frame_end", text="End")
sub.prop(mps, "frame_step", text="Step")
col = split.column()
col = layout.column(align=True)
if bones:
col.label(text="Cache for Bone:")
else:
col.label(text="Cache:")
col.label(text="Cache")
if mpath:
sub = col.column(align=True)
@ -81,17 +80,15 @@ class MotionPathButtonsPanel:
sub.operator("object.paths_calculate", text="Calculate...", icon='OBJECT_DATA')
# Display Settings
split = layout.split()
col = split.column()
col.label(text="Show:")
layout.label(text="Display")
col = layout.column()
col.prop(mps, "show_frame_numbers", text="Frame Numbers")
if mpath is not None:
col.prop(mpath, "lines", text="Lines")
col.prop(mpath, "line_thickness", text="Thickness")
col = split.column()
col.label("")
col.prop(mps, "show_keyframe_highlight", text="Keyframes")
sub = col.column()
sub.enabled = mps.show_keyframe_highlight
@ -101,11 +98,11 @@ class MotionPathButtonsPanel:
# Customize path
if mpath is not None:
row = layout.row(align=True)
row.prop(mpath, "use_custom_color", text="", toggle=True, icon='COLOR')
sub = row.row(align=True)
col.prop(mpath, "use_custom_color", text="Custom Color")
sub = col.column()
sub.enabled = mpath.use_custom_color
sub.prop(mpath, "color", text="")
sub.prop(mpath, "color")
# FIXME: this panel still needs to be ported so that it will work correctly with animviz

View File

@ -23,6 +23,7 @@ from rna_prop_ui import PropertyPanel
from bpy.app.translations import pgettext_iface as iface_
from bpy_extras.node_utils import find_node_input, find_output_node
class MATERIAL_MT_specials(Menu):
bl_label = "Material Specials"
@ -172,6 +173,7 @@ class EEVEE_MATERIAL_PT_surface(MaterialButtonsPanel, Panel):
if mat.use_nodes:
panel_node_draw(layout, mat.node_tree, ('OUTPUT_EEVEE_MATERIAL', 'OUTPUT_MATERIAL'))
else:
layout.use_property_split = True
layout.prop(mat, "diffuse_color", text="Base Color")
layout.prop(mat, "metallic")
layout.prop(mat, "specular_intensity", text="Specular")
@ -190,6 +192,7 @@ class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
mat = context.material

View File

@ -255,56 +255,59 @@ class PARTICLE_PT_emission(ParticleButtonsPanel, Panel):
psys = context.particle_system
part = particle_get_settings(context)
layout.use_property_split = True
layout.enabled = particle_panel_enabled(context, psys) and (psys is None or not psys.has_multiple_caches)
row = layout.row()
row.active = part.emit_from == 'VERT' or part.distribution != 'GRID'
row.prop(part, "count")
col = layout.column()
col.active = part.emit_from == 'VERT' or part.distribution != 'GRID'
col.prop(part, "count")
if part.type == 'HAIR':
row.prop(part, "hair_length")
col.prop(part, "hair_length")
if not part.use_advanced_hair:
row = layout.row()
row.prop(part, "use_modifier_stack")
col.prop(part, "use_modifier_stack")
return
if part.type != 'HAIR':
split = layout.split()
col = split.column(align=True)
col.prop(part, "frame_start")
col.prop(part, "frame_end")
col = layout.column()
sub = col.column(align=True)
sub.prop(part, "frame_start", text="Frame Start")
sub.prop(part, "frame_end", text="End")
col = split.column(align=True)
col.prop(part, "lifetime")
col.prop(part, "lifetime_random", slider=True)
col.prop(part, "lifetime_random", slider=True, text="Lifetime Randomness")
layout.label(text="Emit From:")
layout.row().prop(part, "emit_from", expand=True)
col.separator()
layout.label(text="Source")
col = layout.column()
col.prop(part, "emit_from")
col.prop(part, "use_modifier_stack")
if part.emit_from == 'FACE' or part.emit_from == 'VOLUME':
col.prop(part, "distribution")
row = layout.row()
if part.emit_from == 'VERT':
row.prop(part, "use_emit_random")
col.prop(part, "use_emit_random", text="Random Order")
elif part.distribution == 'GRID':
row.prop(part, "invert_grid")
row.prop(part, "hexagonal_grid")
col.label(text="Grid")
col.prop(part, "invert_grid")
col.prop(part, "hexagonal_grid")
else:
row.prop(part, "use_emit_random")
row.prop(part, "use_even_distribution")
col.prop(part, "use_emit_random")
col.prop(part, "use_even_distribution")
if part.emit_from == 'FACE' or part.emit_from == 'VOLUME':
layout.row().prop(part, "distribution", expand=True)
row = layout.row()
if part.distribution == 'JIT':
row.prop(part, "userjit", text="Particles/Face")
row.prop(part, "jitter_factor", text="Jittering Amount", slider=True)
col.prop(part, "userjit", text="Particles/Face")
col.prop(part, "jitter_factor", text="Jittering Amount", slider=True)
elif part.distribution == 'GRID':
row.prop(part, "grid_resolution")
row.prop(part, "grid_random", text="Random", slider=True)
row = layout.row()
row.prop(part, "use_modifier_stack")
col.prop(part, "grid_resolution")
col.prop(part, "grid_random", text="Random", slider=True)
class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel):
@ -345,44 +348,44 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel):
row.operator("particle.hair_dynamics_preset_add", text="", icon='ZOOMIN')
row.operator("particle.hair_dynamics_preset_add", text="", icon='ZOOMOUT').remove_active = True
split = layout.column()
layout.use_property_split = True
col = split.column()
layout.separator()
col = layout.column()
col.label(text="Structure")
col.prop(cloth, "mass")
sub = col.column(align=True)
subsub = sub.row(align=True)
subsub.prop(cloth, "bending_stiffness", text="Stiffness")
subsub.prop(psys.settings, "bending_random", text="Random")
sub.prop(cloth, "bending_damping", text="Damping")
sub.prop(cloth, "bending_stiffness", text="Stiffness")
sub.prop(psys.settings, "bending_random", text="Random")
col.prop(cloth, "bending_damping", text="Damping")
# XXX has no noticeable effect with stiff hair structure springs
#col.prop(cloth, "spring_damping", text="Damping")
split.separator()
layout.separator()
col = split.column()
col = layout.column()
col.label(text="Volume")
col.prop(cloth, "air_damping", text="Air Drag")
col.prop(cloth, "internal_friction", slider=True)
sub = col.column(align=True)
sub.prop(cloth, "density_target", text="Density Target")
sub.prop(cloth, "density_strength", slider=True, text="Strength")
sub.prop(cloth, "density_strength", slider=True, text="Density Strength")
col.prop(cloth, "voxel_cell_size")
split.separator()
layout.separator()
col = split.column()
col = layout.column()
col.label(text="Pinning")
col.prop(cloth, "pin_stiffness", text="Goal Strength")
split.separator()
layout.separator()
col = split.column()
col.label(text="Quality:")
col = layout.column()
col.label(text="Quality")
col.prop(cloth, "quality", text="Steps", slider=True)
row = col.row()
row.prop(psys.settings, "show_hair_grid", text="HairGrid")
col.prop(psys.settings, "show_hair_grid", text="Display Hair Grid")
if result:
box = layout.box()
@ -459,31 +462,30 @@ class PARTICLE_PT_velocity(ParticleButtonsPanel, Panel):
part = particle_get_settings(context)
layout.enabled = particle_panel_enabled(context, psys)
layout.use_property_split = True
split = layout.split()
col = split.column()
col.label(text="Emitter Geometry:")
col = layout.column()
col.label(text="Emitter Geometry")
col.prop(part, "normal_factor")
sub = col.column(align=True)
sub.prop(part, "tangent_factor")
sub.prop(part, "tangent_phase", slider=True)
sub.prop(part, "tangent_factor", text="Tangent")
sub.prop(part, "tangent_phase", slider=True, text="Tangent Phase")
col = split.column()
col.label(text="Emitter Object:")
col.prop(part, "object_align_factor", text="")
col.separator()
col.prop(part, "object_align_factor")
col.label(text="Other")
layout.label(text="Other:")
row = layout.row()
if part.emit_from == 'PARTICLE':
row.prop(part, "particle_factor")
col.prop(part, "particle_factor")
else:
row.prop(part, "object_factor", slider=True)
row.prop(part, "factor_random")
col.prop(part, "object_factor", slider=True)
col.prop(part, "factor_random")
#if part.type=='REACTOR':
# sub.prop(part, "reactor_factor")
# sub.prop(part, "reaction_shape", slider=True)
# if part.type=='REACTOR':
# sub.prop(part, "reactor_factor")
# sub.prop(part, "reaction_shape", slider=True)
class PARTICLE_PT_rotation(ParticleButtonsPanel, Panel):
@ -522,32 +524,31 @@ class PARTICLE_PT_rotation(ParticleButtonsPanel, Panel):
part = context.space_data.pin_id
layout.enabled = particle_panel_enabled(context, psys) and part.use_rotations
layout.use_property_split = True
layout.label(text="Initial Orientation:")
layout.label(text="Initial Orientation")
split = layout.split()
col = layout.column()
col = split.column(align=True)
col.prop(part, "rotation_mode", text="")
col.prop(part, "rotation_factor_random", slider=True, text="Random")
col.prop(part, "rotation_mode")
col.prop(part, "rotation_factor_random", slider=True, text="Randomize")
col.separator()
col = split.column(align=True)
col.prop(part, "phase_factor", slider=True)
col.prop(part, "phase_factor_random", text="Random", slider=True)
col.prop(part, "phase_factor_random", text="Randomize Phase ", slider=True)
if part.type != 'HAIR':
layout.label(text="Angular Velocity:")
col.prop(part, "use_dynamic_rotation")
split = layout.split()
col.separator()
col = split.column(align=True)
col.prop(part, "angular_velocity_mode", text="")
col.label(text="Angular Velocity")
col.prop(part, "angular_velocity_mode", text="Axis")
sub = col.column(align=True)
sub.active = part.angular_velocity_mode != 'NONE'
sub.prop(part, "angular_velocity_factor", text="")
col = split.column()
col.prop(part, "use_dynamic_rotation")
sub.prop(part, "angular_velocity_factor", text="Amount")
class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
@ -568,32 +569,35 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
part = particle_get_settings(context)
layout.enabled = particle_panel_enabled(context, psys)
layout.row().prop(part, "physics_type", expand=True)
layout.prop(part, "physics_type")
row = layout.row()
col = layout.column()
if part.physics_type != 'NO':
col = row.column(align=True)
col = col.column()
col.prop(part, "mass")
col.prop(part, "use_multiply_size_mass", text="Multiply mass with size")
if part.physics_type in {'NEWTON', 'FLUID'}:
split = layout.split()
col = split.column()
col.label(text="Forces:")
col.prop(part, "use_size_deflect")
col.prop(part, "use_die_on_collision")
col.prop(part, "collision_group")
col.label(text="Forces")
col.prop(part, "brownian_factor")
col.prop(part, "drag_factor", slider=True)
col.prop(part, "damping", slider=True)
col = split.column()
col.label(text="Integration:")
col.prop(part, "integrator", text="")
col.label(text="Integration")
col.prop(part, "integrator")
col.prop(part, "timestep")
sub = col.row()
sub.prop(part, "subframes")
@ -604,46 +608,31 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
if supports_courant and part.use_adaptive_subframes:
col.prop(part, "courant_target", text="Threshold")
row = layout.row()
row.prop(part, "use_size_deflect")
row.prop(part, "use_die_on_collision")
layout.prop(part, "collision_group")
if part.physics_type == 'FLUID':
fluid = part.fluid
split = layout.split()
sub = split.row()
sub.prop(fluid, "solver", expand=True)
split = layout.split()
col = split.column()
col.label(text="Fluid Properties:")
col.label(text="Fluid")
col.prop(fluid, "solver")
col.prop(fluid, "stiffness", text="Stiffness")
col.prop(fluid, "linear_viscosity", text="Viscosity")
col.prop(fluid, "buoyancy", text="Buoyancy", slider=True)
col = split.column()
col.label(text="Advanced:")
col.label(text="Advanced")
if fluid.solver == 'DDR':
sub = col.row()
sub = col.column()
sub.prop(fluid, "repulsion", slider=fluid.factor_repulsion)
sub.prop(fluid, "factor_repulsion", text="")
sub.prop(fluid, "factor_repulsion")
sub = col.row()
sub.prop(fluid, "stiff_viscosity", slider=fluid.factor_stiff_viscosity)
sub.prop(fluid, "factor_stiff_viscosity", text="")
sub.prop(fluid, "factor_stiff_viscosity")
sub = col.row()
sub = col.column()
sub.prop(fluid, "fluid_radius", slider=fluid.factor_radius)
sub.prop(fluid, "factor_radius", text="")
sub.prop(fluid, "factor_radius")
sub = col.row()
sub.prop(fluid, "rest_density", slider=fluid.use_factor_density)
sub.prop(fluid, "use_factor_density", text="")
sub.prop(fluid, "use_factor_density")
if fluid.solver == 'CLASSICAL':
# With the classical solver, it is possible to calculate the
@ -651,44 +640,40 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
# makes it easier to set stable initial conditions.
particle_volume = part.mass / fluid.rest_density
spacing = pow(particle_volume, 1.0 / 3.0)
sub = col.row()
sub.label(text="Spacing: %g" % spacing)
elif fluid.solver == 'DDR':
split = layout.split()
col = split.column()
col.label(text="Springs:")
col.label(text="Springs")
col.prop(fluid, "spring_force", text="Force")
col.prop(fluid, "use_viscoelastic_springs")
sub = col.column(align=True)
sub = col.column()
sub.active = fluid.use_viscoelastic_springs
sub.prop(fluid, "yield_ratio", slider=True)
sub.prop(fluid, "plasticity", slider=True)
col = split.column()
col.label(text="Advanced:")
sub = col.row()
col.label(text="Advanced")
sub = col.column()
sub.prop(fluid, "rest_length", slider=fluid.factor_rest_length)
sub.prop(fluid, "factor_rest_length", text="")
col.label(text="")
sub = col.column()
sub.active = fluid.use_viscoelastic_springs
sub.prop(fluid, "use_initial_rest_length")
sub.prop(fluid, "spring_frames", text="Frames")
elif part.physics_type == 'KEYED':
split = layout.split()
sub = split.column()
row = layout.row()
col = row.column()
col.active = not psys.use_keyed_timing
col.prop(part, "keyed_loops", text="Loops")
sub = col.column()
sub.active = not psys.use_keyed_timing
sub.prop(part, "keyed_loops", text="Loops")
if psys:
row.prop(psys, "use_keyed_timing", text="Use Timing")
col.prop(psys, "use_keyed_timing", text="Use Timing")
col.label(text="Keys")
layout.label(text="Keys:")
elif part.physics_type == 'BOIDS':
boids = part.boids
@ -904,38 +889,47 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
part = particle_get_settings(context)
layout.prop(part, "render_type", text="Render As")
if part.type == 'EMITTER' or \
(part.render_type in {'OBJECT', 'GROUP'} and part.type == 'HAIR'):
if part.render_type not in {'NONE'}:
col = layout.column(align=True)
col.prop(part, "particle_size", text="Scale")
col.prop(part, "size_random", slider=True, text="Scale Randomness")
if psys:
row = layout.row()
if part.render_type in {'OBJECT', 'GROUP'}:
row.enabled = False
row.prop(part, "material_slot", text="")
row.prop(psys, "parent")
col = layout.column()
if part.render_type not in {'OBJECT', 'GROUP', 'NONE'}:
# col.enabled = False
col.prop(part, "material_slot", text="Material")
col.prop(psys, "parent", text="Coordinate System")
split = layout.split()
if part.render_type not in {'NONE'}:
col = layout.column()
col.prop(part, "use_parent_particles", text="Parent Particles")
col.prop(part, "show_unborn", text="Unborn")
col.prop(part, "use_dead", text="Dead")
col = split.column()
col.prop(part, "use_parent_particles")
col = split.column()
col.prop(part, "show_unborn")
col.prop(part, "use_dead")
layout.row().prop(part, "render_type", expand=True)
split = layout.split()
col = split.column()
col = layout.column()
if part.render_type == 'LINE':
col.prop(part, "line_length_tail")
col.prop(part, "line_length_head")
col.separator()
col.label(text="Line")
sub = col.column(align=True)
sub.prop(part, "line_length_tail", text="Length Tail")
sub.prop(part, "line_length_head", text="Head")
split.prop(part, "use_velocity_length")
col.prop(part, "use_velocity_length", text="Velocity Length")
elif part.render_type == 'PATH':
col.separator()
col.label(text="Path")
col.prop(part, "use_strand_primitive")
sub = col.column()
sub.active = (part.use_strand_primitive is False)
@ -949,8 +943,9 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
col.prop(part, "use_hair_bspline")
col.prop(part, "render_step", text="Steps")
col = split.column()
col.label(text="Timing:")
col.separator()
col.label(text="Timing")
col.prop(part, "use_absolute_path_time")
if part.type == 'HAIR' or psys.point_cache.is_baked:
@ -962,29 +957,31 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
col.prop(part, "length_random", text="Random", slider=True)
elif part.render_type == 'OBJECT':
col.prop(part, "dupli_object")
sub = col.row()
sub.prop(part, "use_global_dupli")
sub.prop(part, "use_rotation_dupli")
sub.prop(part, "use_scale_dupli")
elif part.render_type == 'GROUP':
col.prop(part, "dupli_group")
split = layout.split()
col.separator()
col.label(text="Object")
col.prop(part, "dupli_object", text="Instance Object")
sub = col.column()
sub.prop(part, "use_global_dupli", text="Global Coordinates")
sub.prop(part, "use_rotation_dupli", text="Object Rotation")
sub.prop(part, "use_scale_dupli", text="Object Scale")
elif part.render_type == 'GROUP':
col.separator()
col.label(text="Group")
col.prop(part, "dupli_group")
col = split.column()
col.prop(part, "use_whole_group")
sub = col.column()
sub.active = (part.use_whole_group is False)
sub.prop(part, "use_group_pick_random")
sub.prop(part, "use_global_dupli", text="Global Coordinates")
sub.prop(part, "use_rotation_dupli", text="Object Rotation")
sub.prop(part, "use_scale_dupli", text="Object Scale")
sub.prop(part, "use_group_count")
col = split.column()
sub = col.column()
sub.active = (part.use_whole_group is False)
sub.prop(part, "use_global_dupli")
sub.prop(part, "use_rotation_dupli")
sub.prop(part, "use_scale_dupli")
if part.use_group_count and not part.use_whole_group:
row = layout.row()
row.template_list("UI_UL_list", "particle_dupli_weights", part, "dupli_weights",
@ -1004,75 +1001,65 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
row.prop(weight, "count")
elif part.render_type == 'BILLBOARD':
ob = context.object
col.label(text="Align:")
col.separator()
row = layout.row()
row.prop(part, "billboard_align", expand=True)
row.prop(part, "lock_billboard", text="Lock")
row = layout.row()
row.prop(part, "billboard_object")
col.label(text="Alignment")
col.prop(part, "billboard_align", text="Align To")
col.prop(part, "lock_billboard", text="Lock Axis")
col.prop(part, "billboard_object")
row = layout.row()
col = row.column(align=True)
col.label(text="Tilt:")
col.prop(part, "billboard_tilt", text="Angle", slider=True)
col.prop(part, "billboard_tilt_random", text="Random", slider=True)
col = row.column()
col.prop(part, "billboard_offset")
col.separator()
col.label(text="Tilt")
row = layout.row()
col = row.column()
sub = col.column(align=True)
sub.prop(part, "billboard_tilt", text="Angle", slider=True)
sub.prop(part, "billboard_tilt_random", text="Random", slider=True)
sub = col.column(align=True)
sub.prop(part, "billboard_offset")
col.prop(part, "billboard_size", text="Scale")
if part.billboard_align == 'VEL':
col = row.column(align=True)
col.label("Velocity Scale:")
col.prop(part, "billboard_velocity_head", text="Head")
col = col.column(align=True)
col.prop(part, "billboard_velocity_head", text="Velocity ScaleHead")
col.prop(part, "billboard_velocity_tail", text="Tail")
col.separator()
col.label(text="UVs")
if psys:
col = layout.column()
col.prop_search(psys, "billboard_normal_uv", ob.data, "uv_layers")
col.prop_search(psys, "billboard_time_index_uv", ob.data, "uv_layers")
split = layout.split(percentage=0.33)
split.label(text="Split UVs:")
split.prop(part, "billboard_uv_split", text="Number of splits")
col.prop(part, "billboard_uv_split", text="Split UVs")
if psys:
col = layout.column()
col.active = part.billboard_uv_split > 1
col.prop_search(psys, "billboard_split_uv", ob.data, "uv_layers")
sub = col.column()
sub.active = part.billboard_uv_split > 1
sub.prop_search(psys, "billboard_split_uv", ob.data, "uv_layers")
row = col.row()
row.label(text="Animate:")
row.prop(part, "billboard_animation", text="")
row.label(text="Offset:")
row.prop(part, "billboard_offset_split", text="")
sub.prop(part, "billboard_animation")
sub.prop(part, "billboard_offset_split")
if part.render_type == 'HALO' or part.render_type == 'LINE' or part.render_type == 'BILLBOARD':
row = layout.row()
col = row.column()
col.prop(part, "trail_count")
if part.trail_count > 1:
col.prop(part, "use_absolute_path_time", text="Length in Frames")
col = row.column()
col.prop(part, "path_end", text="Length", slider=not part.use_absolute_path_time)
col.prop(part, "length_random", text="Random", slider=True)
else:
col = row.column()
col.label(text="")
if part.type == 'EMITTER' or \
(part.render_type in {'OBJECT', 'GROUP'} and part.type == 'HAIR'):
row = layout.row(align=True)
row.prop(part, "particle_size")
row.prop(part, "size_random", slider=True)
col.separator()
col.label(text="Trails")
col.prop(part, "trail_count")
sub = col.column()
sub.active = (part.trail_count > 1)
sub.prop(part, "use_absolute_path_time", text="Length in Frames")
sub.prop(part, "path_end", text="Length", slider=not part.use_absolute_path_time)
sub.prop(part, "length_random", text="Random Length", slider=True)
class PARTICLE_PT_draw(ParticleButtonsPanel, Panel):
bl_label = "Display"
bl_label = "Viewport Display"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
@ -1086,53 +1073,52 @@ class PARTICLE_PT_draw(ParticleButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
part = particle_get_settings(context)
row = layout.row()
row.prop(part, "draw_method", expand=True)
row.prop(part, "show_guide_hairs")
layout.prop(part, "draw_method", text="Display As")
if part.draw_method == 'NONE' or (part.render_type == 'NONE' and part.draw_method == 'RENDER'):
return
path = (part.render_type == 'PATH' and part.draw_method == 'RENDER') or part.draw_method == 'PATH'
row = layout.row()
row.prop(part, "draw_percentage", slider=True)
layout.separator()
col = layout.column()
col.prop(part, "draw_color", text="Color")
if part.draw_color in {'VELOCITY', 'ACCELERATION'}:
col.prop(part, "color_maximum", text="Fade Distance")
col = layout.column()
if path:
col.prop(part, "draw_step", text="Strand Steps")
col.prop(part, "draw_percentage", slider=True, text="Amount")
if part.draw_method != 'RENDER' or part.render_type == 'HALO':
row.prop(part, "draw_size")
else:
row.label(text="")
col.prop(part, "draw_size", text="Size")
if part.draw_percentage != 100 and psys is not None:
if part.type == 'HAIR':
if psys.use_hair_dynamics and psys.point_cache.is_baked is False:
layout.row().label(text="Display percentage makes dynamics inaccurate without baking!")
layout.row().label(text="Display percentage makes dynamics inaccurate without baking")
else:
phystype = part.physics_type
if phystype != 'NO' and phystype != 'KEYED' and psys.point_cache.is_baked is False:
layout.row().label(text="Display percentage makes dynamics inaccurate without baking!")
layout.row().label(text="Display percentage makes dynamics inaccurate without baking")
else:
layout.row().label(text="")
row = layout.row()
col = row.column()
col = layout.column()
col.prop(part, "show_guide_hairs", text="Guide Hairs")
col.prop(part, "show_size")
col.prop(part, "show_velocity")
col.prop(part, "show_number")
if part.physics_type == 'BOIDS':
col.prop(part, "show_health")
col = row.column(align=True)
col.label(text="Color:")
col.prop(part, "draw_color", text="")
sub = col.row(align=True)
sub.active = (part.draw_color in {'VELOCITY', 'ACCELERATION'})
sub.prop(part, "color_maximum", text="Max")
if path:
col.prop(part, "draw_step")
class PARTICLE_PT_children(ParticleButtonsPanel, Panel):
bl_label = "Children"
@ -1151,32 +1137,55 @@ class PARTICLE_PT_children(ParticleButtonsPanel, Panel):
layout.row().prop(part, "child_type", expand=True)
layout.use_property_split = True
if part.child_type == 'NONE':
return
row = layout.row()
col = layout.column()
col = row.column(align=True)
col.prop(part, "child_nbr", text="Display")
col.prop(part, "rendered_child_count", text="Render")
sub = col.column(align=True)
sub.prop(part, "child_nbr", text="Display Amount")
sub.prop(part, "rendered_child_count", text="Render Amount")
col.separator()
col.prop(part, "child_length", slider=True)
col.prop(part, "child_length_threshold", slider=True)
if psys:
col.prop(psys, "child_seed", text="Seed")
col.separator()
if part.child_type == 'INTERPOLATED':
col = row.column()
if psys:
col.prop(psys, "child_seed", text="Seed")
col.prop(part, "virtual_parents", slider=True)
col.prop(part, "create_long_hair_children")
else:
col = row.column(align=True)
col.prop(part, "child_size", text="Size")
col.prop(part, "child_size_random", text="Random")
col.separator()
sub = col.column(align=True)
sub.prop(part, "child_size", text="Size")
sub.prop(part, "child_size_random", text="Randomize Size", slider=True)
split = layout.split()
if part.child_type == 'SIMPLE':
col.separator()
col.prop(part, "child_radius", text="Radius")
col.prop(part, "child_roundness", text="Roundness", slider=True)
elif part.virtual_parents > 0.0:
sub = col.column(align=True)
sub.label(text="Parting not available with virtual parents")
else:
col.separator()
col.label(text="Parting")
sub = col.column(align=True)
sub.prop(part, "child_parting_factor", text="Parting", slider=True)
sub.prop(part, "child_parting_min", text="Min")
sub.prop(part, "child_parting_max", text="Max")
col = split.column()
col.label(text="Effects:")
col.separator()
sub = col.column(align=True)
col.label(text="Clumping")
sub = col.column()
if part.child_type == 'SIMPLE':
sub.prop(part, "twist")
sub.prop(part, "use_twist_curve")
@ -1195,28 +1204,7 @@ class PARTICLE_PT_children(ParticleButtonsPanel, Panel):
subsub.enabled = part.use_clump_noise
subsub.prop(part, "clump_noise_size")
sub = col.column(align=True)
sub.prop(part, "child_length", slider=True)
sub.prop(part, "child_length_threshold", slider=True)
if part.child_type == 'SIMPLE':
sub = col.column(align=True)
sub.prop(part, "child_radius", text="Radius")
sub.prop(part, "child_roundness", text="Roundness", slider=True)
if psys:
sub.prop(psys, "child_seed", text="Seed")
elif part.virtual_parents > 0.0:
sub = col.column(align=True)
sub.label(text="Parting not")
sub.label(text="available with")
sub.label(text="virtual parents")
else:
sub = col.column(align=True)
sub.prop(part, "child_parting_factor", text="Parting", slider=True)
sub.prop(part, "child_parting_min", text="Min")
sub.prop(part, "child_parting_max", text="Max")
col = split.column()
col.label(text="Roughness")
col.prop(part, "use_roughness_curve")
if part.use_roughness_curve:
@ -1225,8 +1213,6 @@ class PARTICLE_PT_children(ParticleButtonsPanel, Panel):
sub.prop(part, "roughness_1", text="Roughness")
sub.prop(part, "roughness_1_size", text="Size")
else:
col.label(text="Roughness:")
sub = col.column(align=True)
sub.prop(part, "roughness_1", text="Uniform")
sub.prop(part, "roughness_1_size", text="Size")
@ -1240,31 +1226,35 @@ class PARTICLE_PT_children(ParticleButtonsPanel, Panel):
sub.prop(part, "roughness_2_size", text="Size")
sub.prop(part, "roughness_2_threshold", slider=True)
layout.row().label(text="Kink:")
layout.row().prop(part, "kink", expand=True)
col.label(text="Kink")
split = layout.split()
split.active = part.kink != 'NO'
col.prop(part, "kink", text="Kink Type")
col = layout.column()
col.active = part.kink != 'NO'
if part.kink == 'SPIRAL':
col = split.column()
sub = col.column(align=True)
sub.prop(part, "kink_amplitude", text="Radius")
sub.prop(part, "kink_amplitude_random", text="Random", slider=True)
sub = col.column(align=True)
sub = col.column()
sub.prop(part, "kink_amplitude", text="Amplitude")
sub.prop(part, "kink_amplitude_random", text="Randomize Amplitude", slider=True)
col.separator()
sub = col.column()
sub.prop(part, "kink_axis")
sub.prop(part, "kink_axis_random", text="Random", slider=True)
col = split.column(align=True)
sub.prop(part, "kink_axis_random", text="Randomize Axis", slider=True)
col.separator()
col.prop(part, "kink_frequency", text="Frequency")
col.prop(part, "kink_shape", text="Shape", slider=True)
col.prop(part, "kink_extra_steps", text="Steps")
else:
col = split.column()
elif part.kink in {'CURL', 'RADIAL', 'WAVE', 'BRAID', 'WAVE'}:
sub = col.column(align=True)
sub.prop(part, "kink_amplitude")
sub.prop(part, "kink_amplitude_clump", text="Clump", slider=True)
col.prop(part, "kink_flat", slider=True)
col = split.column(align=True)
col.prop(part, "kink_frequency")
col.prop(part, "kink_shape", slider=True)
@ -1337,6 +1327,7 @@ class PARTICLE_PT_vertexgroups(ParticleButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
ob = context.object
psys = context.particle_system
@ -1441,21 +1432,20 @@ class PARTICLE_PT_hair_shape(ParticleButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
part = psys.settings
row = layout.row()
row.prop(part, "shape", text="Shape")
layout.prop(part, "shape", text="Strand Shape")
layout.label(text="Thickness:")
row = layout.row()
row.prop(part, "root_radius", text="Root")
row.prop(part, "tip_radius", text="Tip")
col = layout.column(align=True)
col.prop(part, "root_radius", text="Radius Root")
col.prop(part, "tip_radius", text="Tip")
row = layout.row()
row.prop(part, "radius_scale", text="Scaling")
row.prop(part, "use_close_tip")
col = layout.column()
col.prop(part, "radius_scale", text="Radius Scaling")
col.prop(part, "use_close_tip")
class PARTICLE_PT_custom_props(ParticleButtonsPanel, PropertyPanel, Panel):

View File

@ -750,6 +750,7 @@ class RENDER_PT_hair(RenderButtonsPanel, Panel):
row = layout.row()
row.prop(rd, "hair_type", expand=True)
layout.use_property_split = True
layout.prop(rd, "hair_subdiv")