|
|
|
|
@@ -19,6 +19,14 @@
|
|
|
|
|
# <pep8 compliant>
|
|
|
|
|
import bpy
|
|
|
|
|
from bpy.types import Menu, Panel
|
|
|
|
|
|
|
|
|
|
from bpy.types import (Brush,
|
|
|
|
|
Lamp,
|
|
|
|
|
Material,
|
|
|
|
|
ParticleSettings,
|
|
|
|
|
Texture,
|
|
|
|
|
World)
|
|
|
|
|
|
|
|
|
|
from rna_prop_ui import PropertyPanel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -91,7 +99,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel):
|
|
|
|
|
engine = context.scene.render.engine
|
|
|
|
|
if not (hasattr(context, "texture_slot") or hasattr(context, "texture_node")):
|
|
|
|
|
return False
|
|
|
|
|
return ((context.material or context.world or context.lamp or context.brush or context.texture or context.particle_system or isinstance(context.space_data.pin_id, bpy.types.ParticleSettings))
|
|
|
|
|
return ((context.material or context.world or context.lamp or context.brush or context.texture or context.particle_system or isinstance(context.space_data.pin_id, ParticleSettings))
|
|
|
|
|
and (engine in cls.COMPAT_ENGINES))
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
@@ -103,14 +111,14 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel):
|
|
|
|
|
idblock = context_tex_datablock(context)
|
|
|
|
|
pin_id = space.pin_id
|
|
|
|
|
|
|
|
|
|
if space.use_pin_id and not isinstance(pin_id, bpy.types.Texture):
|
|
|
|
|
if space.use_pin_id and not isinstance(pin_id, Texture):
|
|
|
|
|
idblock = pin_id
|
|
|
|
|
pin_id = None
|
|
|
|
|
|
|
|
|
|
if not space.use_pin_id:
|
|
|
|
|
layout.prop(space, "texture_context", expand=True)
|
|
|
|
|
|
|
|
|
|
tex_collection = (pin_id is None) and (node is None) and (not isinstance(idblock, bpy.types.Brush))
|
|
|
|
|
tex_collection = (pin_id is None) and (node is None) and (not isinstance(idblock, Brush))
|
|
|
|
|
|
|
|
|
|
if tex_collection:
|
|
|
|
|
row = layout.row()
|
|
|
|
|
@@ -413,7 +421,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, Panel):
|
|
|
|
|
col = split.column()
|
|
|
|
|
|
|
|
|
|
#Only for Material based textures, not for Lamp/World...
|
|
|
|
|
if slot and isinstance(idblock, bpy.types.Material):
|
|
|
|
|
if slot and isinstance(idblock, Material):
|
|
|
|
|
col.prop(tex, "use_normal_map")
|
|
|
|
|
row = col.row()
|
|
|
|
|
row.active = tex.use_normal_map
|
|
|
|
|
@@ -801,7 +809,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
idblock = context_tex_datablock(context)
|
|
|
|
|
if isinstance(idblock, bpy.types.Brush) and not context.sculpt_object:
|
|
|
|
|
if isinstance(idblock, Brush) and not context.sculpt_object:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
if not getattr(context, "texture_slot", None):
|
|
|
|
|
@@ -818,7 +826,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
|
|
|
|
|
tex = context.texture_slot
|
|
|
|
|
# textype = context.texture
|
|
|
|
|
|
|
|
|
|
if not isinstance(idblock, bpy.types.Brush):
|
|
|
|
|
if not isinstance(idblock, Brush):
|
|
|
|
|
split = layout.split(percentage=0.3)
|
|
|
|
|
col = split.column()
|
|
|
|
|
col.label(text="Coordinates:")
|
|
|
|
|
@@ -847,7 +855,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
|
|
|
|
|
split.label(text="Object:")
|
|
|
|
|
split.prop(tex, "object", text="")
|
|
|
|
|
|
|
|
|
|
if isinstance(idblock, bpy.types.Brush):
|
|
|
|
|
if isinstance(idblock, Brush):
|
|
|
|
|
if context.sculpt_object:
|
|
|
|
|
layout.label(text="Brush Mapping:")
|
|
|
|
|
layout.prop(tex, "map_mode", expand=True)
|
|
|
|
|
@@ -856,7 +864,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
|
|
|
|
|
row.active = tex.map_mode in {'FIXED', 'TILED'}
|
|
|
|
|
row.prop(tex, "angle")
|
|
|
|
|
else:
|
|
|
|
|
if isinstance(idblock, bpy.types.Material):
|
|
|
|
|
if isinstance(idblock, Material):
|
|
|
|
|
split = layout.split(percentage=0.3)
|
|
|
|
|
split.label(text="Projection:")
|
|
|
|
|
split.prop(tex, "mapping", text="")
|
|
|
|
|
@@ -889,7 +897,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
idblock = context_tex_datablock(context)
|
|
|
|
|
if isinstance(idblock, bpy.types.Brush):
|
|
|
|
|
if isinstance(idblock, Brush):
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
if not getattr(context, "texture_slot", None):
|
|
|
|
|
@@ -915,7 +923,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
|
|
|
|
|
sub.prop(tex, factor, text=name, slider=True)
|
|
|
|
|
return sub # XXX, temp. use_map_normal needs to override.
|
|
|
|
|
|
|
|
|
|
if isinstance(idblock, bpy.types.Material):
|
|
|
|
|
if isinstance(idblock, Material):
|
|
|
|
|
if idblock.type in {'SURFACE', 'WIRE'}:
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
|
|
@@ -978,7 +986,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
|
|
|
|
|
factor_but(col, "use_map_color_transmission", "transmission_color_factor", "Transmission Color")
|
|
|
|
|
factor_but(col, "use_map_color_reflection", "reflection_color_factor", "Reflection Color")
|
|
|
|
|
|
|
|
|
|
elif isinstance(idblock, bpy.types.Lamp):
|
|
|
|
|
elif isinstance(idblock, Lamp):
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
|
@@ -987,7 +995,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
|
|
|
|
|
col = split.column()
|
|
|
|
|
factor_but(col, "use_map_shadow", "shadow_factor", "Shadow")
|
|
|
|
|
|
|
|
|
|
elif isinstance(idblock, bpy.types.World):
|
|
|
|
|
elif isinstance(idblock, World):
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
|
@@ -997,7 +1005,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
|
|
|
|
|
col = split.column()
|
|
|
|
|
factor_but(col, "use_map_zenith_up", "zenith_up_factor", "Zenith Up")
|
|
|
|
|
factor_but(col, "use_map_zenith_down", "zenith_down_factor", "Zenith Down")
|
|
|
|
|
elif isinstance(idblock, bpy.types.ParticleSettings):
|
|
|
|
|
elif isinstance(idblock, ParticleSettings):
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
|
@@ -1028,7 +1036,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
|
|
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
|
|
if not isinstance(idblock, bpy.types.ParticleSettings):
|
|
|
|
|
if not isinstance(idblock, ParticleSettings):
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
|
@@ -1041,10 +1049,10 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
|
|
|
|
|
col.prop(tex, "invert", text="Negative")
|
|
|
|
|
col.prop(tex, "use_stencil")
|
|
|
|
|
|
|
|
|
|
if isinstance(idblock, bpy.types.Material) or isinstance(idblock, bpy.types.World):
|
|
|
|
|
if isinstance(idblock, Material) or isinstance(idblock, World):
|
|
|
|
|
col.prop(tex, "default_value", text="DVar", slider=True)
|
|
|
|
|
|
|
|
|
|
if isinstance(idblock, bpy.types.Material):
|
|
|
|
|
if isinstance(idblock, Material):
|
|
|
|
|
layout.label(text="Bump Mapping:")
|
|
|
|
|
|
|
|
|
|
# only show bump settings if activated but not for normal-map images
|
|
|
|
|
@@ -1063,7 +1071,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
|
|
|
|
|
class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, Panel):
|
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
|
|
|
|
_context_path = "texture"
|
|
|
|
|
_property_type = bpy.types.Texture
|
|
|
|
|
_property_type = Texture
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__": # only for live edit.
|
|
|
|
|
bpy.utils.register_module(__name__)
|
|
|
|
|
|