[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54008] trunk/blender/release/scripts/ startup/bl_ui/properties_texture.py: Game Engine UI: Image Sampling Texture Panel cleanup

Dalai Felinto dfelinto at gmail.com
Tue Jan 22 19:42:16 CET 2013


Revision: 54008
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54008
Author:   dfelinto
Date:     2013-01-22 18:42:16 +0000 (Tue, 22 Jan 2013)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/properties_texture.py

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_texture.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_texture.py	2013-01-22 18:36:11 UTC (rev 54007)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_texture.py	2013-01-22 18:42:16 UTC (rev 54008)
@@ -432,6 +432,12 @@
     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,7 +474,34 @@
 
         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"
     bl_options = {'DEFAULT_CLOSED'}




More information about the Bf-blender-cvs mailing list