[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35081] trunk/blender/release/scripts/ui/ properties_material.py: Material UI, patch by Ervin Weber (lusque).

Thomas Dinges blender at dingto.de
Tue Feb 22 20:22:28 CET 2011


Revision: 35081
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35081
Author:   dingto
Date:     2011-02-22 19:22:27 +0000 (Tue, 22 Feb 2011)
Log Message:
-----------
Material UI, patch by Ervin Weber (lusque). Thanks!
Now we have the old UI again, as suggested by several developers on the Mailing List. 
At least for simple materials. For Node Materials we keep the new Pipeline panel.

This should make both sides happy. :)

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/properties_material.py

Modified: trunk/blender/release/scripts/ui/properties_material.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_material.py	2011-02-22 17:19:02 UTC (rev 35080)
+++ trunk/blender/release/scripts/ui/properties_material.py	2011-02-22 19:22:27 UTC (rev 35081)
@@ -44,6 +44,12 @@
     return False
 
 
+def simple_material(mat):
+    if (mat is not None) and (not mat.use_nodes):
+        return True
+    return False
+
+
 class MATERIAL_MT_sss_presets(bpy.types.Menu):
     bl_label = "SSS Presets"
     preset_subdir = "sss"
@@ -155,13 +161,12 @@
     def poll(cls, context):
         mat = context.material
         engine = context.scene.render.engine
-        return mat and (mat.type in ('SURFACE', 'WIRE', 'VOLUME')) and (engine in cls.COMPAT_ENGINES)
+        return mat and (not simple_material(mat)) and (mat.type in ('SURFACE', 'WIRE', 'VOLUME')) and (engine in cls.COMPAT_ENGINES)
 
     def draw(self, context):
         layout = self. layout
 
         mat = context.material
-        #split = layout.split()
         mat_type = mat.type in ('SURFACE', 'WIRE')
 
         row = layout.row()
@@ -356,6 +361,12 @@
         mat = context.material
         engine = context.scene.render.engine
         return check_material(mat) and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES)
+    
+    def draw_header(self, context):
+        mat = context.material
+        
+        if simple_material(mat):
+            self.layout.prop(mat, "use_transparency", text="")
 
     def draw(self, context):
         layout = self.layout
@@ -363,9 +374,14 @@
         base_mat = context.material
         mat = active_node_mat(context.material)
         rayt = mat.raytrace_transparency
+        
+        if simple_material(base_mat):
+            row = layout.row()
+            row.active = mat.use_transparency
+            row.prop(mat, "transparency_method", expand=True)
 
         split = layout.split()
-
+        
         col = split.column()
         col.prop(mat, "alpha")
         row = col.row()
@@ -682,13 +698,23 @@
 
     def draw(self, context):
         layout = self.layout
+        
+        base_mat = context.material
+        mat = active_node_mat(base_mat)
 
-        mat = active_node_mat(context.material)
-
         split = layout.split()
 
         col = split.column()
+        if simple_material(base_mat):
+            col.prop(mat, "use_raytrace")
+            col.prop(mat, "use_full_oversampling")
+            col.prop(mat, "use_sky")
         col.prop(mat, "use_mist")
+        if simple_material(base_mat):
+            col.prop(mat, "invert_z")
+            sub = col.row()
+            sub.prop(mat, "offset_z")
+            sub.active = mat.use_transparency and mat.transparency_method == 'Z_TRANSPARENCY'
         sub = col.column(align=True)
         sub.label(text="Light Group:")
         sub.prop(mat, "light_group", text="")
@@ -720,17 +746,23 @@
 
     def draw(self, context):
         layout = self.layout
+        
+        base_mat = context.material
+        mat = active_node_mat(base_mat)
 
-        mat = active_node_mat(context.material)
-
         split = layout.split()
 
         col = split.column()
         col.prop(mat, "use_shadows", text="Receive")
         col.prop(mat, "use_transparent_shadows", text="Receive Transparent")
         col.prop(mat, "use_only_shadow", text="Shadows Only")
+        if simple_material(base_mat):
+            col.prop(mat, "use_cast_shadows_only", text="Cast Only")
+            col.prop(mat, "shadow_cast_alpha", text="Casting Alpha")
 
         col = split.column()
+        if simple_material(base_mat):
+            col.prop(mat, "use_cast_buffer_shadows")
         sub = col.column()
         sub.active = mat.use_cast_buffer_shadows
         sub.prop(mat, "shadow_buffer_bias", text="Buffer Bias")
@@ -738,6 +770,8 @@
         sub = col.column()
         sub.active = (not mat.use_ray_shadow_bias)
         sub.prop(mat, "shadow_ray_bias", text="Ray Bias")
+        if simple_material(base_mat):
+            col.prop(mat, "use_cast_approximate")
 
 
 class MATERIAL_PT_transp_game(MaterialButtonsPanel, bpy.types.Panel):
@@ -751,10 +785,22 @@
         engine = context.scene.render.engine
         return check_material(mat) and (engine in cls.COMPAT_ENGINES)
 
+    def draw_header(self, context):
+        mat = context.material
+
+        if simple_material(mat):
+            self.layout.prop(mat, "use_transparency", text="")
+
     def draw(self, context):
         layout = self.layout
+        base_mat = context.material
+        mat = active_node_mat(base_mat)
 
-        mat = active_node_mat(context.material)
+        if simple_material(base_mat):
+            row = layout.row()
+            row.active = mat.use_transparency
+            row.prop(mat, "transparency_method", expand=True)
+            
         layout.prop(mat, "alpha")
 
 
@@ -848,6 +894,24 @@
             sub.prop(vol, "ms_intensity")
 
 
+class MATERIAL_PT_volume_transp(VolumeButtonsPanel, bpy.types.Panel):
+    bl_label = "Transparency"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
+    
+    @classmethod
+    def poll(cls, context):
+        mat = context.material
+        engine = context.scene.render.engine
+        return mat and simple_material(mat) and (mat.type == 'VOLUME') and (engine in cls.COMPAT_ENGINES)
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = context.material  # dont use node material
+
+        layout.prop(mat, "transparency_method", expand=True)
+
+
 class MATERIAL_PT_volume_integration(VolumeButtonsPanel, bpy.types.Panel):
     bl_label = "Integration"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -889,6 +953,9 @@
         split = layout.split()
 
         col = split.column()
+        if simple_material(context.material):
+            col.prop(mat, "use_raytrace")
+            col.prop(mat, "use_full_oversampling")
         col.prop(mat, "use_mist")
 
         col = split.column()




More information about the Bf-blender-cvs mailing list