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:
authorDalai Felinto <dfelinto@gmail.com>2013-01-22 22:42:16 +0400
committerDalai Felinto <dfelinto@gmail.com>2013-01-22 22:42:16 +0400
commit13f890a26c59e2ce35cd5048e4d235c22fff8fa2 (patch)
tree15a13696295d83649737f30831d8a40f0d35cc0e /release
parent6740b4f73aacec65d5110a4773b55944ab022510 (diff)
Game Engine UI: Image Sampling Texture Panel cleanup
removing non-GE supported features. The idea of splitting the draw() function comes from Campbell Barton. Review from him as well. The main reason for not implement this in properties_games.py is to make sure the panel is in the same order for both BI and BGE engines.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/properties_texture.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py
index 6397ed4378e..9e8fd0470cf 100644
--- a/release/scripts/startup/bl_ui/properties_texture.py
+++ b/release/scripts/startup/bl_ui/properties_texture.py
@@ -432,6 +432,12 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
+ if context.scene.render.engine == 'BLENDER_GAME':
+ self.draw_bge(context)
+ else:
+ self.draw_bi(context)
+
+ def draw_bi(self, context):
layout = self.layout
idblock = context_tex_datablock(context)
@@ -468,6 +474,33 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, Panel):
texture_filter_common(tex, col)
+ def draw_bge(self, context):
+ layout = self.layout
+
+ idblock = context_tex_datablock(context)
+ tex = context.texture
+ slot = getattr(context, "texture_slot", None)
+
+ split = layout.split()
+
+ col = split.column()
+ col.label(text="Alpha:")
+ col.prop(tex, "use_calculate_alpha", text="Calculate")
+ col.prop(tex, "invert_alpha", text="Invert")
+
+ col = split.column()
+
+ #Only for Material based textures, not for Lamp/World...
+ if slot and isinstance(idblock, 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")
+
class TEXTURE_PT_image_mapping(TextureTypePanel, Panel):
bl_label = "Image Mapping"