Implemented single column UI for textures, curve, mesh and empty.

Reverted 24524 materials change because it it made greying out not work correctly.
This commit is contained in:
2009-11-12 15:41:44 +00:00
parent 17b6dfa499
commit fbb2c38485
5 changed files with 263 additions and 107 deletions

View File

@@ -19,6 +19,7 @@
# <pep8 compliant>
import bpy
narrowui = 180
def active_node_mat(mat):
if mat:
@@ -87,7 +88,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
layout = self.layout
tex = context.texture
col2 = context.region.width > narrowui
idblock = context_tex_datablock(context)
space = context.space_data
@@ -102,12 +103,16 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
col.item_enumO("texture.slot_move", "type", 'DOWN', text="", icon='ICON_TRIA_DOWN')
split = layout.split(percentage=0.65)
if idblock:
split.template_ID(idblock, "active_texture", new="texture.new")
elif tex:
split.template_ID(space, "pin_id")
if col2:
split = layout.split(percentage=0.65)
if idblock:
split.template_ID(idblock, "active_texture", new="texture.new")
elif tex:
split.template_ID(space, "pin_id")
else:
layout.template_ID(idblock, "active_texture", new="texture.new")
if (not space.pin_id) and (
context.sculpt_object or
@@ -130,8 +135,11 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
split.itemR(slot, "output_node", text="")
else:
split.itemL(text="Type:")
split.itemR(tex, "type", text="")
if col2:
split.itemL(text="Type:")
split.itemR(tex, "type", text="")
else:
layout.itemR(tex, "type", text="")
class TEXTURE_PT_colors(TextureButtonsPanel):
@@ -142,6 +150,7 @@ class TEXTURE_PT_colors(TextureButtonsPanel):
layout = self.layout
tex = context.texture
col2 = context.region.width > narrowui
layout.itemR(tex, "use_color_ramp", text="Ramp")
if tex.use_color_ramp:
@@ -156,7 +165,8 @@ class TEXTURE_PT_colors(TextureButtonsPanel):
sub.itemR(tex, "factor_green", text="G")
sub.itemR(tex, "factor_blue", text="B")
col = split.column()
if col2:
col = split.column()
col.itemL(text="Adjust:")
col.itemR(tex, "brightness")
col.itemR(tex, "contrast")
@@ -181,6 +191,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel):
tex = context.texture_slot
textype = context.texture
col2 = context.region.width > narrowui
if type(idblock) != bpy.types.Brush:
split = layout.split(percentage=0.3)
@@ -234,19 +245,25 @@ class TEXTURE_PT_mapping(TextureSlotPanel):
col.itemR(tex, "from_dupli")
elif tex.texture_coordinates == 'OBJECT':
col.itemR(tex, "from_original")
else:
elif col2:
col.itemL()
col = split.column()
if col2:
col = split.column()
row = col.row()
row.itemR(tex, "x_mapping", text="")
row.itemR(tex, "y_mapping", text="")
row.itemR(tex, "z_mapping", text="")
# any non brush
row = layout.row()
row.column().itemR(tex, "offset")
row.column().itemR(tex, "size")
split = layout.split()
col = split.column()
col.itemR(tex, "offset")
if col2:
col = split.column()
col.itemR(tex, "size")
class TEXTURE_PT_influence(TextureSlotPanel):
@@ -263,6 +280,7 @@ class TEXTURE_PT_influence(TextureSlotPanel):
textype = context.texture
tex = context.texture_slot
col2 = context.region.width > narrowui
def factor_but(layout, active, toggle, factor, name):
row = layout.row(align=True)
@@ -287,7 +305,8 @@ class TEXTURE_PT_influence(TextureSlotPanel):
factor_but(col, tex.map_colorspec, "map_colorspec", "colorspec_factor", "Color")
factor_but(col, tex.map_hardness, "map_hardness", "hardness_factor", "Hardness")
col = split.column()
if col2:
col = split.column()
col.itemL(text="Shading:")
factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient")
factor_but(col, tex.map_emit, "map_emit", "emit_factor", "Emit")
@@ -311,16 +330,22 @@ class TEXTURE_PT_influence(TextureSlotPanel):
factor_but(col, tex.map_scattering, "map_scattering", "scattering_factor", "Scattering")
factor_but(col, tex.map_reflection, "map_reflection", "reflection_factor", "Reflection")
col = split.column()
col.itemL(text=" ")
if col2:
col = split.column()
col.itemL(text=" ")
factor_but(col, tex.map_alpha, "map_coloremission", "coloremission_factor", "Emission Color")
factor_but(col, tex.map_colortransmission, "map_colortransmission", "colortransmission_factor", "Transmission Color")
factor_but(col, tex.map_colorreflection, "map_colorreflection", "colorreflection_factor", "Reflection Color")
elif type(idblock) == bpy.types.Lamp:
row = layout.row()
factor_but(row, tex.map_color, "map_color", "color_factor", "Color")
factor_but(row, tex.map_shadow, "map_shadow", "shadow_factor", "Shadow")
split = layout.split()
col = split.column()
factor_but(col, tex.map_color, "map_color", "color_factor", "Color")
if col2:
col = split.column()
factor_but(col, tex.map_shadow, "map_shadow", "shadow_factor", "Shadow")
elif type(idblock) == bpy.types.World:
split = layout.split()
@@ -329,7 +354,8 @@ class TEXTURE_PT_influence(TextureSlotPanel):
factor_but(col, tex.map_blend, "map_blend", "blend_factor", "Blend")
factor_but(col, tex.map_horizon, "map_horizon", "horizon_factor", "Horizon")
col = split.column()
if col2:
col = split.column()
factor_but(col, tex.map_zenith_up, "map_zenith_up", "zenith_up_factor", "Zenith Up")
factor_but(col, tex.map_zenith_down, "map_zenith_down", "zenith_down_factor", "Zenith Down")
@@ -344,7 +370,8 @@ class TEXTURE_PT_influence(TextureSlotPanel):
sub.active = tex.rgb_to_intensity
sub.itemR(tex, "color", text="")
col = split.column()
if col2:
col = split.column()
col.itemR(tex, "negate", text="Negative")
col.itemR(tex, "stencil")
@@ -369,16 +396,25 @@ class TEXTURE_PT_clouds(TextureTypePanel):
layout = self.layout
tex = context.texture
col2 = context.region.width > narrowui
layout.itemR(tex, "stype", expand=True)
layout.itemL(text="Noise:")
layout.itemR(tex, "noise_type", text="Type", expand=True)
layout.itemR(tex, "noise_basis", text="Basis")
if col2:
layout.itemR(tex, "noise_basis", text="Basis")
else:
layout.itemR(tex, "noise_basis", text="")
flow = layout.column_flow()
flow.itemR(tex, "noise_size", text="Size")
flow.itemR(tex, "noise_depth", text="Depth")
flow.itemR(tex, "nabla", text="Nabla")
split = layout.split()
col = split.column()
col.itemR(tex, "noise_size", text="Size")
col.itemR(tex, "noise_depth", text="Depth")
if col2:
col = split.column()
col.itemR(tex, "nabla", text="Nabla")
class TEXTURE_PT_wood(TextureTypePanel):
@@ -389,21 +425,32 @@ class TEXTURE_PT_wood(TextureTypePanel):
layout = self.layout
tex = context.texture
col2 = context.region.width > narrowui
layout.itemR(tex, "noisebasis2", expand=True)
layout.itemR(tex, "stype", expand=True)
if col2:
layout.itemR(tex, "stype", expand=True)
else:
layout.itemR(tex, "stype", text="")
col = layout.column()
col.active = tex.stype in ('RINGNOISE', 'BANDNOISE')
col.itemL(text="Noise:")
col.row().itemR(tex, "noise_type", text="Type", expand=True)
col.itemR(tex, "noise_basis", text="Basis")
if col2:
layout.itemR(tex, "noise_basis", text="Basis")
else:
layout.itemR(tex, "noise_basis", text="")
flow = layout.column_flow()
flow.active = tex.stype in ('RINGNOISE', 'BANDNOISE')
flow.itemR(tex, "noise_size", text="Size")
flow.itemR(tex, "turbulence")
flow.itemR(tex, "nabla")
split = layout.split()
split.active = tex.stype in ('RINGNOISE', 'BANDNOISE')
col = split.column()
col.itemR(tex, "noise_size", text="Size")
col.itemR(tex, "turbulence")
col = split.column()
col.itemR(tex, "nabla")
class TEXTURE_PT_marble(TextureTypePanel):
@@ -414,18 +461,27 @@ class TEXTURE_PT_marble(TextureTypePanel):
layout = self.layout
tex = context.texture
col2 = context.region.width > narrowui
layout.itemR(tex, "stype", expand=True)
layout.itemR(tex, "noisebasis2", expand=True)
layout.itemL(text="Noise:")
layout.itemR(tex, "noise_type", text="Type", expand=True)
layout.itemR(tex, "noise_basis", text="Basis")
if col2:
layout.itemR(tex, "noise_basis", text="Basis")
else:
layout.itemR(tex, "noise_basis", text="")
flow = layout.column_flow()
flow.itemR(tex, "noise_size", text="Size")
flow.itemR(tex, "noise_depth", text="Depth")
flow.itemR(tex, "turbulence")
flow.itemR(tex, "nabla")
split = layout.split()
col = split.column()
col.itemR(tex, "noise_size", text="Size")
col.itemR(tex, "noise_depth", text="Depth")
if col2:
col = split.column()
col.itemR(tex, "turbulence")
col.itemR(tex, "nabla")
class TEXTURE_PT_magic(TextureTypePanel):
@@ -436,10 +492,16 @@ class TEXTURE_PT_magic(TextureTypePanel):
layout = self.layout
tex = context.texture
col2 = context.region.width > narrowui
row = layout.row()
row.itemR(tex, "noise_depth", text="Depth")
row.itemR(tex, "turbulence")
split = layout.split()
col = split.column()
col.itemR(tex, "noise_depth", text="Depth")
if col2:
col = split.column()
col.itemR(tex, "turbulence")
class TEXTURE_PT_blend(TextureTypePanel):
@@ -450,8 +512,13 @@ class TEXTURE_PT_blend(TextureTypePanel):
layout = self.layout
tex = context.texture
col2 = context.region.width > narrowui
layout.itemR(tex, "progression")
if col2:
layout.itemR(tex, "progression")
else:
layout.itemR(tex, "progression", text="")
sub = layout.row()
sub.active = (tex.progression in ('LINEAR', 'QUADRATIC', 'EASING', 'RADIAL'))
@@ -466,15 +533,24 @@ class TEXTURE_PT_stucci(TextureTypePanel):
layout = self.layout
tex = context.texture
col2 = context.region.width > narrowui
layout.itemR(tex, "stype", expand=True)
layout.itemL(text="Noise:")
layout.itemR(tex, "noise_type", text="Type", expand=True)
layout.itemR(tex, "noise_basis", text="Basis")
if col2:
layout.itemR(tex, "noise_basis", text="Basis")
else:
layout.itemR(tex, "noise_basis", text="")
row = layout.row()
row.itemR(tex, "noise_size", text="Size")
row.itemR(tex, "turbulence")
split = layout.split()
col = split.column()
col.itemR(tex, "noise_size", text="Size")
if col2:
col = split.column()
col.itemR(tex, "turbulence")
class TEXTURE_PT_image(TextureTypePanel):
@@ -499,6 +575,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel):
tex = context.texture
slot = context.texture_slot
col2 = context.region.width > narrowui
split = layout.split()
@@ -507,11 +584,13 @@ class TEXTURE_PT_image_sampling(TextureTypePanel):
col.itemR(tex, "use_alpha", text="Use")
col.itemR(tex, "calculate_alpha", text="Calculate")
col.itemR(tex, "invert_alpha", text="Invert")
col.itemS()
col.itemR(tex, "flip_axis", text="Flip X/Y Axis")
col.itemL(text="Flip:")
col.itemR(tex, "flip_axis", text="X/Y Axis")
col = split.column()
if col2:
col = split.column()
else:
col.itemS()
col.itemR(tex, "normal_map")
row = col.row()
row.active = tex.normal_map
@@ -544,8 +623,12 @@ class TEXTURE_PT_image_mapping(TextureTypePanel):
layout = self.layout
tex = context.texture
col2 = context.region.width > narrowui
layout.itemR(tex, "extension")
if col2:
layout.itemR(tex, "extension")
else:
layout.itemR(tex, "extension", text="")
split = layout.split()
@@ -555,7 +638,8 @@ class TEXTURE_PT_image_mapping(TextureTypePanel):
col.itemR(tex, "repeat_x", text="X")
col.itemR(tex, "repeat_y", text="Y")
col = split.column(align=True)
if col2:
col = split.column(align=True)
col.itemL(text="Mirror:")
col.itemR(tex, "mirror_x", text="X")
col.itemR(tex, "mirror_y", text="Y")
@@ -566,8 +650,11 @@ class TEXTURE_PT_image_mapping(TextureTypePanel):
row = col.row()
row.itemR(tex, "checker_even", text="Even")
row.itemR(tex, "checker_odd", text="Odd")
split.itemR(tex, "checker_distance", text="Distance")
if col2:
col = split.column()
col.itemR(tex, "checker_distance", text="Distance")
layout.itemS()
split = layout.split()
@@ -578,7 +665,8 @@ class TEXTURE_PT_image_mapping(TextureTypePanel):
col.itemR(tex, "crop_min_x", text="X")
col.itemR(tex, "crop_min_y", text="Y")
col = split.column(align=True)
if col2:
col = split.column(align=True)
col.itemL(text="Crop Maximum:")
col.itemR(tex, "crop_max_x", text="X")
col.itemR(tex, "crop_max_y", text="Y")
@@ -616,8 +704,12 @@ class TEXTURE_PT_musgrave(TextureTypePanel):
layout = self.layout
tex = context.texture
col2 = context.region.width > narrowui
layout.itemR(tex, "musgrave_type")
if col2:
layout.itemR(tex, "musgrave_type")
else:
layout.itemR(tex, "musgrave_type", text="")
split = layout.split()
@@ -626,7 +718,8 @@ class TEXTURE_PT_musgrave(TextureTypePanel):
col.itemR(tex, "lacunarity")
col.itemR(tex, "octaves")
col = split.column()
if col2:
col = split.column()
if (tex.musgrave_type in ('HETERO_TERRAIN', 'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
col.itemR(tex, "offset")
if (tex.musgrave_type in ('RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
@@ -635,11 +728,19 @@ class TEXTURE_PT_musgrave(TextureTypePanel):
layout.itemL(text="Noise:")
layout.itemR(tex, "noise_basis", text="Basis")
if col2:
layout.itemR(tex, "noise_basis", text="Basis")
else:
layout.itemR(tex, "noise_basis", text="")
row = layout.row()
row.itemR(tex, "noise_size", text="Size")
row.itemR(tex, "nabla")
split = layout.split()
col = split.column()
col.itemR(tex, "noise_size", text="Size")
if col2:
col = split.column()
col.itemR(tex, "nabla")
class TEXTURE_PT_voronoi(TextureTypePanel):
@@ -650,6 +751,7 @@ class TEXTURE_PT_voronoi(TextureTypePanel):
layout = self.layout
tex = context.texture
col2 = context.region.width > narrowui
split = layout.split()
@@ -663,18 +765,25 @@ class TEXTURE_PT_voronoi(TextureTypePanel):
col.itemR(tex, "coloring", text="")
col.itemR(tex, "noise_intensity", text="Intensity")
col = split.column(align=True)
col.itemL(text="Feature Weights:")
col.itemR(tex, "weight_1", text="1", slider=True)
col.itemR(tex, "weight_2", text="2", slider=True)
col.itemR(tex, "weight_3", text="3", slider=True)
col.itemR(tex, "weight_4", text="4", slider=True)
if col2:
col = split.column()
sub = col.column(align=True)
sub.itemL(text="Feature Weights:")
sub.itemR(tex, "weight_1", text="1", slider=True)
sub.itemR(tex, "weight_2", text="2", slider=True)
sub.itemR(tex, "weight_3", text="3", slider=True)
sub.itemR(tex, "weight_4", text="4", slider=True)
layout.itemL(text="Noise:")
row = layout.row()
row.itemR(tex, "noise_size", text="Size")
row.itemR(tex, "nabla")
split = layout.split()
col = split.column()
col.itemR(tex, "noise_size", text="Size")
if col2:
col = split.column()
col.itemR(tex, "nabla")
class TEXTURE_PT_distortednoise(TextureTypePanel):
@@ -685,14 +794,24 @@ class TEXTURE_PT_distortednoise(TextureTypePanel):
layout = self.layout
tex = context.texture
col2 = context.region.width > narrowui
layout.itemR(tex, "noise_distortion")
layout.itemR(tex, "noise_basis", text="Basis")
if col2:
layout.itemR(tex, "noise_distortion")
layout.itemR(tex, "noise_basis", text="Basis")
else:
layout.itemR(tex, "noise_distortion", text="")
layout.itemR(tex, "noise_basis", text="")
flow = layout.column_flow()
flow.itemR(tex, "distortion", text="Distortion")
flow.itemR(tex, "noise_size", text="Size")
flow.itemR(tex, "nabla")
split = layout.split()
col = split.column()
col.itemR(tex, "distortion", text="Distortion")
col.itemR(tex, "noise_size", text="Size")
if col2:
col = split.column()
col.itemR(tex, "nabla")
class TEXTURE_PT_voxeldata(TextureButtonsPanel):
@@ -738,8 +857,12 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel):
tex = context.texture
pd = tex.pointdensity
col2 = context.region.width > narrowui
layout.itemR(pd, "point_source", expand=True)
if col2:
layout.itemR(pd, "point_source", expand=True)
else:
layout.itemR(pd, "point_source", text="")
split = layout.split()
@@ -770,7 +893,8 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel):
if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_AGE'):
layout.template_color_ramp(pd, "color_ramp", expand=True)
col = split.column()
if col2:
col = split.column()
col.itemL()
col.itemR(pd, "radius")
col.itemL(text="Falloff:")
@@ -791,7 +915,7 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel):
tex = context.texture
pd = tex.pointdensity
layout.itemR(pd, "turbulence", text="")
def draw(self, context):
@@ -800,6 +924,7 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel):
tex = context.texture
pd = tex.pointdensity
layout.active = pd.turbulence
col2 = context.region.width > narrowui
split = layout.split()
@@ -809,8 +934,9 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel):
col.itemL(text="Noise Basis:")
col.itemR(pd, "noise_basis", text="")
col = split.column()
col.itemL()
if col2:
col = split.column()
col.itemL()
col.itemR(pd, "turbulence_size")
col.itemR(pd, "turbulence_depth")
col.itemR(pd, "turbulence_strength")