Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/ui/properties_material.py')
-rw-r--r--release/scripts/ui/properties_material.py151
1 files changed, 44 insertions, 107 deletions
diff --git a/release/scripts/ui/properties_material.py b/release/scripts/ui/properties_material.py
index 32070dfbacf..6dfc3fc95a1 100644
--- a/release/scripts/ui/properties_material.py
+++ b/release/scripts/ui/properties_material.py
@@ -20,8 +20,6 @@
import bpy
from rna_prop_ui import PropertyPanel
-narrowui = bpy.context.user_preferences.view.properties_width_check
-
def active_node_mat(mat):
# TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
@@ -89,7 +87,6 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel, bpy.types.Panel):
ob = context.object
slot = context.material_slot
space = context.space_data
- wide_ui = context.region.width > narrowui
if ob:
row = layout.row()
@@ -108,33 +105,24 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel, bpy.types.Panel):
row.operator("object.material_slot_select", text="Select")
row.operator("object.material_slot_deselect", text="Deselect")
- if wide_ui:
- split = layout.split(percentage=0.65)
-
- if ob:
- split.template_ID(ob, "active_material", new="material.new")
- row = split.row()
- if mat:
- row.prop(mat, "use_nodes", icon="NODETREE", text="")
-
- if slot:
- row.prop(slot, "link", text="")
- else:
- row.label()
- elif mat:
- split.template_ID(space, "pin_id")
- split.separator()
- else:
- if ob:
- layout.template_ID(ob, "active_material", new="material.new")
- elif mat:
- layout.template_ID(space, "pin_id")
+ split = layout.split(percentage=0.65)
- if mat:
- if wide_ui:
- layout.prop(mat, "type", expand=True)
+ if ob:
+ split.template_ID(ob, "active_material", new="material.new")
+ row = split.row()
+ if mat:
+ row.prop(mat, "use_nodes", icon="NODETREE", text="")
+
+ if slot:
+ row.prop(slot, "link", text="")
else:
- layout.prop(mat, "type", text="")
+ row.label()
+ elif mat:
+ split.template_ID(space, "pin_id")
+ split.separator()
+
+ if mat:
+ layout.prop(mat, "type", expand=True)
class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel, bpy.types.Panel):
@@ -160,7 +148,6 @@ class MATERIAL_PT_shading(MaterialButtonsPanel, bpy.types.Panel):
layout = self.layout
mat = active_node_mat(context.material)
- wide_ui = context.region.width > narrowui
if mat.type in ('SURFACE', 'WIRE'):
split = layout.split()
@@ -173,8 +160,7 @@ class MATERIAL_PT_shading(MaterialButtonsPanel, bpy.types.Panel):
sub = col.column()
sub.prop(mat, "translucency")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.prop(mat, "shadeless")
sub = col.column()
sub.active = not mat.shadeless
@@ -201,7 +187,6 @@ class MATERIAL_PT_strand(MaterialButtonsPanel, bpy.types.Panel):
mat = context.material # dont use node material
tan = mat.strand
- wide_ui = context.region.width > narrowui
split = layout.split()
@@ -217,8 +202,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel, bpy.types.Panel):
sub.prop(tan, "tangent_shading")
col.prop(tan, "shape")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.label(text="Shading:")
col.prop(tan, "width_fade")
ob = context.object
@@ -247,7 +231,6 @@ class MATERIAL_PT_physics(MaterialButtonsPanel, bpy.types.Panel):
layout = self.layout
phys = context.material.physics # dont use node material
- wide_ui = context.region.width > narrowui
split = layout.split()
@@ -256,8 +239,7 @@ class MATERIAL_PT_physics(MaterialButtonsPanel, bpy.types.Panel):
col.prop(phys, "friction")
col.prop(phys, "align_to_normal")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.prop(phys, "force", slider=True)
col.prop(phys, "elasticity", slider=True)
col.prop(phys, "damp", slider=True)
@@ -277,7 +259,6 @@ class MATERIAL_PT_options(MaterialButtonsPanel, bpy.types.Panel):
layout = self.layout
mat = active_node_mat(context.material)
- wide_ui = context.region.width > narrowui
split = layout.split()
@@ -297,8 +278,7 @@ class MATERIAL_PT_options(MaterialButtonsPanel, bpy.types.Panel):
row.active = bool(mat.light_group)
row.prop(mat, "light_group_exclusive", text="Exclusive")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.prop(mat, "face_texture")
sub = col.column()
sub.active = mat.face_texture
@@ -324,7 +304,6 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel, bpy.types.Panel):
layout = self.layout
mat = active_node_mat(context.material)
- wide_ui = context.region.width > narrowui
split = layout.split()
@@ -335,8 +314,7 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel, bpy.types.Panel):
col.prop(mat, "cast_shadows_only", text="Cast Only")
col.prop(mat, "shadow_casting_alpha", text="Casting Alpha")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.prop(mat, "cast_buffer_shadows")
sub = col.column()
sub.active = mat.cast_buffer_shadows
@@ -361,7 +339,6 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel):
layout = self.layout
mat = active_node_mat(context.material)
- wide_ui = context.region.width > narrowui
split = layout.split()
@@ -371,8 +348,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel):
sub.active = (not mat.shadeless)
sub.prop(mat, "diffuse_intensity", text="Intensity")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.active = (not mat.shadeless)
col.prop(mat, "diffuse_shader", text="")
col.prop(mat, "use_diffuse_ramp", text="Ramp")
@@ -389,8 +365,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel):
col = split.column()
col.prop(mat, "diffuse_toon_size", text="Size")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.prop(mat, "diffuse_toon_smooth", text="Smooth")
elif mat.diffuse_shader == 'FRESNEL':
split = col.split()
@@ -398,8 +373,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel):
col = split.column()
col.prop(mat, "diffuse_fresnel", text="Fresnel")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.prop(mat, "diffuse_fresnel_factor", text="Factor")
if mat.use_diffuse_ramp:
@@ -412,8 +386,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel):
col = split.column()
col.prop(mat, "diffuse_ramp_input", text="Input")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.prop(mat, "diffuse_ramp_blend", text="Blend")
row = layout.row()
row.prop(mat, "diffuse_ramp_factor", text="Factor")
@@ -433,7 +406,6 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel):
layout = self.layout
mat = active_node_mat(context.material)
- wide_ui = context.region.width > narrowui
layout.active = (not mat.shadeless)
@@ -443,8 +415,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel):
col.prop(mat, "specular_color", text="")
col.prop(mat, "specular_intensity", text="Intensity")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.prop(mat, "specular_shader", text="")
col.prop(mat, "use_specular_ramp", text="Ramp")
@@ -457,8 +428,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel):
col = split.column()
col.prop(mat, "specular_hardness", text="Hardness")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.prop(mat, "specular_ior", text="IOR")
elif mat.specular_shader == 'WARDISO':
col.prop(mat, "specular_slope", text="Slope")
@@ -468,8 +438,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel):
col = split.column()
col.prop(mat, "specular_toon_size", text="Size")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.prop(mat, "specular_toon_smooth", text="Smooth")
if mat.use_specular_ramp:
@@ -481,8 +450,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel):
col = split.column()
col.prop(mat, "specular_ramp_input", text="Input")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.prop(mat, "specular_ramp_blend", text="Blend")
row = layout.row()
@@ -512,7 +480,6 @@ class MATERIAL_PT_sss(MaterialButtonsPanel, bpy.types.Panel):
mat = active_node_mat(context.material)
sss = mat.subsurface_scattering
- wide_ui = context.region.width > narrowui
layout.active = (sss.enabled) and (not mat.shadeless)
@@ -529,8 +496,7 @@ class MATERIAL_PT_sss(MaterialButtonsPanel, bpy.types.Panel):
col.prop(sss, "color", text="")
col.prop(sss, "radius", text="RGB Radius", expand=True)
- if wide_ui:
- col = split.column()
+ col = split.column()
sub = col.column(align=True)
sub.label(text="Blend:")
sub.prop(sss, "color_factor", text="Color")
@@ -563,7 +529,6 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel, bpy.types.Panel):
mat = active_node_mat(context.material)
raym = mat.raytrace_mirror
- wide_ui = context.region.width > narrowui
layout.active = raym.enabled
@@ -573,8 +538,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel, bpy.types.Panel):
col.prop(raym, "reflect_factor")
col.prop(mat, "mirror_color", text="")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.prop(raym, "fresnel")
sub = col.column()
sub.active = raym.fresnel > 0
@@ -592,8 +556,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel, bpy.types.Panel):
sub.label(text="Fade To:")
sub.prop(raym, "fade_to", text="")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.label(text="Gloss:")
col.prop(raym, "gloss_factor", text="Amount")
sub = col.column()
@@ -624,14 +587,10 @@ class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel):
mat = active_node_mat(context.material)
rayt = mat.raytrace_transparency
- wide_ui = context.region.width > narrowui
row = layout.row()
row.active = mat.transparency and (not mat.shadeless)
- if wide_ui:
- row.prop(mat, "transparency_method", expand=True)
- else:
- row.prop(mat, "transparency_method", text="")
+ row.prop(mat, "transparency_method", expand=True)
split = layout.split()
@@ -641,8 +600,7 @@ class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel):
row.active = mat.transparency and (not mat.shadeless)
row.prop(mat, "specular_alpha", text="Specular")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.active = (not mat.shadeless)
col.prop(rayt, "fresnel")
sub = col.column()
@@ -661,8 +619,7 @@ class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel):
col.prop(rayt, "limit")
col.prop(rayt, "depth")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.label(text="Gloss:")
col.prop(rayt, "gloss_factor", text="Amount")
sub = col.column()
@@ -692,14 +649,10 @@ class MATERIAL_PT_transp_game(MaterialButtonsPanel, bpy.types.Panel):
mat = active_node_mat(context.material)
rayt = mat.raytrace_transparency
- wide_ui = context.region.width > narrowui
row = layout.row()
row.active = mat.transparency and (not mat.shadeless)
- if wide_ui:
- row.prop(mat, "transparency_method", expand=True)
- else:
- row.prop(mat, "transparency_method", text="")
+ row.prop(mat, "transparency_method", expand=True)
split = layout.split()
@@ -722,7 +675,6 @@ class MATERIAL_PT_halo(MaterialButtonsPanel, bpy.types.Panel):
mat = context.material # dont use node material
halo = mat.halo
- wide_ui = context.region.width > narrowui
split = layout.split()
@@ -738,8 +690,7 @@ class MATERIAL_PT_halo(MaterialButtonsPanel, bpy.types.Panel):
col.prop(halo, "shaded")
col.prop(halo, "soft")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.prop(halo, "ring")
sub = col.column()
sub.active = halo.ring
@@ -778,7 +729,6 @@ class MATERIAL_PT_flare(MaterialButtonsPanel, bpy.types.Panel):
mat = context.material # dont use node material
halo = mat.halo
- wide_ui = context.region.width > narrowui
layout.active = halo.flare_mode
@@ -788,8 +738,8 @@ class MATERIAL_PT_flare(MaterialButtonsPanel, bpy.types.Panel):
col.prop(halo, "flare_size", text="Size")
col.prop(halo, "flare_boost", text="Boost")
col.prop(halo, "flare_seed", text="Seed")
- if wide_ui:
- col = split.column()
+
+ col = split.column()
col.prop(halo, "flares_sub", text="Subflares")
col.prop(halo, "flare_subsize", text="Subsize")
@@ -816,14 +766,12 @@ class MATERIAL_PT_volume_density(VolumeButtonsPanel, bpy.types.Panel):
layout = self.layout
vol = context.material.volume # dont use node material
- wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
col.prop(vol, "density")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.prop(vol, "density_scale")
@@ -836,7 +784,6 @@ class MATERIAL_PT_volume_shading(VolumeButtonsPanel, bpy.types.Panel):
layout = self.layout
vol = context.material.volume # dont use node material
- wide_ui = context.region.width > narrowui
split = layout.split()
@@ -845,8 +792,7 @@ class MATERIAL_PT_volume_shading(VolumeButtonsPanel, bpy.types.Panel):
col.prop(vol, "asymmetry")
col.prop(vol, "transmission_color")
- if wide_ui:
- col = split.column()
+ col = split.column()
sub = col.column(align=True)
sub.prop(vol, "emission")
sub.prop(vol, "emission_color", text="")
@@ -864,15 +810,13 @@ class MATERIAL_PT_volume_lighting(VolumeButtonsPanel, bpy.types.Panel):
layout = self.layout
vol = context.material.volume # dont use node material
- wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
col.prop(vol, "lighting_mode", text="")
- if wide_ui:
- col = split.column()
+ col = split.column()
if vol.lighting_mode == 'SHADED':
col.prop(vol, "external_shadows")
@@ -901,12 +845,8 @@ class MATERIAL_PT_volume_transp(VolumeButtonsPanel, bpy.types.Panel):
layout = self.layout
mat = context.material # dont use node material
- wide_ui = context.region.width > narrowui
- if wide_ui:
- layout.prop(mat, "transparency_method", expand=True)
- else:
- layout.prop(mat, "transparency_method", text="")
+ layout.prop(mat, "transparency_method", expand=True)
class MATERIAL_PT_volume_integration(VolumeButtonsPanel, bpy.types.Panel):
@@ -918,7 +858,6 @@ class MATERIAL_PT_volume_integration(VolumeButtonsPanel, bpy.types.Panel):
layout = self.layout
vol = context.material.volume # dont use node material
- wide_ui = context.region.width > narrowui
split = layout.split()
@@ -928,8 +867,7 @@ class MATERIAL_PT_volume_integration(VolumeButtonsPanel, bpy.types.Panel):
col = col.column(align=True)
col.prop(vol, "step_size")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.label()
col.prop(vol, "depth_cutoff")
@@ -943,7 +881,6 @@ class MATERIAL_PT_volume_options(VolumeButtonsPanel, bpy.types.Panel):
layout = self.layout
mat = active_node_mat(context.material)
- wide_ui = context.region.width > narrowui
split = layout.split()