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:
authorDaniel Genrich <daniel.genrich@gmx.net>2010-04-19 04:39:46 +0400
committerDaniel Genrich <daniel.genrich@gmx.net>2010-04-19 04:39:46 +0400
commit6bc2eb194989c871a132fc89d4b54b5bf741c4e0 (patch)
tree42c1bcf802c998192d86dc6f2389012a8b438864 /release/scripts
parent97d90fad43063f72a7c11da26f4f414bdacb3bfb (diff)
Python API fix: Make properties_texture compatible with COMPAT_ENGINES, also a little enhancement for data_mesh (thanks to Matt)
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/io/engine_render_pov.py8
-rw-r--r--release/scripts/io/netrender/client.py1
-rw-r--r--release/scripts/ui/properties_data_mesh.py1
-rw-r--r--release/scripts/ui/properties_texture.py58
4 files changed, 57 insertions, 11 deletions
diff --git a/release/scripts/io/engine_render_pov.py b/release/scripts/io/engine_render_pov.py
index 04d1ee8befa..8987891a4e0 100644
--- a/release/scripts/io/engine_render_pov.py
+++ b/release/scripts/io/engine_render_pov.py
@@ -888,6 +888,14 @@ for member in dir(properties_data_mesh):
except:
pass
del properties_data_mesh
+import properties_texture
+for member in dir(properties_texture):
+ subclass = getattr(properties_texture, member)
+ try:
+ subclass.COMPAT_ENGINES.add('POVRAY_RENDER')
+ except:
+ pass
+del properties_texture
class RenderButtonsPanel(bpy.types.Panel):
diff --git a/release/scripts/io/netrender/client.py b/release/scripts/io/netrender/client.py
index ac5825039be..23ff2fd3ab6 100644
--- a/release/scripts/io/netrender/client.py
+++ b/release/scripts/io/netrender/client.py
@@ -285,3 +285,4 @@ def compatible(module):
compatible("properties_world")
compatible("properties_material")
compatible("properties_data_mesh")
+compatible("properties_texture")
diff --git a/release/scripts/ui/properties_data_mesh.py b/release/scripts/ui/properties_data_mesh.py
index 12d8258245d..a33b4f22368 100644
--- a/release/scripts/ui/properties_data_mesh.py
+++ b/release/scripts/ui/properties_data_mesh.py
@@ -53,7 +53,6 @@ class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
- COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def poll(self, context):
engine = context.scene.render.engine
diff --git a/release/scripts/ui/properties_texture.py b/release/scripts/ui/properties_texture.py
index 1d35aafd8aa..23b5bedd346 100644
--- a/release/scripts/ui/properties_texture.py
+++ b/release/scripts/ui/properties_texture.py
@@ -25,6 +25,7 @@ narrowui = 180
class TEXTURE_MT_specials(bpy.types.Menu):
bl_label = "Texture Specials"
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -35,6 +36,7 @@ class TEXTURE_MT_specials(bpy.types.Menu):
class TEXTURE_MT_envmap_specials(bpy.types.Menu):
bl_label = "Environment Map Specials"
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -68,11 +70,13 @@ class TextureButtonsPanel(bpy.types.Panel):
def poll(self, context):
tex = context.texture
- return (tex and (tex.type != 'NONE' or tex.use_nodes))
+ engine = context.scene.render.engine
+ return (tex and (tex.type != 'NONE' or tex.use_nodes) and (engine in self.COMPAT_ENGINES))
class TEXTURE_PT_preview(TextureButtonsPanel):
bl_label = "Preview"
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -91,9 +95,11 @@ class TEXTURE_PT_preview(TextureButtonsPanel):
class TEXTURE_PT_context_texture(TextureButtonsPanel):
bl_label = ""
bl_show_header = False
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def poll(self, context):
- return (context.material or context.world or context.lamp or context.brush or context.texture)
+ engine = context.scene.render.engine
+ return ((context.material or context.world or context.lamp or context.brush or context.texture) and (engine in self.COMPAT_ENGINES))
def draw(self, context):
layout = self.layout
@@ -156,14 +162,17 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel):
_context_path = "texture"
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def poll(self, context): # use alternate poll since NONE texture type is ok
- return context.texture
+ engine = context.scene.render.engine
+ return context.texture and (engine in self.COMPAT_ENGINES)
class TEXTURE_PT_colors(TextureButtonsPanel):
bl_label = "Colors"
bl_default_closed = True
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -194,20 +203,24 @@ class TEXTURE_PT_colors(TextureButtonsPanel):
class TextureSlotPanel(TextureButtonsPanel):
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def poll(self, context):
+ engine = context.scene.render.engine
return (context.texture_slot and
- TextureButtonsPanel.poll(self, context))
+ TextureButtonsPanel.poll(self, context) and (engine in self.COMPAT_ENGINES))
class TEXTURE_PT_mapping(TextureSlotPanel):
bl_label = "Mapping"
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def poll(self, context):
idblock = context_tex_datablock(context)
if type(idblock) == bpy.types.Brush and not context.sculpt_object:
return False
- return context.texture_slot
+ engine = context.scene.render.engine
+ return context.texture_slot and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
@@ -294,13 +307,15 @@ class TEXTURE_PT_mapping(TextureSlotPanel):
class TEXTURE_PT_influence(TextureSlotPanel):
bl_label = "Influence"
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def poll(self, context):
idblock = context_tex_datablock(context)
if type(idblock) == bpy.types.Brush:
return False
- return context.texture_slot
+ engine = context.scene.render.engine
+ return context.texture_slot and (engine in self.COMPAT_ENGINES)
def draw(self, context):
@@ -412,15 +427,18 @@ class TEXTURE_PT_influence(TextureSlotPanel):
class TextureTypePanel(TextureButtonsPanel):
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def poll(self, context):
tex = context.texture
- return (tex and tex.type == self.tex_type and not tex.use_nodes)
+ engine = context.scene.render.engine
+ return ((tex and tex.type == self.tex_type and not tex.use_nodes) and (engine in self.COMPAT_ENGINES))
class TEXTURE_PT_clouds(TextureTypePanel):
bl_label = "Clouds"
tex_type = 'CLOUDS'
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -450,6 +468,7 @@ class TEXTURE_PT_clouds(TextureTypePanel):
class TEXTURE_PT_wood(TextureTypePanel):
bl_label = "Wood"
tex_type = 'WOOD'
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -486,6 +505,7 @@ class TEXTURE_PT_wood(TextureTypePanel):
class TEXTURE_PT_marble(TextureTypePanel):
bl_label = "Marble"
tex_type = 'MARBLE'
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -517,6 +537,7 @@ class TEXTURE_PT_marble(TextureTypePanel):
class TEXTURE_PT_magic(TextureTypePanel):
bl_label = "Magic"
tex_type = 'MAGIC'
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -537,6 +558,7 @@ class TEXTURE_PT_magic(TextureTypePanel):
class TEXTURE_PT_blend(TextureTypePanel):
bl_label = "Blend"
tex_type = 'BLEND'
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -558,6 +580,7 @@ class TEXTURE_PT_blend(TextureTypePanel):
class TEXTURE_PT_stucci(TextureTypePanel):
bl_label = "Stucci"
tex_type = 'STUCCI'
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -586,6 +609,7 @@ class TEXTURE_PT_stucci(TextureTypePanel):
class TEXTURE_PT_image(TextureTypePanel):
bl_label = "Image"
tex_type = 'IMAGE'
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -612,6 +636,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel):
bl_label = "Image Sampling"
bl_default_closed = True
tex_type = 'IMAGE'
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -652,6 +677,7 @@ class TEXTURE_PT_image_mapping(TextureTypePanel):
bl_label = "Image Mapping"
bl_default_closed = True
tex_type = 'IMAGE'
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -709,6 +735,7 @@ class TEXTURE_PT_image_mapping(TextureTypePanel):
class TEXTURE_PT_plugin(TextureTypePanel):
bl_label = "Plugin"
tex_type = 'PLUGIN'
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -721,6 +748,7 @@ class TEXTURE_PT_plugin(TextureTypePanel):
class TEXTURE_PT_envmap(TextureTypePanel):
bl_label = "Environment Map"
tex_type = 'ENVIRONMENT_MAP'
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -762,6 +790,7 @@ class TEXTURE_PT_envmap_sampling(TextureTypePanel):
bl_label = "Environment Map Sampling"
bl_default_closed = True
tex_type = 'ENVIRONMENT_MAP'
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -774,6 +803,7 @@ class TEXTURE_PT_envmap_sampling(TextureTypePanel):
class TEXTURE_PT_musgrave(TextureTypePanel):
bl_label = "Musgrave"
tex_type = 'MUSGRAVE'
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -821,6 +851,7 @@ class TEXTURE_PT_musgrave(TextureTypePanel):
class TEXTURE_PT_voronoi(TextureTypePanel):
bl_label = "Voronoi"
tex_type = 'VORONOI'
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -864,6 +895,7 @@ class TEXTURE_PT_voronoi(TextureTypePanel):
class TEXTURE_PT_distortednoise(TextureTypePanel):
bl_label = "Distorted Noise"
tex_type = 'DISTORTED_NOISE'
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
layout = self.layout
@@ -891,10 +923,12 @@ class TEXTURE_PT_distortednoise(TextureTypePanel):
class TEXTURE_PT_voxeldata(TextureButtonsPanel):
bl_label = "Voxel Data"
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def poll(self, context):
tex = context.texture
- return (tex and tex.type == 'VOXEL_DATA')
+ engine = context.scene.render.engine
+ return (tex and tex.type == 'VOXEL_DATA' and (engine in self.COMPAT_ENGINES))
def draw(self, context):
layout = self.layout
@@ -925,10 +959,12 @@ class TEXTURE_PT_voxeldata(TextureButtonsPanel):
class TEXTURE_PT_pointdensity(TextureButtonsPanel):
bl_label = "Point Density"
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def poll(self, context):
tex = context.texture
- return (tex and tex.type == 'POINT_DENSITY')
+ engine = context.scene.render.engine
+ return (tex and tex.type == 'POINT_DENSITY' and (engine in self.COMPAT_ENGINES))
def draw(self, context):
layout = self.layout
@@ -983,10 +1019,12 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel):
class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel):
bl_label = "Turbulence"
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def poll(self, context):
tex = context.texture
- return (tex and tex.type == 'POINT_DENSITY')
+ engine = context.scene.render.engine
+ return (tex and tex.type == 'POINT_DENSITY' and (engine in self.COMPAT_ENGINES))
def draw_header(self, context):
layout = self.layout