bugfix [#24798] Texture panels are shown in wrong order
This commit is contained in:
@@ -138,6 +138,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
|
||||
split.prop(tex, "type", text="")
|
||||
|
||||
|
||||
|
||||
class TEXTURE_PT_preview(TextureButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Preview"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
@@ -199,216 +200,6 @@ class TextureSlotPanel(TextureButtonsPanel):
|
||||
return TextureButtonsPanel.poll(self, context) and (engine in cls.COMPAT_ENGINES)
|
||||
|
||||
|
||||
class TEXTURE_PT_mapping(TextureSlotPanel, bpy.types.Panel):
|
||||
bl_label = "Mapping"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
idblock = context_tex_datablock(context)
|
||||
if type(idblock) == bpy.types.Brush and not context.sculpt_object:
|
||||
return False
|
||||
|
||||
if not getattr(context, "texture_slot", None):
|
||||
return False
|
||||
|
||||
engine = context.scene.render.engine
|
||||
return (engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
idblock = context_tex_datablock(context)
|
||||
|
||||
tex = context.texture_slot
|
||||
# textype = context.texture
|
||||
|
||||
if type(idblock) != bpy.types.Brush:
|
||||
split = layout.split(percentage=0.3)
|
||||
col = split.column()
|
||||
col.label(text="Coordinates:")
|
||||
col = split.column()
|
||||
col.prop(tex, "texture_coords", text="")
|
||||
|
||||
if tex.texture_coords == 'ORCO':
|
||||
"""
|
||||
ob = context.object
|
||||
if ob and ob.type == 'MESH':
|
||||
split = layout.split(percentage=0.3)
|
||||
split.label(text="Mesh:")
|
||||
split.prop(ob.data, "texco_mesh", text="")
|
||||
"""
|
||||
elif tex.texture_coords == 'UV':
|
||||
split = layout.split(percentage=0.3)
|
||||
split.label(text="Layer:")
|
||||
ob = context.object
|
||||
if ob and ob.type == 'MESH':
|
||||
split.prop_search(tex, "uv_layer", ob.data, "uv_textures", text="")
|
||||
else:
|
||||
split.prop(tex, "uv_layer", text="")
|
||||
|
||||
elif tex.texture_coords == 'OBJECT':
|
||||
split = layout.split(percentage=0.3)
|
||||
split.label(text="Object:")
|
||||
split.prop(tex, "object", text="")
|
||||
|
||||
if type(idblock) == bpy.types.Brush:
|
||||
if context.sculpt_object:
|
||||
layout.label(text="Brush Mapping:")
|
||||
layout.prop(tex, "map_mode", expand=True)
|
||||
|
||||
row = layout.row()
|
||||
row.active = tex.map_mode in ('FIXED', 'TILED')
|
||||
row.prop(tex, "angle")
|
||||
else:
|
||||
if type(idblock) == bpy.types.Material:
|
||||
split = layout.split(percentage=0.3)
|
||||
split.label(text="Projection:")
|
||||
split.prop(tex, "mapping", text="")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
if tex.texture_coords in ('ORCO', 'UV'):
|
||||
col.prop(tex, "use_from_dupli")
|
||||
elif tex.texture_coords == 'OBJECT':
|
||||
col.prop(tex, "use_from_original")
|
||||
else:
|
||||
col.label()
|
||||
|
||||
col = split.column()
|
||||
row = col.row()
|
||||
row.prop(tex, "mapping_x", text="")
|
||||
row.prop(tex, "mapping_y", text="")
|
||||
row.prop(tex, "mapping_z", text="")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(tex, "offset")
|
||||
|
||||
col = split.column()
|
||||
|
||||
col.prop(tex, "scale")
|
||||
|
||||
|
||||
class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
|
||||
bl_label = "Influence"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
idblock = context_tex_datablock(context)
|
||||
if type(idblock) == bpy.types.Brush:
|
||||
return False
|
||||
|
||||
if not getattr(context, "texture_slot", None):
|
||||
return False
|
||||
|
||||
engine = context.scene.render.engine
|
||||
return (engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
|
||||
layout = self.layout
|
||||
|
||||
idblock = context_tex_datablock(context)
|
||||
|
||||
# textype = context.texture
|
||||
tex = context.texture_slot
|
||||
|
||||
def factor_but(layout, active, toggle, factor, name):
|
||||
row = layout.row(align=True)
|
||||
row.prop(tex, toggle, text="")
|
||||
sub = row.row()
|
||||
sub.active = active
|
||||
sub.prop(tex, factor, text=name, slider=True)
|
||||
|
||||
if type(idblock) == bpy.types.Material:
|
||||
if idblock.type in ('SURFACE', 'HALO', 'WIRE'):
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Diffuse:")
|
||||
factor_but(col, tex.use_map_diffuse, "use_map_diffuse", "diffuse_factor", "Intensity")
|
||||
factor_but(col, tex.use_map_color_diffuse, "use_map_color_diffuse", "diffuse_color_factor", "Color")
|
||||
factor_but(col, tex.use_map_alpha, "use_map_alpha", "alpha_factor", "Alpha")
|
||||
factor_but(col, tex.use_map_translucency, "use_map_translucency", "translucency_factor", "Translucency")
|
||||
|
||||
col.label(text="Specular:")
|
||||
factor_but(col, tex.use_map_specular, "use_map_specular", "specular_factor", "Intensity")
|
||||
factor_but(col, tex.use_map_color_spec, "use_map_color_spec", "specular_color_factor", "Color")
|
||||
factor_but(col, tex.use_map_hardness, "use_map_hardness", "hardness_factor", "Hardness")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Shading:")
|
||||
factor_but(col, tex.use_map_ambient, "use_map_ambient", "ambient_factor", "Ambient")
|
||||
factor_but(col, tex.use_map_emit, "use_map_emit", "emit_factor", "Emit")
|
||||
factor_but(col, tex.use_map_mirror, "use_map_mirror", "mirror_factor", "Mirror")
|
||||
factor_but(col, tex.use_map_raymir, "use_map_raymir", "raymir_factor", "Ray Mirror")
|
||||
|
||||
col.label(text="Geometry:")
|
||||
# XXX replace 'or' when displacement is fixed to not rely on normal influence value.
|
||||
factor_but(col, (tex.use_map_normal or tex.use_map_displacement), "use_map_normal", "normal_factor", "Normal")
|
||||
factor_but(col, tex.use_map_warp, "use_map_warp", "warp_factor", "Warp")
|
||||
factor_but(col, tex.use_map_displacement, "use_map_displacement", "displacement_factor", "Displace")
|
||||
|
||||
#sub = col.column()
|
||||
#sub.active = tex.use_map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror
|
||||
#sub.prop(tex, "default_value", text="Amount", slider=True)
|
||||
elif idblock.type == 'VOLUME':
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
factor_but(col, tex.use_map_density, "use_map_density", "density_factor", "Density")
|
||||
factor_but(col, tex.use_map_emission, "use_map_emission", "emission_factor", "Emission")
|
||||
factor_but(col, tex.use_map_scatter, "use_map_scatter", "scattering_factor", "Scattering")
|
||||
factor_but(col, tex.use_map_reflect, "use_map_reflect", "reflection_factor", "Reflection")
|
||||
|
||||
col = split.column()
|
||||
col.label(text=" ")
|
||||
factor_but(col, tex.use_map_color_emission, "use_map_color_emission", "emission_color_factor", "Emission Color")
|
||||
factor_but(col, tex.use_map_color_transmission, "use_map_color_transmission", "transmission_color_factor", "Transmission Color")
|
||||
factor_but(col, tex.use_map_color_reflection, "use_map_color_reflection", "reflection_color_factor", "Reflection Color")
|
||||
|
||||
elif type(idblock) == bpy.types.Lamp:
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
factor_but(col, tex.use_map_color, "map_color", "color_factor", "Color")
|
||||
|
||||
col = split.column()
|
||||
factor_but(col, tex.use_map_shadow, "map_shadow", "shadow_factor", "Shadow")
|
||||
|
||||
elif type(idblock) == bpy.types.World:
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
factor_but(col, tex.use_map_blend, "use_map_blend", "blend_factor", "Blend")
|
||||
factor_but(col, tex.use_map_horizon, "use_map_horizon", "horizon_factor", "Horizon")
|
||||
|
||||
col = split.column()
|
||||
factor_but(col, tex.use_map_zenith_up, "use_map_zenith_up", "zenith_up_factor", "Zenith Up")
|
||||
factor_but(col, tex.use_map_zenith_down, "use_map_zenith_down", "zenith_down_factor", "Zenith Down")
|
||||
|
||||
layout.separator()
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(tex, "blend_type", text="Blend")
|
||||
col.prop(tex, "use_rgb_to_intensity")
|
||||
sub = col.column()
|
||||
sub.active = tex.use_rgb_to_intensity
|
||||
sub.prop(tex, "color", text="")
|
||||
|
||||
col = split.column()
|
||||
col.prop(tex, "invert", text="Negative")
|
||||
col.prop(tex, "use_stencil")
|
||||
|
||||
if type(idblock) in (bpy.types.Material, bpy.types.World):
|
||||
col.prop(tex, "default_value", text="DVar", slider=True)
|
||||
|
||||
# Texture Type Panels #
|
||||
|
||||
|
||||
@@ -971,6 +762,217 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel, bpy.types.Panel):
|
||||
col.prop(pd, "turbulence_strength")
|
||||
|
||||
|
||||
class TEXTURE_PT_mapping(TextureSlotPanel, bpy.types.Panel):
|
||||
bl_label = "Mapping"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
idblock = context_tex_datablock(context)
|
||||
if type(idblock) == bpy.types.Brush and not context.sculpt_object:
|
||||
return False
|
||||
|
||||
if not getattr(context, "texture_slot", None):
|
||||
return False
|
||||
|
||||
engine = context.scene.render.engine
|
||||
return (engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
idblock = context_tex_datablock(context)
|
||||
|
||||
tex = context.texture_slot
|
||||
# textype = context.texture
|
||||
|
||||
if type(idblock) != bpy.types.Brush:
|
||||
split = layout.split(percentage=0.3)
|
||||
col = split.column()
|
||||
col.label(text="Coordinates:")
|
||||
col = split.column()
|
||||
col.prop(tex, "texture_coords", text="")
|
||||
|
||||
if tex.texture_coords == 'ORCO':
|
||||
"""
|
||||
ob = context.object
|
||||
if ob and ob.type == 'MESH':
|
||||
split = layout.split(percentage=0.3)
|
||||
split.label(text="Mesh:")
|
||||
split.prop(ob.data, "texco_mesh", text="")
|
||||
"""
|
||||
elif tex.texture_coords == 'UV':
|
||||
split = layout.split(percentage=0.3)
|
||||
split.label(text="Layer:")
|
||||
ob = context.object
|
||||
if ob and ob.type == 'MESH':
|
||||
split.prop_search(tex, "uv_layer", ob.data, "uv_textures", text="")
|
||||
else:
|
||||
split.prop(tex, "uv_layer", text="")
|
||||
|
||||
elif tex.texture_coords == 'OBJECT':
|
||||
split = layout.split(percentage=0.3)
|
||||
split.label(text="Object:")
|
||||
split.prop(tex, "object", text="")
|
||||
|
||||
if type(idblock) == bpy.types.Brush:
|
||||
if context.sculpt_object:
|
||||
layout.label(text="Brush Mapping:")
|
||||
layout.prop(tex, "map_mode", expand=True)
|
||||
|
||||
row = layout.row()
|
||||
row.active = tex.map_mode in ('FIXED', 'TILED')
|
||||
row.prop(tex, "angle")
|
||||
else:
|
||||
if type(idblock) == bpy.types.Material:
|
||||
split = layout.split(percentage=0.3)
|
||||
split.label(text="Projection:")
|
||||
split.prop(tex, "mapping", text="")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
if tex.texture_coords in ('ORCO', 'UV'):
|
||||
col.prop(tex, "use_from_dupli")
|
||||
elif tex.texture_coords == 'OBJECT':
|
||||
col.prop(tex, "use_from_original")
|
||||
else:
|
||||
col.label()
|
||||
|
||||
col = split.column()
|
||||
row = col.row()
|
||||
row.prop(tex, "mapping_x", text="")
|
||||
row.prop(tex, "mapping_y", text="")
|
||||
row.prop(tex, "mapping_z", text="")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(tex, "offset")
|
||||
|
||||
col = split.column()
|
||||
|
||||
col.prop(tex, "scale")
|
||||
|
||||
|
||||
class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
|
||||
bl_label = "Influence"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
idblock = context_tex_datablock(context)
|
||||
if type(idblock) == bpy.types.Brush:
|
||||
return False
|
||||
|
||||
if not getattr(context, "texture_slot", None):
|
||||
return False
|
||||
|
||||
engine = context.scene.render.engine
|
||||
return (engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
|
||||
layout = self.layout
|
||||
|
||||
idblock = context_tex_datablock(context)
|
||||
|
||||
# textype = context.texture
|
||||
tex = context.texture_slot
|
||||
|
||||
def factor_but(layout, active, toggle, factor, name):
|
||||
row = layout.row(align=True)
|
||||
row.prop(tex, toggle, text="")
|
||||
sub = row.row()
|
||||
sub.active = active
|
||||
sub.prop(tex, factor, text=name, slider=True)
|
||||
|
||||
if type(idblock) == bpy.types.Material:
|
||||
if idblock.type in ('SURFACE', 'HALO', 'WIRE'):
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Diffuse:")
|
||||
factor_but(col, tex.use_map_diffuse, "use_map_diffuse", "diffuse_factor", "Intensity")
|
||||
factor_but(col, tex.use_map_color_diffuse, "use_map_color_diffuse", "diffuse_color_factor", "Color")
|
||||
factor_but(col, tex.use_map_alpha, "use_map_alpha", "alpha_factor", "Alpha")
|
||||
factor_but(col, tex.use_map_translucency, "use_map_translucency", "translucency_factor", "Translucency")
|
||||
|
||||
col.label(text="Specular:")
|
||||
factor_but(col, tex.use_map_specular, "use_map_specular", "specular_factor", "Intensity")
|
||||
factor_but(col, tex.use_map_color_spec, "use_map_color_spec", "specular_color_factor", "Color")
|
||||
factor_but(col, tex.use_map_hardness, "use_map_hardness", "hardness_factor", "Hardness")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Shading:")
|
||||
factor_but(col, tex.use_map_ambient, "use_map_ambient", "ambient_factor", "Ambient")
|
||||
factor_but(col, tex.use_map_emit, "use_map_emit", "emit_factor", "Emit")
|
||||
factor_but(col, tex.use_map_mirror, "use_map_mirror", "mirror_factor", "Mirror")
|
||||
factor_but(col, tex.use_map_raymir, "use_map_raymir", "raymir_factor", "Ray Mirror")
|
||||
|
||||
col.label(text="Geometry:")
|
||||
# XXX replace 'or' when displacement is fixed to not rely on normal influence value.
|
||||
factor_but(col, (tex.use_map_normal or tex.use_map_displacement), "use_map_normal", "normal_factor", "Normal")
|
||||
factor_but(col, tex.use_map_warp, "use_map_warp", "warp_factor", "Warp")
|
||||
factor_but(col, tex.use_map_displacement, "use_map_displacement", "displacement_factor", "Displace")
|
||||
|
||||
#sub = col.column()
|
||||
#sub.active = tex.use_map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror
|
||||
#sub.prop(tex, "default_value", text="Amount", slider=True)
|
||||
elif idblock.type == 'VOLUME':
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
factor_but(col, tex.use_map_density, "use_map_density", "density_factor", "Density")
|
||||
factor_but(col, tex.use_map_emission, "use_map_emission", "emission_factor", "Emission")
|
||||
factor_but(col, tex.use_map_scatter, "use_map_scatter", "scattering_factor", "Scattering")
|
||||
factor_but(col, tex.use_map_reflect, "use_map_reflect", "reflection_factor", "Reflection")
|
||||
|
||||
col = split.column()
|
||||
col.label(text=" ")
|
||||
factor_but(col, tex.use_map_color_emission, "use_map_color_emission", "emission_color_factor", "Emission Color")
|
||||
factor_but(col, tex.use_map_color_transmission, "use_map_color_transmission", "transmission_color_factor", "Transmission Color")
|
||||
factor_but(col, tex.use_map_color_reflection, "use_map_color_reflection", "reflection_color_factor", "Reflection Color")
|
||||
|
||||
elif type(idblock) == bpy.types.Lamp:
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
factor_but(col, tex.use_map_color, "map_color", "color_factor", "Color")
|
||||
|
||||
col = split.column()
|
||||
factor_but(col, tex.use_map_shadow, "map_shadow", "shadow_factor", "Shadow")
|
||||
|
||||
elif type(idblock) == bpy.types.World:
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
factor_but(col, tex.use_map_blend, "use_map_blend", "blend_factor", "Blend")
|
||||
factor_but(col, tex.use_map_horizon, "use_map_horizon", "horizon_factor", "Horizon")
|
||||
|
||||
col = split.column()
|
||||
factor_but(col, tex.use_map_zenith_up, "use_map_zenith_up", "zenith_up_factor", "Zenith Up")
|
||||
factor_but(col, tex.use_map_zenith_down, "use_map_zenith_down", "zenith_down_factor", "Zenith Down")
|
||||
|
||||
layout.separator()
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(tex, "blend_type", text="Blend")
|
||||
col.prop(tex, "use_rgb_to_intensity")
|
||||
sub = col.column()
|
||||
sub.active = tex.use_rgb_to_intensity
|
||||
sub.prop(tex, "color", text="")
|
||||
|
||||
col = split.column()
|
||||
col.prop(tex, "invert", text="Negative")
|
||||
col.prop(tex, "use_stencil")
|
||||
|
||||
if type(idblock) in (bpy.types.Material, bpy.types.World):
|
||||
col.prop(tex, "default_value", text="DVar", slider=True)
|
||||
|
||||
|
||||
class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, bpy.types.Panel):
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
_context_path = "texture"
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user