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/startup/bl_ui/properties_texture.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_texture.py75
1 files changed, 41 insertions, 34 deletions
diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py
index 01890bc3c99..34f5a948ee7 100644
--- a/release/scripts/startup/bl_ui/properties_texture.py
+++ b/release/scripts/startup/bl_ui/properties_texture.py
@@ -18,10 +18,11 @@
# <pep8 compliant>
import bpy
+from bpy.types import Menu, Panel
from rna_prop_ui import PropertyPanel
-class TEXTURE_MT_specials(bpy.types.Menu):
+class TEXTURE_MT_specials(Menu):
bl_label = "Texture Specials"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -32,7 +33,7 @@ class TEXTURE_MT_specials(bpy.types.Menu):
layout.operator("texture.slot_paste", icon='PASTEDOWN')
-class TEXTURE_MT_envmap_specials(bpy.types.Menu):
+class TEXTURE_MT_envmap_specials(Menu):
bl_label = "Environment Map Specials"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -80,7 +81,7 @@ class TextureButtonsPanel():
return tex and (tex.type != 'NONE' or tex.use_nodes) and (context.scene.render.engine in cls.COMPAT_ENGINES)
-class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
+class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel):
bl_label = ""
bl_options = {'HIDE_HEADER'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -88,15 +89,15 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
@classmethod
def poll(cls, context):
engine = context.scene.render.engine
- if not hasattr(context, "texture_slot"):
+ 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))
and (engine in cls.COMPAT_ENGINES))
def draw(self, context):
layout = self.layout
- slot = context.texture_slot
- node = context.texture_node
+ slot = getattr(context, "texture_slot", None)
+ node = getattr(context, "texture_node", None)
space = context.space_data
tex = context.texture
idblock = context_tex_datablock(context)
@@ -150,7 +151,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
split.prop(tex, "type", text="")
-class TEXTURE_PT_preview(TextureButtonsPanel, bpy.types.Panel):
+class TEXTURE_PT_preview(TextureButtonsPanel, Panel):
bl_label = "Preview"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -167,7 +168,7 @@ class TEXTURE_PT_preview(TextureButtonsPanel, bpy.types.Panel):
layout.template_preview(tex, slot=slot)
-class TEXTURE_PT_colors(TextureButtonsPanel, bpy.types.Panel):
+class TEXTURE_PT_colors(TextureButtonsPanel, Panel):
bl_label = "Colors"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -208,7 +209,7 @@ class TextureSlotPanel(TextureButtonsPanel):
return False
engine = context.scene.render.engine
- return TextureButtonsPanel.poll(self, context) and (engine in cls.COMPAT_ENGINES)
+ return TextureButtonsPanel.poll(cls, context) and (engine in cls.COMPAT_ENGINES)
# Texture Type Panels #
@@ -223,7 +224,7 @@ class TextureTypePanel(TextureButtonsPanel):
return tex and ((tex.type == cls.tex_type and not tex.use_nodes) and (engine in cls.COMPAT_ENGINES))
-class TEXTURE_PT_clouds(TextureTypePanel, bpy.types.Panel):
+class TEXTURE_PT_clouds(TextureTypePanel, Panel):
bl_label = "Clouds"
tex_type = 'CLOUDS'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -247,7 +248,7 @@ class TEXTURE_PT_clouds(TextureTypePanel, bpy.types.Panel):
split.prop(tex, "nabla", text="Nabla")
-class TEXTURE_PT_wood(TextureTypePanel, bpy.types.Panel):
+class TEXTURE_PT_wood(TextureTypePanel, Panel):
bl_label = "Wood"
tex_type = 'WOOD'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -276,7 +277,7 @@ class TEXTURE_PT_wood(TextureTypePanel, bpy.types.Panel):
split.prop(tex, "nabla")
-class TEXTURE_PT_marble(TextureTypePanel, bpy.types.Panel):
+class TEXTURE_PT_marble(TextureTypePanel, Panel):
bl_label = "Marble"
tex_type = 'MARBLE'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -303,7 +304,7 @@ class TEXTURE_PT_marble(TextureTypePanel, bpy.types.Panel):
col.prop(tex, "nabla")
-class TEXTURE_PT_magic(TextureTypePanel, bpy.types.Panel):
+class TEXTURE_PT_magic(TextureTypePanel, Panel):
bl_label = "Magic"
tex_type = 'MAGIC'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -318,7 +319,7 @@ class TEXTURE_PT_magic(TextureTypePanel, bpy.types.Panel):
row.prop(tex, "turbulence")
-class TEXTURE_PT_blend(TextureTypePanel, bpy.types.Panel):
+class TEXTURE_PT_blend(TextureTypePanel, Panel):
bl_label = "Blend"
tex_type = 'BLEND'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -336,7 +337,7 @@ class TEXTURE_PT_blend(TextureTypePanel, bpy.types.Panel):
sub.prop(tex, "use_flip_axis", expand=True)
-class TEXTURE_PT_stucci(TextureTypePanel, bpy.types.Panel):
+class TEXTURE_PT_stucci(TextureTypePanel, Panel):
bl_label = "Stucci"
tex_type = 'STUCCI'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -356,7 +357,7 @@ class TEXTURE_PT_stucci(TextureTypePanel, bpy.types.Panel):
row.prop(tex, "turbulence")
-class TEXTURE_PT_image(TextureTypePanel, bpy.types.Panel):
+class TEXTURE_PT_image(TextureTypePanel, Panel):
bl_label = "Image"
tex_type = 'IMAGE'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -382,7 +383,7 @@ def texture_filter_common(tex, layout):
layout.prop(tex, "use_filter_size_min")
-class TEXTURE_PT_image_sampling(TextureTypePanel, bpy.types.Panel):
+class TEXTURE_PT_image_sampling(TextureTypePanel, Panel):
bl_label = "Image Sampling"
bl_options = {'DEFAULT_CLOSED'}
tex_type = 'IMAGE'
@@ -393,7 +394,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, bpy.types.Panel):
idblock = context_tex_datablock(context)
tex = context.texture
- slot = context.texture_slot
+ slot = getattr(context, "texture_slot", None)
split = layout.split()
@@ -408,12 +409,16 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, bpy.types.Panel):
col = split.column()
#Only for Material based textures, not for Lamp/World...
- if isinstance(idblock, bpy.types.Material):
+ if slot and isinstance(idblock, bpy.types.Material):
col.prop(tex, "use_normal_map")
row = col.row()
row.active = tex.use_normal_map
row.prop(slot, "normal_map_space", text="")
+ row = col.row()
+ row.active = not tex.use_normal_map
+ row.prop(tex, "use_derivative_map")
+
col.prop(tex, "use_mipmap")
row = col.row()
row.active = tex.use_mipmap
@@ -423,7 +428,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, bpy.types.Panel):
texture_filter_common(tex, col)
-class TEXTURE_PT_image_mapping(TextureTypePanel, bpy.types.Panel):
+class TEXTURE_PT_image_mapping(TextureTypePanel, Panel):
bl_label = "Image Mapping"
bl_options = {'DEFAULT_CLOSED'}
tex_type = 'IMAGE'
@@ -479,7 +484,7 @@ class TEXTURE_PT_image_mapping(TextureTypePanel, bpy.types.Panel):
col.prop(tex, "crop_max_y", text="Y")
-class TEXTURE_PT_envmap(TextureTypePanel, bpy.types.Panel):
+class TEXTURE_PT_envmap(TextureTypePanel, Panel):
bl_label = "Environment Map"
tex_type = 'ENVIRONMENT_MAP'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -517,7 +522,7 @@ class TEXTURE_PT_envmap(TextureTypePanel, bpy.types.Panel):
col.prop(env, "clip_end", text="End")
-class TEXTURE_PT_envmap_sampling(TextureTypePanel, bpy.types.Panel):
+class TEXTURE_PT_envmap_sampling(TextureTypePanel, Panel):
bl_label = "Environment Map Sampling"
bl_options = {'DEFAULT_CLOSED'}
tex_type = 'ENVIRONMENT_MAP'
@@ -531,7 +536,7 @@ class TEXTURE_PT_envmap_sampling(TextureTypePanel, bpy.types.Panel):
texture_filter_common(tex, layout)
-class TEXTURE_PT_musgrave(TextureTypePanel, bpy.types.Panel):
+class TEXTURE_PT_musgrave(TextureTypePanel, Panel):
bl_label = "Musgrave"
tex_type = 'MUSGRAVE'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -568,7 +573,7 @@ class TEXTURE_PT_musgrave(TextureTypePanel, bpy.types.Panel):
row.prop(tex, "nabla")
-class TEXTURE_PT_voronoi(TextureTypePanel, bpy.types.Panel):
+class TEXTURE_PT_voronoi(TextureTypePanel, Panel):
bl_label = "Voronoi"
tex_type = 'VORONOI'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -604,7 +609,7 @@ class TEXTURE_PT_voronoi(TextureTypePanel, bpy.types.Panel):
row.prop(tex, "nabla")
-class TEXTURE_PT_distortednoise(TextureTypePanel, bpy.types.Panel):
+class TEXTURE_PT_distortednoise(TextureTypePanel, Panel):
bl_label = "Distorted Noise"
tex_type = 'DISTORTED_NOISE'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -626,7 +631,7 @@ class TEXTURE_PT_distortednoise(TextureTypePanel, bpy.types.Panel):
split.prop(tex, "nabla")
-class TEXTURE_PT_voxeldata(TextureButtonsPanel, bpy.types.Panel):
+class TEXTURE_PT_voxeldata(TextureButtonsPanel, Panel):
bl_label = "Voxel Data"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -666,7 +671,7 @@ class TEXTURE_PT_voxeldata(TextureButtonsPanel, bpy.types.Panel):
layout.prop(vd, "intensity")
-class TEXTURE_PT_pointdensity(TextureButtonsPanel, bpy.types.Panel):
+class TEXTURE_PT_pointdensity(TextureButtonsPanel, Panel):
bl_label = "Point Density"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -732,7 +737,7 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel, bpy.types.Panel):
col.template_curve_mapping(pd, "falloff_curve", brush=False)
-class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel, bpy.types.Panel):
+class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel, Panel):
bl_label = "Turbulence"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -769,7 +774,7 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel, bpy.types.Panel):
col.prop(pd, "turbulence_strength")
-class TEXTURE_PT_mapping(TextureSlotPanel, bpy.types.Panel):
+class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
bl_label = "Mapping"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -857,7 +862,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, bpy.types.Panel):
row.column().prop(tex, "scale")
-class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
+class TEXTURE_PT_influence(TextureSlotPanel, Panel):
bl_label = "Influence"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -1024,16 +1029,18 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
# only show bump settings if activated but not for normalmap images
row = layout.row()
- row.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and tex.texture.use_normal_map)
- row.prop(tex, "bump_method", text="Method")
+ sub = row.row()
+ sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and (tex.texture.use_normal_map or tex.texture.use_derivative_map))
+ sub.prop(tex, "bump_method", text="Method")
+ # the space setting is supported for: derivmaps + bumpmaps (DEFAULT,BEST_QUALITY), not for normalmaps
sub = row.row()
- sub.active = tex.bump_method in {'BUMP_DEFAULT', 'BUMP_BEST_QUALITY'}
+ sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and tex.texture.use_normal_map) and ((tex.bump_method in {'BUMP_DEFAULT', 'BUMP_BEST_QUALITY'}) or (tex.texture.type == 'IMAGE' and tex.texture.use_derivative_map))
sub.prop(tex, "bump_objectspace", text="Space")
-class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, bpy.types.Panel):
+class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
_context_path = "texture"
_property_type = bpy.types.Texture