diff options
Diffstat (limited to 'release/scripts/ui/properties_texture.py')
-rw-r--r-- | release/scripts/ui/properties_texture.py | 178 |
1 files changed, 45 insertions, 133 deletions
diff --git a/release/scripts/ui/properties_texture.py b/release/scripts/ui/properties_texture.py index aeccbc71e46..32c572d849b 100644 --- a/release/scripts/ui/properties_texture.py +++ b/release/scripts/ui/properties_texture.py @@ -20,8 +20,6 @@ import bpy from rna_prop_ui import PropertyPanel -narrowui = bpy.context.user_preferences.view.properties_width_check - class TEXTURE_MT_specials(bpy.types.Menu): bl_label = "Texture Specials" @@ -112,7 +110,6 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel): node = context.texture_node space = context.space_data tex = context.texture - wide_ui = context.region.width > narrowui idblock = context_tex_datablock(context) tex_collection = space.pin_id == None and type(idblock) != bpy.types.Brush and not node @@ -126,11 +123,8 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel): col.operator("texture.slot_move", text="", icon='TRIA_DOWN').type = 'DOWN' col.menu("TEXTURE_MT_specials", icon='DOWNARROW_HLT', text="") - if wide_ui: - split = layout.split(percentage=0.65) - col = split.column() - else: - col = layout.column() + split = layout.split(percentage=0.65) + col = split.column() if tex_collection: col.template_ID(idblock, "active_texture", new="texture.new") @@ -142,8 +136,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel): if space.pin_id: col.template_ID(space, "pin_id") - if wide_ui: - col = split.column() + col = split.column() if not space.pin_id: col.prop(space, "brush_texture", text="Brush", toggle=True) @@ -158,11 +151,8 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel): split.prop(slot, "output_node", text="") else: - if wide_ui: - split.label(text="Type:") - split.prop(tex, "type", text="") - else: - layout.prop(tex, "type", text="") + split.label(text="Type:") + split.prop(tex, "type", text="") class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, bpy.types.Panel): @@ -189,7 +179,6 @@ class TEXTURE_PT_colors(TextureButtonsPanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui layout.prop(tex, "use_color_ramp", text="Ramp") if tex.use_color_ramp: @@ -204,8 +193,7 @@ class TEXTURE_PT_colors(TextureButtonsPanel, bpy.types.Panel): sub.prop(tex, "factor_green", text="G") sub.prop(tex, "factor_blue", text="B") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Adjust:") col.prop(tex, "brightness") col.prop(tex, "contrast") @@ -249,7 +237,6 @@ class TEXTURE_PT_mapping(TextureSlotPanel, bpy.types.Panel): tex = context.texture_slot # textype = context.texture - wide_ui = context.region.width > narrowui if type(idblock) != bpy.types.Brush: split = layout.split(percentage=0.3) @@ -301,11 +288,10 @@ class TEXTURE_PT_mapping(TextureSlotPanel, bpy.types.Panel): col.prop(tex, "from_dupli") elif tex.texture_coordinates == 'OBJECT': col.prop(tex, "from_original") - elif wide_ui: + else: col.label() - if wide_ui: - col = split.column() + col = split.column() row = col.row() row.prop(tex, "x_mapping", text="") row.prop(tex, "y_mapping", text="") @@ -316,10 +302,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, bpy.types.Panel): col = split.column() col.prop(tex, "offset") - if wide_ui: - col = split.column() - else: - col.separator() + col = split.column() col.prop(tex, "size") @@ -348,7 +331,6 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel): # textype = context.texture tex = context.texture_slot - wide_ui = context.region.width > narrowui def factor_but(layout, active, toggle, factor, name): row = layout.row(align=True) @@ -373,8 +355,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel): factor_but(col, tex.map_colorspec, "map_colorspec", "colorspec_factor", "Color") factor_but(col, tex.map_hardness, "map_hardness", "hardness_factor", "Hardness") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Shading:") factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient") factor_but(col, tex.map_emit, "map_emit", "emit_factor", "Emit") @@ -399,9 +380,8 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel): factor_but(col, tex.map_scattering, "map_scattering", "scattering_factor", "Scattering") factor_but(col, tex.map_reflection, "map_reflection", "reflection_factor", "Reflection") - if wide_ui: - col = split.column() - col.label(text=" ") + col = split.column() + col.label(text=" ") factor_but(col, tex.map_coloremission, "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") @@ -412,8 +392,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel): col = split.column() factor_but(col, tex.map_color, "map_color", "color_factor", "Color") - if wide_ui: - col = split.column() + col = split.column() factor_but(col, tex.map_shadow, "map_shadow", "shadow_factor", "Shadow") elif type(idblock) == bpy.types.World: @@ -423,8 +402,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel): factor_but(col, tex.map_blend, "map_blend", "blend_factor", "Blend") factor_but(col, tex.map_horizon, "map_horizon", "horizon_factor", "Horizon") - if wide_ui: - col = split.column() + 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") @@ -439,8 +417,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel): sub.active = tex.rgb_to_intensity sub.prop(tex, "color", text="") - if wide_ui: - col = split.column() + col = split.column() col.prop(tex, "negate", text="Negative") col.prop(tex, "stencil") @@ -469,15 +446,11 @@ class TEXTURE_PT_clouds(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui layout.prop(tex, "stype", expand=True) layout.label(text="Noise:") layout.prop(tex, "noise_type", text="Type", expand=True) - if wide_ui: - layout.prop(tex, "noise_basis", text="Basis") - else: - layout.prop(tex, "noise_basis", text="") + layout.prop(tex, "noise_basis", text="Basis") split = layout.split() @@ -485,8 +458,7 @@ class TEXTURE_PT_clouds(TextureTypePanel, bpy.types.Panel): col.prop(tex, "noise_size", text="Size") col.prop(tex, "noise_depth", text="Depth") - if wide_ui: - col = split.column() + col = split.column() col.prop(tex, "nabla", text="Nabla") @@ -505,22 +477,15 @@ class TEXTURE_PT_wood(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui layout.prop(tex, "noisebasis2", expand=True) - if wide_ui: - layout.prop(tex, "stype", expand=True) - else: - layout.prop(tex, "stype", text="") + layout.prop(tex, "stype", expand=True) col = layout.column() col.active = tex.stype in ('RINGNOISE', 'BANDNOISE') col.label(text="Noise:") col.row().prop(tex, "noise_type", text="Type", expand=True) - if wide_ui: - layout.prop(tex, "noise_basis", text="Basis") - else: - layout.prop(tex, "noise_basis", text="") + layout.prop(tex, "noise_basis", text="Basis") split = layout.split() split.active = tex.stype in ('RINGNOISE', 'BANDNOISE') @@ -548,16 +513,12 @@ class TEXTURE_PT_marble(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui layout.prop(tex, "stype", expand=True) layout.prop(tex, "noisebasis2", expand=True) layout.label(text="Noise:") layout.prop(tex, "noise_type", text="Type", expand=True) - if wide_ui: - layout.prop(tex, "noise_basis", text="Basis") - else: - layout.prop(tex, "noise_basis", text="") + layout.prop(tex, "noise_basis", text="Basis") split = layout.split() @@ -565,8 +526,7 @@ class TEXTURE_PT_marble(TextureTypePanel, bpy.types.Panel): col.prop(tex, "noise_size", text="Size") col.prop(tex, "noise_depth", text="Depth") - if wide_ui: - col = split.column() + col = split.column() col.prop(tex, "turbulence") col.prop(tex, "nabla") @@ -586,15 +546,13 @@ class TEXTURE_PT_magic(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui split = layout.split() col = split.column() col.prop(tex, "noise_depth", text="Depth") - if wide_ui: - col = split.column() + col = split.column() col.prop(tex, "turbulence") @@ -613,12 +571,8 @@ class TEXTURE_PT_blend(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(tex, "progression") - else: - layout.prop(tex, "progression", text="") + layout.prop(tex, "progression") sub = layout.row() @@ -641,23 +595,18 @@ class TEXTURE_PT_stucci(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui layout.prop(tex, "stype", expand=True) layout.label(text="Noise:") layout.prop(tex, "noise_type", text="Type", expand=True) - if wide_ui: - layout.prop(tex, "noise_basis", text="Basis") - else: - layout.prop(tex, "noise_basis", text="") + layout.prop(tex, "noise_basis", text="Basis") split = layout.split() col = split.column() col.prop(tex, "noise_size", text="Size") - if wide_ui: - col = split.column() + col = split.column() col.prop(tex, "turbulence") @@ -710,7 +659,6 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, bpy.types.Panel): tex = context.texture # slot = context.texture_slot - wide_ui = context.region.width > narrowui split = layout.split() @@ -722,10 +670,8 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, bpy.types.Panel): col.separator() col.prop(tex, "flip_axis", text="Flip X/Y Axis") - if wide_ui: - col = split.column() - else: - col.separator() + col = split.column() + col.prop(tex, "normal_map") row = col.row() row.active = tex.normal_map @@ -756,12 +702,8 @@ class TEXTURE_PT_image_mapping(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(tex, "extension") - else: - layout.prop(tex, "extension", text="") + layout.prop(tex, "extension") split = layout.split() @@ -771,8 +713,7 @@ class TEXTURE_PT_image_mapping(TextureTypePanel, bpy.types.Panel): col.prop(tex, "repeat_x", text="X") col.prop(tex, "repeat_y", text="Y") - if wide_ui: - col = split.column(align=True) + col = split.column(align=True) col.label(text="Mirror:") col.prop(tex, "mirror_x", text="X") col.prop(tex, "mirror_y", text="Y") @@ -784,8 +725,7 @@ class TEXTURE_PT_image_mapping(TextureTypePanel, bpy.types.Panel): row.prop(tex, "checker_even", text="Even") row.prop(tex, "checker_odd", text="Odd") - if wide_ui: - col = split.column() + col = split.column() col.prop(tex, "checker_distance", text="Distance") layout.separator() @@ -798,8 +738,7 @@ class TEXTURE_PT_image_mapping(TextureTypePanel, bpy.types.Panel): col.prop(tex, "crop_min_x", text="X") col.prop(tex, "crop_min_y", text="Y") - if wide_ui: - col = split.column(align=True) + col = split.column(align=True) col.label(text="Crop Maximum:") col.prop(tex, "crop_max_x", text="X") col.prop(tex, "crop_max_y", text="Y") @@ -841,7 +780,6 @@ class TEXTURE_PT_envmap(TextureTypePanel, bpy.types.Panel): tex = context.texture env = tex.environment_map - wide_ui = context.region.width > narrowui row = layout.row() row.prop(env, "source", expand=True) @@ -863,8 +801,7 @@ class TEXTURE_PT_envmap(TextureTypePanel, bpy.types.Panel): col.prop(env, "resolution") col.prop(env, "depth") - if wide_ui: - col = split.column(align=True) + col = split.column(align=True) col.label(text="Clipping:") col.prop(env, "clip_start", text="Start") @@ -906,12 +843,8 @@ class TEXTURE_PT_musgrave(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(tex, "musgrave_type") - else: - layout.prop(tex, "musgrave_type", text="") + layout.prop(tex, "musgrave_type") split = layout.split() @@ -920,8 +853,7 @@ class TEXTURE_PT_musgrave(TextureTypePanel, bpy.types.Panel): col.prop(tex, "lacunarity") col.prop(tex, "octaves") - if wide_ui: - col = split.column() + col = split.column() if (tex.musgrave_type in ('HETERO_TERRAIN', 'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')): col.prop(tex, "offset") if (tex.musgrave_type in ('RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')): @@ -930,18 +862,14 @@ class TEXTURE_PT_musgrave(TextureTypePanel, bpy.types.Panel): layout.label(text="Noise:") - if wide_ui: - layout.prop(tex, "noise_basis", text="Basis") - else: - layout.prop(tex, "noise_basis", text="") + layout.prop(tex, "noise_basis", text="Basis") split = layout.split() col = split.column() col.prop(tex, "noise_size", text="Size") - if wide_ui: - col = split.column() + col = split.column() col.prop(tex, "nabla") @@ -960,7 +888,6 @@ class TEXTURE_PT_voronoi(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui split = layout.split() @@ -974,8 +901,7 @@ class TEXTURE_PT_voronoi(TextureTypePanel, bpy.types.Panel): col.prop(tex, "coloring", text="") col.prop(tex, "noise_intensity", text="Intensity") - if wide_ui: - col = split.column() + col = split.column() sub = col.column(align=True) sub.label(text="Feature Weights:") sub.prop(tex, "weight_1", text="1", slider=True) @@ -990,8 +916,7 @@ class TEXTURE_PT_voronoi(TextureTypePanel, bpy.types.Panel): col = split.column() col.prop(tex, "noise_size", text="Size") - if wide_ui: - col = split.column() + col = split.column() col.prop(tex, "nabla") @@ -1010,14 +935,9 @@ class TEXTURE_PT_distortednoise(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(tex, "noise_distortion") - layout.prop(tex, "noise_basis", text="Basis") - else: - layout.prop(tex, "noise_distortion", text="") - layout.prop(tex, "noise_basis", text="") + layout.prop(tex, "noise_distortion") + layout.prop(tex, "noise_basis", text="Basis") split = layout.split() @@ -1025,8 +945,7 @@ class TEXTURE_PT_distortednoise(TextureTypePanel, bpy.types.Panel): col.prop(tex, "distortion", text="Distortion") col.prop(tex, "noise_size", text="Size") - if wide_ui: - col = split.column() + col = split.column() col.prop(tex, "nabla") @@ -1084,12 +1003,8 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel, bpy.types.Panel): tex = context.texture pd = tex.pointdensity - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(pd, "point_source", expand=True) - else: - layout.prop(pd, "point_source", text="") + layout.prop(pd, "point_source", expand=True) split = layout.split() @@ -1120,8 +1035,7 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel, bpy.types.Panel): if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_AGE'): layout.template_color_ramp(pd, "color_ramp", expand=True) - if wide_ui: - col = split.column() + col = split.column() col.label() col.prop(pd, "radius") col.label(text="Falloff:") @@ -1154,7 +1068,6 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel, bpy.types.Panel): tex = context.texture pd = tex.pointdensity layout.active = pd.turbulence - wide_ui = context.region.width > narrowui split = layout.split() @@ -1164,9 +1077,8 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel, bpy.types.Panel): col.label(text="Noise Basis:") col.prop(pd, "noise_basis", text="") - if wide_ui: - col = split.column() - col.label() + col = split.column() + col.label() col.prop(pd, "turbulence_size") col.prop(pd, "turbulence_depth") col.prop(pd, "turbulence_strength") |