2.5 User Interface / UI Scripts
authorThomas Dinges <blender@dingto.org>
Thu, 12 Aug 2010 19:36:10 +0000 (19:36 +0000)
committerThomas Dinges <blender@dingto.org>
Thu, 12 Aug 2010 19:36:10 +0000 (19:36 +0000)
* Fixed some panel ordering after recent register changes.
* Placed "Custom Props" to the bottom again, where possible

This fixes [#23171] Material context is messed up.

12 files changed:
release/scripts/ui/properties_data_armature.py
release/scripts/ui/properties_data_bone.py
release/scripts/ui/properties_data_camera.py
release/scripts/ui/properties_data_curve.py
release/scripts/ui/properties_data_lamp.py
release/scripts/ui/properties_data_lattice.py
release/scripts/ui/properties_data_mesh.py
release/scripts/ui/properties_data_metaball.py
release/scripts/ui/properties_material.py
release/scripts/ui/properties_scene.py
release/scripts/ui/properties_texture.py
release/scripts/ui/properties_world.py

index 3d8f2cdc09285c6998a3ff9997cd4f5592ba05b7..29ef85e6c60c73e13a5dd485cae3f4a0865ffbf9 100644 (file)
@@ -51,11 +51,6 @@ class DATA_PT_context_arm(ArmatureButtonsPanel, bpy.types.Panel):
             split.separator()
 
 
-class DATA_PT_custom_props_arm(ArmatureButtonsPanel, PropertyPanel, bpy.types.Panel):
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-    _context_path = "object.data"
-
-
 class DATA_PT_skeleton(ArmatureButtonsPanel, bpy.types.Panel):
     bl_label = "Skeleton"
 
@@ -285,6 +280,11 @@ class DATA_PT_onion_skinning(OnionSkinButtonsPanel): #, bpy.types.Panel): # inhe
 
         self.draw_settings(context, ob.pose.animation_visualisation, bones=True)
 
+
+class DATA_PT_custom_props_arm(ArmatureButtonsPanel, PropertyPanel, bpy.types.Panel):
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+    _context_path = "object.data"
+
 def register():
     pass
 
index 1296ccd7e7063df6de9ca27e8ffc69b5441f7e6c..973cb115a2fee9d9a0d694a1a742705c2d3fd153 100644 (file)
@@ -47,18 +47,6 @@ class BONE_PT_context_bone(BoneButtonsPanel, bpy.types.Panel):
         row.prop(bone, "name", text="")
 
 
-class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel, bpy.types.Panel):
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-
-    @property
-    def _context_path(self):
-        obj = bpy.context.object
-        if obj and obj.mode == 'POSE':
-            return "active_pose_bone"
-        else:
-            return "active_bone"
-
-
 class BONE_PT_transform(BoneButtonsPanel, bpy.types.Panel):
     bl_label = "Transform"
 
@@ -354,6 +342,18 @@ class BONE_PT_deform(BoneButtonsPanel, bpy.types.Panel):
         col.prop(bone, "cyclic_offset")
 
 
+class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel, bpy.types.Panel):
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+
+    @property
+    def _context_path(self):
+        obj = bpy.context.object
+        if obj and obj.mode == 'POSE':
+            return "active_pose_bone"
+        else:
+            return "active_bone"
+
+
 def register():
     pass
 
index cda2b79c909e7621b9cbf71b7360ab7acdec2800..a1d468709d87c36c076bfd0a5d3b53145dc01752 100644 (file)
@@ -53,11 +53,6 @@ class DATA_PT_context_camera(CameraButtonsPanel, bpy.types.Panel):
             split.separator()
 
 
-class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, bpy.types.Panel):
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-    _context_path = "object.data"
-
-
 class DATA_PT_camera(CameraButtonsPanel, bpy.types.Panel):
     bl_label = "Lens"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -137,6 +132,11 @@ class DATA_PT_camera_display(CameraButtonsPanel, bpy.types.Panel):
         sub.prop(cam, "passepartout_alpha", text="Alpha", slider=True)
 
 
+class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, bpy.types.Panel):
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+    _context_path = "object.data"
+
+
 def register():
     pass
 
index 1262f6739b736476fa93ec93ee58c3488f215517..1292a2a3d8daac5dede1bf43f38547529d4bcba0 100644 (file)
@@ -69,11 +69,6 @@ class DATA_PT_context_curve(CurveButtonsPanel, bpy.types.Panel):
             split.separator()
 
 
-class DATA_PT_custom_props_curve(CurveButtonsPanel, PropertyPanel, bpy.types.Panel):
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-    _context_path = "object.data"
-
-
 class DATA_PT_shape_curve(CurveButtonsPanel, bpy.types.Panel):
     bl_label = "Shape"
 
@@ -385,6 +380,11 @@ class DATA_PT_textboxes(CurveButtonsPanel, bpy.types.Panel):
             row.operator("font.textbox_remove", text='', icon='X', emboss=False).index = i
 
 
+class DATA_PT_custom_props_curve(CurveButtonsPanel, PropertyPanel, bpy.types.Panel):
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+    _context_path = "object.data"
+
+
 def register():
     pass
 
index 9a58622974e1dc8e470b8031a6f50f2a8e580508..91ccce3b0114ea748520b7bdbdd1078edcdff1c0 100644 (file)
@@ -40,13 +40,6 @@ class DataButtonsPanel():
         return context.lamp and (engine in cls.COMPAT_ENGINES)
 
 
-class DATA_PT_preview(DataButtonsPanel, bpy.types.Panel):
-    bl_label = "Preview"
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-
-    def draw(self, context):
-        self.layout.template_preview(context.lamp)
-
 class DATA_PT_context_lamp(DataButtonsPanel, bpy.types.Panel):
     bl_label = ""
     bl_show_header = False
@@ -69,9 +62,12 @@ class DATA_PT_context_lamp(DataButtonsPanel, bpy.types.Panel):
             split.separator()
 
 
-class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
+class DATA_PT_preview(DataButtonsPanel, bpy.types.Panel):
+    bl_label = "Preview"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-    _context_path = "object.data"
+
+    def draw(self, context):
+        self.layout.template_preview(context.lamp)
 
 
 class DATA_PT_lamp(DataButtonsPanel, bpy.types.Panel):
@@ -387,6 +383,11 @@ class DATA_PT_falloff_curve(DataButtonsPanel, bpy.types.Panel):
         self.layout.template_curve_mapping(lamp, "falloff_curve")
 
 
+class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+    _context_path = "object.data"
+
+
 def register():
     pass
 
index 5e313b79d85778fbcd672d66db1a772f6a5aeaf8..0ae3e03aebe459bd189b3e0f6dd4834d13d8d68a 100644 (file)
@@ -51,11 +51,6 @@ class DATA_PT_context_lattice(DataButtonsPanel, bpy.types.Panel):
             split.separator()
 
 
-class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-    _context_path = "object.data"
-
-
 class DATA_PT_lattice(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Lattice"
 
@@ -85,6 +80,11 @@ class DATA_PT_lattice(DataButtonsPanel, bpy.types.Panel):
         row = layout.row()
         row.prop(lat, "outside")
         row.prop_object(lat, "vertex_group", context.object, "vertex_groups", text="")
+
+class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+    _context_path = "object.data"
 
 
 def register():
index 1be2ce824fa74830928263a2d7cedf9ccc0482f1..7a5f7e3f3ff4a989d85cdca4e7f83ac28d88ed46 100644 (file)
@@ -79,11 +79,6 @@ class DATA_PT_context_mesh(MeshButtonsPanel, bpy.types.Panel):
             split.separator()
 
 
-class DATA_PT_custom_props_mesh(MeshButtonsPanel, PropertyPanel, bpy.types.Panel):
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-    _context_path = "object.data"
-
-
 class DATA_PT_normals(MeshButtonsPanel, bpy.types.Panel):
     bl_label = "Normals"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -351,6 +346,11 @@ class DATA_PT_vertex_colors(MeshButtonsPanel, bpy.types.Panel):
             layout.prop(lay, "name")
 
 
+class DATA_PT_custom_props_mesh(MeshButtonsPanel, PropertyPanel, bpy.types.Panel):
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+    _context_path = "object.data"
+
+
 def register():
     pass
 
index a6b1bb75cbe8bbe8adfd0e85aa1b98eeb0f46ac0..4a811bafad5e94a7089734ae235f5ba9c3a283ae 100644 (file)
@@ -51,11 +51,6 @@ class DATA_PT_context_metaball(DataButtonsPanel, bpy.types.Panel):
             split.separator()
 
 
-class DATA_PT_custom_props_metaball(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-    _context_path = "object.data"
-
-
 class DATA_PT_metaball(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Metaball"
 
@@ -120,6 +115,11 @@ class DATA_PT_metaball_element(DataButtonsPanel, bpy.types.Panel):
             col.prop(metaelem, "size_y", text="Y")
 
 
+class DATA_PT_custom_props_metaball(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+    _context_path = "object.data"
+
+
 def register():
     pass
 
index 5034f4f40ae3abb1692e0463f8763bceca3d0d34..3a30edc150fcfc1fcd5653b8a5ec1f7a23dea947 100644 (file)
@@ -63,14 +63,6 @@ class MaterialButtonsPanel():
         return context.material and (context.scene.render.engine in cls.COMPAT_ENGINES)
 
 
-class MATERIAL_PT_preview(MaterialButtonsPanel, bpy.types.Panel):
-    bl_label = "Preview"
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-
-    def draw(self, context):
-        self.layout.template_preview(context.material)
-
-
 class MATERIAL_PT_context_material(MaterialButtonsPanel, bpy.types.Panel):
     bl_label = ""
     bl_show_header = False
@@ -127,203 +119,15 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel, bpy.types.Panel):
 
         if mat:
             layout.prop(mat, "type", expand=True)
+            
 
-
-class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel, bpy.types.Panel):
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-    _context_path = "material"
-
-
-class MATERIAL_PT_shading(MaterialButtonsPanel, bpy.types.Panel):
-    bl_label = "Shading"
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-
-    @classmethod
-    def poll(cls, context):
-        mat = active_node_mat(context.material)
-        engine = context.scene.render.engine
-        return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in cls.COMPAT_ENGINES)
-
-    def draw(self, context):
-        layout = self.layout
-
-        mat = active_node_mat(context.material)
-
-        if mat.type in ('SURFACE', 'WIRE'):
-            split = layout.split()
-
-            col = split.column()
-            sub = col.column()
-            sub.active = not mat.shadeless
-            sub.prop(mat, "emit")
-            sub.prop(mat, "ambient")
-            sub = col.column()
-            sub.prop(mat, "translucency")
-
-            col = split.column()
-            col.prop(mat, "shadeless")
-            sub = col.column()
-            sub.active = not mat.shadeless
-            sub.prop(mat, "tangent_shading")
-            sub.prop(mat, "cubic")
-
-        elif mat.type == 'HALO':
-            layout.prop(mat, "alpha")
-
-
-class MATERIAL_PT_strand(MaterialButtonsPanel, bpy.types.Panel):
-    bl_label = "Strand"
-    bl_default_closed = True
-    COMPAT_ENGINES = {'BLENDER_RENDER'}
-
-    @classmethod
-    def poll(cls, context):
-        mat = context.material
-        engine = context.scene.render.engine
-        return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in cls.COMPAT_ENGINES)
-
-    def draw(self, context):
-        layout = self.layout
-
-        mat = context.material # dont use node material
-        tan = mat.strand
-
-        split = layout.split()
-
-        col = split.column()
-        sub = col.column(align=True)
-        sub.label(text="Size:")
-        sub.prop(tan, "root_size", text="Root")
-        sub.prop(tan, "tip_size", text="Tip")
-        sub.prop(tan, "min_size", text="Minimum")
-        sub.prop(tan, "blender_units")
-        sub = col.column()
-        sub.active = (not mat.shadeless)
-        sub.prop(tan, "tangent_shading")
-        col.prop(tan, "shape")
-
-        col = split.column()
-        col.label(text="Shading:")
-        col.prop(tan, "width_fade")
-        ob = context.object
-        if ob and ob.type == 'MESH':
-            col.prop_object(tan, "uv_layer", ob.data, "uv_textures", text="")
-        else:
-            col.prop(tan, "uv_layer", text="")
-        col.separator()
-        sub = col.column()
-        sub.active = (not mat.shadeless)
-        sub.prop(tan, "surface_diffuse")
-        sub = col.column()
-        sub.active = tan.surface_diffuse
-        sub.prop(tan, "blend_distance", text="Distance")
-
-
-class MATERIAL_PT_physics(MaterialButtonsPanel, bpy.types.Panel):
-    bl_label = "Physics"
-    COMPAT_ENGINES = {'BLENDER_GAME'}
-
-    @classmethod
-    def poll(cls, context):
-        return context.material and (context.scene.render.engine in cls.COMPAT_ENGINES)
-
-    def draw(self, context):
-        layout = self.layout
-
-        phys = context.material.physics # dont use node material
-
-        split = layout.split()
-
-        col = split.column()
-        col.prop(phys, "distance")
-        col.prop(phys, "friction")
-        col.prop(phys, "align_to_normal")
-
-        col = split.column()
-        col.prop(phys, "force", slider=True)
-        col.prop(phys, "elasticity", slider=True)
-        col.prop(phys, "damp", slider=True)
-
-
-class MATERIAL_PT_options(MaterialButtonsPanel, bpy.types.Panel):
-    bl_label = "Options"
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-
-    @classmethod
-    def poll(cls, context):
-        mat = active_node_mat(context.material)
-        engine = context.scene.render.engine
-        return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES)
-
-    def draw(self, context):
-        layout = self.layout
-
-        mat = active_node_mat(context.material)
-
-        split = layout.split()
-
-        col = split.column()
-        col.prop(mat, "traceable")
-        col.prop(mat, "full_oversampling")
-        col.prop(mat, "use_sky")
-        col.prop(mat, "exclude_mist")
-        col.prop(mat, "invert_z")
-        sub = col.row()
-        sub.prop(mat, "z_offset")
-        sub.active = mat.transparency and mat.transparency_method == 'Z_TRANSPARENCY'
-        sub = col.column(align=True)
-        sub.label(text="Light Group:")
-        sub.prop(mat, "light_group", text="")
-        row = sub.row()
-        row.active = bool(mat.light_group)
-        row.prop(mat, "light_group_exclusive", text="Exclusive")
-
-        col = split.column()
-        col.prop(mat, "face_texture")
-        sub = col.column()
-        sub.active = mat.face_texture
-        sub.prop(mat, "face_texture_alpha")
-        col.separator()
-        col.prop(mat, "vertex_color_paint")
-        col.prop(mat, "vertex_color_light")
-        col.prop(mat, "object_color")
-
-
-class MATERIAL_PT_shadow(MaterialButtonsPanel, bpy.types.Panel):
-    bl_label = "Shadow"
-    bl_default_closed = True
+class MATERIAL_PT_preview(MaterialButtonsPanel, bpy.types.Panel):
+    bl_label = "Preview"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
-    @classmethod
-    def poll(cls, context):
-        mat = active_node_mat(context.material)
-        engine = context.scene.render.engine
-        return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES)
-
     def draw(self, context):
-        layout = self.layout
-
-        mat = active_node_mat(context.material)
-
-        split = layout.split()
-
-        col = split.column()
-        col.prop(mat, "shadows", text="Receive")
-        col.prop(mat, "receive_transparent_shadows", text="Receive Transparent")
-        col.prop(mat, "only_shadow", text="Shadows Only")
-        col.prop(mat, "cast_shadows_only", text="Cast Only")
-        col.prop(mat, "shadow_casting_alpha", text="Casting Alpha")
+        self.layout.template_preview(context.material)
 
-        col = split.column()
-        col.prop(mat, "cast_buffer_shadows")
-        sub = col.column()
-        sub.active = mat.cast_buffer_shadows
-        sub.prop(mat, "shadow_buffer_bias", text="Buffer Bias")
-        col.prop(mat, "ray_shadow_bias", text="Auto Ray Bias")
-        sub = col.column()
-        sub.active = (not mat.ray_shadow_bias)
-        sub.prop(mat, "shadow_ray_bias", text="Ray Bias")
-        col.prop(mat, "cast_approximate")
 
 class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel):
     bl_label = "Diffuse"
@@ -457,59 +261,45 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel):
             row.prop(mat, "specular_ramp_factor", text="Factor")
 
 
-class MATERIAL_PT_sss(MaterialButtonsPanel, bpy.types.Panel):
-    bl_label = "Subsurface Scattering"
-    bl_default_closed = True
-    COMPAT_ENGINES = {'BLENDER_RENDER'}
+class MATERIAL_PT_shading(MaterialButtonsPanel, bpy.types.Panel):
+    bl_label = "Shading"
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
     @classmethod
     def poll(cls, context):
         mat = active_node_mat(context.material)
         engine = context.scene.render.engine
-        return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES)
-
-    def draw_header(self, context):
-        mat = active_node_mat(context.material)
-        sss = mat.subsurface_scattering
-
-        self.layout.active = (not mat.shadeless)
-        self.layout.prop(sss, "enabled", text="")
+        return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in cls.COMPAT_ENGINES)
 
     def draw(self, context):
         layout = self.layout
 
         mat = active_node_mat(context.material)
-        sss = mat.subsurface_scattering
 
-        layout.active = (sss.enabled) and (not mat.shadeless)
-
-        row = layout.row().split()
-        sub = row.row(align=True).split(percentage=0.75)
-        sub.menu("MATERIAL_MT_sss_presets", text=bpy.types.MATERIAL_MT_sss_presets.bl_label)
-        sub.operator("material.sss_preset_add", text="", icon="ZOOMIN")
+        if mat.type in ('SURFACE', 'WIRE'):
+            split = layout.split()
 
-        split = layout.split()
+            col = split.column()
+            sub = col.column()
+            sub.active = not mat.shadeless
+            sub.prop(mat, "emit")
+            sub.prop(mat, "ambient")
+            sub = col.column()
+            sub.prop(mat, "translucency")
 
-        col = split.column()
-        col.prop(sss, "ior")
-        col.prop(sss, "scale")
-        col.prop(sss, "color", text="")
-        col.prop(sss, "radius", text="RGB Radius", expand=True)
+            col = split.column()
+            col.prop(mat, "shadeless")
+            sub = col.column()
+            sub.active = not mat.shadeless
+            sub.prop(mat, "tangent_shading")
+            sub.prop(mat, "cubic")
 
-        col = split.column()
-        sub = col.column(align=True)
-        sub.label(text="Blend:")
-        sub.prop(sss, "color_factor", text="Color")
-        sub.prop(sss, "texture_factor", text="Texture")
-        sub.label(text="Scattering Weight:")
-        sub.prop(sss, "front")
-        sub.prop(sss, "back")
-        col.separator()
-        col.prop(sss, "error_tolerance", text="Error")
+        elif mat.type == 'HALO':
+            layout.prop(mat, "alpha")
 
 
-class MATERIAL_PT_mirror(MaterialButtonsPanel, bpy.types.Panel):
-    bl_label = "Mirror"
+class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel):
+    bl_label = "Transparency"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -520,54 +310,58 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel, bpy.types.Panel):
         return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES)
 
     def draw_header(self, context):
-        raym = active_node_mat(context.material).raytrace_mirror
+        mat = active_node_mat(context.material)
 
-        self.layout.prop(raym, "enabled", text="")
+        self.layout.prop(mat, "transparency", text="")
 
     def draw(self, context):
         layout = self.layout
 
         mat = active_node_mat(context.material)
-        raym = mat.raytrace_mirror
+        rayt = mat.raytrace_transparency
 
-        layout.active = raym.enabled
+        row = layout.row()
+        row.active = mat.transparency and (not mat.shadeless)
+        row.prop(mat, "transparency_method", expand=True)
 
         split = layout.split()
 
         col = split.column()
-        col.prop(raym, "reflect_factor")
-        col.prop(mat, "mirror_color", text="")
+        col.prop(mat, "alpha")
+        row = col.row()
+        row.active = mat.transparency and (not mat.shadeless)
+        row.prop(mat, "specular_alpha", text="Specular")
 
         col = split.column()
-        col.prop(raym, "fresnel")
+        col.active = (not mat.shadeless)
+        col.prop(rayt, "fresnel")
         sub = col.column()
-        sub.active = raym.fresnel > 0
-        sub.prop(raym, "fresnel_factor", text="Blend")
-
-        split = layout.split()
+        sub.active = rayt.fresnel > 0
+        sub.prop(rayt, "fresnel_factor", text="Blend")
 
-        col = split.column()
-        col.separator()
-        col.prop(raym, "depth")
-        col.prop(raym, "distance", text="Max Dist")
-        col.separator()
-        sub = col.split(percentage=0.4)
-        sub.active = raym.distance > 0.0
-        sub.label(text="Fade To:")
-        sub.prop(raym, "fade_to", text="")
+        if mat.transparency_method == 'RAYTRACE':
+            layout.separator()
+            split = layout.split()
+            split.active = mat.transparency
 
-        col = split.column()
-        col.label(text="Gloss:")
-        col.prop(raym, "gloss_factor", text="Amount")
-        sub = col.column()
-        sub.active = raym.gloss_factor < 1.0
-        sub.prop(raym, "gloss_threshold", text="Threshold")
-        sub.prop(raym, "gloss_samples", text="Samples")
-        sub.prop(raym, "gloss_anisotropic", text="Anisotropic")
+            col = split.column()
+            col.prop(rayt, "ior")
+            col.prop(rayt, "filter")
+            col.prop(rayt, "falloff")
+            col.prop(rayt, "limit")
+            col.prop(rayt, "depth")
 
+            col = split.column()
+            col.label(text="Gloss:")
+            col.prop(rayt, "gloss_factor", text="Amount")
+            sub = col.column()
+            sub.active = rayt.gloss_factor < 1.0
+            sub.prop(rayt, "gloss_threshold", text="Threshold")
+            sub.prop(rayt, "gloss_samples", text="Samples")    
 
-class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel):
-    bl_label = "Transparency"
+            
+class MATERIAL_PT_mirror(MaterialButtonsPanel, bpy.types.Panel):
+    bl_label = "Mirror"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -578,86 +372,101 @@ class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel):
         return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES)
 
     def draw_header(self, context):
-        mat = active_node_mat(context.material)
+        raym = active_node_mat(context.material).raytrace_mirror
 
-        self.layout.prop(mat, "transparency", text="")
+        self.layout.prop(raym, "enabled", text="")
 
     def draw(self, context):
         layout = self.layout
 
         mat = active_node_mat(context.material)
-        rayt = mat.raytrace_transparency
+        raym = mat.raytrace_mirror
 
-        row = layout.row()
-        row.active = mat.transparency and (not mat.shadeless)
-        row.prop(mat, "transparency_method", expand=True)
+        layout.active = raym.enabled
 
         split = layout.split()
 
         col = split.column()
-        col.prop(mat, "alpha")
-        row = col.row()
-        row.active = mat.transparency and (not mat.shadeless)
-        row.prop(mat, "specular_alpha", text="Specular")
+        col.prop(raym, "reflect_factor")
+        col.prop(mat, "mirror_color", text="")
 
         col = split.column()
-        col.active = (not mat.shadeless)
-        col.prop(rayt, "fresnel")
+        col.prop(raym, "fresnel")
         sub = col.column()
-        sub.active = rayt.fresnel > 0
-        sub.prop(rayt, "fresnel_factor", text="Blend")
-
-        if mat.transparency_method == 'RAYTRACE':
-            layout.separator()
-            split = layout.split()
-            split.active = mat.transparency
+        sub.active = raym.fresnel > 0
+        sub.prop(raym, "fresnel_factor", text="Blend")
 
-            col = split.column()
-            col.prop(rayt, "ior")
-            col.prop(rayt, "filter")
-            col.prop(rayt, "falloff")
-            col.prop(rayt, "limit")
-            col.prop(rayt, "depth")
+        split = layout.split()
 
-            col = split.column()
-            col.label(text="Gloss:")
-            col.prop(rayt, "gloss_factor", text="Amount")
-            sub = col.column()
-            sub.active = rayt.gloss_factor < 1.0
-            sub.prop(rayt, "gloss_threshold", text="Threshold")
-            sub.prop(rayt, "gloss_samples", text="Samples")
+        col = split.column()
+        col.separator()
+        col.prop(raym, "depth")
+        col.prop(raym, "distance", text="Max Dist")
+        col.separator()
+        sub = col.split(percentage=0.4)
+        sub.active = raym.distance > 0.0
+        sub.label(text="Fade To:")
+        sub.prop(raym, "fade_to", text="")
 
+        col = split.column()
+        col.label(text="Gloss:")
+        col.prop(raym, "gloss_factor", text="Amount")
+        sub = col.column()
+        sub.active = raym.gloss_factor < 1.0
+        sub.prop(raym, "gloss_threshold", text="Threshold")
+        sub.prop(raym, "gloss_samples", text="Samples")
+        sub.prop(raym, "gloss_anisotropic", text="Anisotropic")
 
-class MATERIAL_PT_transp_game(MaterialButtonsPanel, bpy.types.Panel):
-    bl_label = "Transparency"
+
+class MATERIAL_PT_sss(MaterialButtonsPanel, bpy.types.Panel):
+    bl_label = "Subsurface Scattering"
     bl_default_closed = True
-    COMPAT_ENGINES = {'BLENDER_GAME'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         mat = active_node_mat(context.material)
         engine = context.scene.render.engine
-        return mat  and (engine in cls.COMPAT_ENGINES)
+        return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES)
 
     def draw_header(self, context):
         mat = active_node_mat(context.material)
+        sss = mat.subsurface_scattering
 
-        self.layout.prop(mat, "transparency", text="")
+        self.layout.active = (not mat.shadeless)
+        self.layout.prop(sss, "enabled", text="")
 
     def draw(self, context):
         layout = self.layout
 
         mat = active_node_mat(context.material)
-        rayt = mat.raytrace_transparency
+        sss = mat.subsurface_scattering
 
-        row = layout.row()
-        row.active = mat.transparency and (not mat.shadeless)
-        row.prop(mat, "transparency_method", expand=True)
+        layout.active = (sss.enabled) and (not mat.shadeless)
+
+        row = layout.row().split()
+        sub = row.row(align=True).split(percentage=0.75)
+        sub.menu("MATERIAL_MT_sss_presets", text=bpy.types.MATERIAL_MT_sss_presets.bl_label)
+        sub.operator("material.sss_preset_add", text="", icon="ZOOMIN")
 
         split = layout.split()
 
         col = split.column()
-        col.prop(mat, "alpha")
+        col.prop(sss, "ior")
+        col.prop(sss, "scale")
+        col.prop(sss, "color", text="")
+        col.prop(sss, "radius", text="RGB Radius", expand=True)
+
+        col = split.column()
+        sub = col.column(align=True)
+        sub.label(text="Blend:")
+        sub.prop(sss, "color_factor", text="Color")
+        sub.prop(sss, "texture_factor", text="Texture")
+        sub.label(text="Scattering Weight:")
+        sub.prop(sss, "front")
+        sub.prop(sss, "back")
+        col.separator()
+        col.prop(sss, "error_tolerance", text="Error")
 
 
 class MATERIAL_PT_halo(MaterialButtonsPanel, bpy.types.Panel):
@@ -744,6 +553,193 @@ class MATERIAL_PT_flare(MaterialButtonsPanel, bpy.types.Panel):
         col.prop(halo, "flare_subsize", text="Subsize")
 
 
+class MATERIAL_PT_physics(MaterialButtonsPanel, bpy.types.Panel):
+    bl_label = "Physics"
+    COMPAT_ENGINES = {'BLENDER_GAME'}
+
+    @classmethod
+    def poll(cls, context):
+        return context.material and (context.scene.render.engine in cls.COMPAT_ENGINES)
+
+    def draw(self, context):
+        layout = self.layout
+
+        phys = context.material.physics # dont use node material
+
+        split = layout.split()
+
+        col = split.column()
+        col.prop(phys, "distance")
+        col.prop(phys, "friction")
+        col.prop(phys, "align_to_normal")
+
+        col = split.column()
+        col.prop(phys, "force", slider=True)
+        col.prop(phys, "elasticity", slider=True)
+        col.prop(phys, "damp", slider=True)
+
+
+class MATERIAL_PT_strand(MaterialButtonsPanel, bpy.types.Panel):
+    bl_label = "Strand"
+    bl_default_closed = True
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
+
+    @classmethod
+    def poll(cls, context):
+        mat = context.material
+        engine = context.scene.render.engine
+        return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in cls.COMPAT_ENGINES)
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = context.material # dont use node material
+        tan = mat.strand
+
+        split = layout.split()
+
+        col = split.column()
+        sub = col.column(align=True)
+        sub.label(text="Size:")
+        sub.prop(tan, "root_size", text="Root")
+        sub.prop(tan, "tip_size", text="Tip")
+        sub.prop(tan, "min_size", text="Minimum")
+        sub.prop(tan, "blender_units")
+        sub = col.column()
+        sub.active = (not mat.shadeless)
+        sub.prop(tan, "tangent_shading")
+        col.prop(tan, "shape")
+
+        col = split.column()
+        col.label(text="Shading:")
+        col.prop(tan, "width_fade")
+        ob = context.object
+        if ob and ob.type == 'MESH':
+            col.prop_object(tan, "uv_layer", ob.data, "uv_textures", text="")
+        else:
+            col.prop(tan, "uv_layer", text="")
+        col.separator()
+        sub = col.column()
+        sub.active = (not mat.shadeless)
+        sub.prop(tan, "surface_diffuse")
+        sub = col.column()
+        sub.active = tan.surface_diffuse
+        sub.prop(tan, "blend_distance", text="Distance")
+
+
+class MATERIAL_PT_options(MaterialButtonsPanel, bpy.types.Panel):
+    bl_label = "Options"
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+
+    @classmethod
+    def poll(cls, context):
+        mat = active_node_mat(context.material)
+        engine = context.scene.render.engine
+        return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES)
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = active_node_mat(context.material)
+
+        split = layout.split()
+
+        col = split.column()
+        col.prop(mat, "traceable")
+        col.prop(mat, "full_oversampling")
+        col.prop(mat, "use_sky")
+        col.prop(mat, "exclude_mist")
+        col.prop(mat, "invert_z")
+        sub = col.row()
+        sub.prop(mat, "z_offset")
+        sub.active = mat.transparency and mat.transparency_method == 'Z_TRANSPARENCY'
+        sub = col.column(align=True)
+        sub.label(text="Light Group:")
+        sub.prop(mat, "light_group", text="")
+        row = sub.row()
+        row.active = bool(mat.light_group)
+        row.prop(mat, "light_group_exclusive", text="Exclusive")
+
+        col = split.column()
+        col.prop(mat, "face_texture")
+        sub = col.column()
+        sub.active = mat.face_texture
+        sub.prop(mat, "face_texture_alpha")
+        col.separator()
+        col.prop(mat, "vertex_color_paint")
+        col.prop(mat, "vertex_color_light")
+        col.prop(mat, "object_color")
+
+
+class MATERIAL_PT_shadow(MaterialButtonsPanel, bpy.types.Panel):
+    bl_label = "Shadow"
+    bl_default_closed = True
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+
+    @classmethod
+    def poll(cls, context):
+        mat = active_node_mat(context.material)
+        engine = context.scene.render.engine
+        return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES)
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = active_node_mat(context.material)
+
+        split = layout.split()
+
+        col = split.column()
+        col.prop(mat, "shadows", text="Receive")
+        col.prop(mat, "receive_transparent_shadows", text="Receive Transparent")
+        col.prop(mat, "only_shadow", text="Shadows Only")
+        col.prop(mat, "cast_shadows_only", text="Cast Only")
+        col.prop(mat, "shadow_casting_alpha", text="Casting Alpha")
+
+        col = split.column()
+        col.prop(mat, "cast_buffer_shadows")
+        sub = col.column()
+        sub.active = mat.cast_buffer_shadows
+        sub.prop(mat, "shadow_buffer_bias", text="Buffer Bias")
+        col.prop(mat, "ray_shadow_bias", text="Auto Ray Bias")
+        sub = col.column()
+        sub.active = (not mat.ray_shadow_bias)
+        sub.prop(mat, "shadow_ray_bias", text="Ray Bias")
+        col.prop(mat, "cast_approximate")
+
+
+class MATERIAL_PT_transp_game(MaterialButtonsPanel, bpy.types.Panel):
+    bl_label = "Transparency"
+    bl_default_closed = True
+    COMPAT_ENGINES = {'BLENDER_GAME'}
+
+    @classmethod
+    def poll(cls, context):
+        mat = active_node_mat(context.material)
+        engine = context.scene.render.engine
+        return mat  and (engine in cls.COMPAT_ENGINES)
+
+    def draw_header(self, context):
+        mat = active_node_mat(context.material)
+
+        self.layout.prop(mat, "transparency", text="")
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = active_node_mat(context.material)
+        rayt = mat.raytrace_transparency
+
+        row = layout.row()
+        row.active = mat.transparency and (not mat.shadeless)
+        row.prop(mat, "transparency_method", expand=True)
+
+        split = layout.split()
+
+        col = split.column()
+        col.prop(mat, "alpha")
+
+
 class VolumeButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
@@ -897,6 +893,11 @@ class MATERIAL_PT_volume_options(VolumeButtonsPanel, bpy.types.Panel):
         row.prop(mat, "light_group_exclusive", text="Exclusive")
 
 
+class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel, bpy.types.Panel):
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+    _context_path = "material"
+
+
 def register():
     pass
 
index 3ed8dfb72b8aa5df2a7363c2e439ae06f2e80405..3afa5d2f53f8beb78c70450ebb7e419247bb0bbc 100644 (file)
@@ -43,11 +43,6 @@ class SCENE_PT_scene(SceneButtonsPanel, bpy.types.Panel):
         layout.prop(scene, "set", text="Background")
 
 
-class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, bpy.types.Panel):
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-    _context_path = "scene"
-
-
 class SCENE_PT_unit(SceneButtonsPanel, bpy.types.Panel):
     bl_label = "Units"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -205,6 +200,11 @@ class SCENE_PT_simplify(SceneButtonsPanel, bpy.types.Panel):
         col.prop(rd, "simplify_ao_sss", text="AO and SSS")
 
 
+class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, bpy.types.Panel):
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+    _context_path = "scene"
+
+
 from bpy.props import *
 
 
index b675576ec3f1f53c5a981ab773c55a14b3f859f9..21cdae9852486382cef818c33f13b995b45abcb7 100644 (file)
@@ -74,23 +74,6 @@ class TextureButtonsPanel():
         return tex and (tex.type != 'NONE' or tex.use_nodes) and (context.scene.render.engine in cls.COMPAT_ENGINES)
 
 
-class TEXTURE_PT_preview(TextureButtonsPanel, bpy.types.Panel):
-    bl_label = "Preview"
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-
-    def draw(self, context):
-        layout = self.layout
-
-        tex = context.texture
-        slot = getattr(context, "texture_slot", None)
-        idblock = context_tex_datablock(context)
-
-        if idblock:
-            layout.template_preview(tex, parent=idblock, slot=slot)
-        else:
-            layout.template_preview(tex, slot=slot)
-
-
 class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
     bl_label = ""
     bl_show_header = False
@@ -155,9 +138,21 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
                 split.prop(tex, "type", text="")
 
 
-class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, bpy.types.Panel):
+class TEXTURE_PT_preview(TextureButtonsPanel, bpy.types.Panel):
+    bl_label = "Preview"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-    _context_path = "texture"
+
+    def draw(self, context):
+        layout = self.layout
+
+        tex = context.texture
+        slot = getattr(context, "texture_slot", None)
+        idblock = context_tex_datablock(context)
+
+        if idblock:
+            layout.template_preview(tex, parent=idblock, slot=slot)
+        else:
+            layout.template_preview(tex, slot=slot)
 
 
 class TEXTURE_PT_colors(TextureButtonsPanel, bpy.types.Panel):
@@ -989,6 +984,11 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel, bpy.types.Panel):
         col.prop(pd, "turbulence_strength")
 
 
+class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, bpy.types.Panel):
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+    _context_path = "texture"
+
+
 def register():
     pass
 
index eec1caf58f713ced1050aea0d44d3e72f06d01f8..1fa0d15a90b86a782b4e20d62ccc8dad02d8f711 100644 (file)
@@ -33,19 +33,6 @@ class WorldButtonsPanel():
         return (rd.engine in cls.COMPAT_ENGINES)
 
 
-class WORLD_PT_preview(WorldButtonsPanel, bpy.types.Panel):
-    bl_label = "Preview"
-    COMPAT_ENGINES = {'BLENDER_RENDER'}
-
-    @classmethod
-    def poll(cls, context):
-        rd = context.scene.render
-        return (context.world) and (not rd.use_game_engine) and (rd.engine in cls.COMPAT_ENGINES)
-
-    def draw(self, context):
-        self.layout.template_preview(context.world)
-
-
 class WORLD_PT_context_world(WorldButtonsPanel, bpy.types.Panel):
     bl_label = ""
     bl_show_header = False
@@ -70,9 +57,23 @@ class WORLD_PT_context_world(WorldButtonsPanel, bpy.types.Panel):
             split.template_ID(space, "pin_id")
 
 
-class WORLD_PT_custom_props(WorldButtonsPanel, PropertyPanel, bpy.types.Panel):
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-    _context_path = "world"
+class WORLD_PT_preview(WorldButtonsPanel, bpy.types.Panel):
+    bl_label = "Preview"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
+
+    @classmethod
+    def poll(cls, context):
+        rd = context.scene.render
+        return (context.world) and (not rd.use_game_engine) and (rd.engine in cls.COMPAT_ENGINES)
+
+    def draw(self, context):
+        self.layout.template_preview(context.world)
+
+
+
+
+
+
 
 
 class WORLD_PT_world(WorldButtonsPanel, bpy.types.Panel):
@@ -96,62 +97,6 @@ class WORLD_PT_world(WorldButtonsPanel, bpy.types.Panel):
         row.column().prop(world, "ambient_color")
 
 
-class WORLD_PT_mist(WorldButtonsPanel, bpy.types.Panel):
-    bl_label = "Mist"
-    bl_default_closed = True
-    COMPAT_ENGINES = {'BLENDER_RENDER'}
-
-    def draw_header(self, context):
-        world = context.world
-
-        self.layout.prop(world.mist, "use_mist", text="")
-
-    def draw(self, context):
-        layout = self.layout
-        world = context.world
-
-        layout.active = world.mist.use_mist
-
-        split = layout.split()
-
-        col = split.column()
-        col.prop(world.mist, "intensity", slider=True)
-        col.prop(world.mist, "start")
-
-        col = split.column()
-        col.prop(world.mist, "depth")
-        col.prop(world.mist, "height")
-
-        layout.prop(world.mist, "falloff")
-
-
-class WORLD_PT_stars(WorldButtonsPanel, bpy.types.Panel):
-    bl_label = "Stars"
-    bl_default_closed = True
-    COMPAT_ENGINES = {'BLENDER_RENDER'}
-
-    def draw_header(self, context):
-        world = context.world
-
-        self.layout.prop(world.stars, "use_stars", text="")
-
-    def draw(self, context):
-        layout = self.layout
-        world = context.world
-
-        layout.active = world.stars.use_stars
-
-        split = layout.split()
-
-        col = split.column()
-        col.prop(world.stars, "size")
-        col.prop(world.stars, "color_randomization", text="Colors")
-
-        col = split.column()
-        col.prop(world.stars, "min_distance", text="Min. Dist")
-        col.prop(world.stars, "average_separation", text="Separation")
-
-
 class WORLD_PT_ambient_occlusion(WorldButtonsPanel, bpy.types.Panel):
     bl_label = "Ambient Occlusion"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -262,6 +207,67 @@ class WORLD_PT_gather(WorldButtonsPanel, bpy.types.Panel):
             col.prop(light, "correction")
 
 
+class WORLD_PT_mist(WorldButtonsPanel, bpy.types.Panel):
+    bl_label = "Mist"
+    bl_default_closed = True
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
+
+    def draw_header(self, context):
+        world = context.world
+
+        self.layout.prop(world.mist, "use_mist", text="")
+
+    def draw(self, context):
+        layout = self.layout
+        world = context.world
+
+        layout.active = world.mist.use_mist
+
+        split = layout.split()
+
+        col = split.column()
+        col.prop(world.mist, "intensity", slider=True)
+        col.prop(world.mist, "start")
+
+        col = split.column()
+        col.prop(world.mist, "depth")
+        col.prop(world.mist, "height")
+
+        layout.prop(world.mist, "falloff")
+
+
+class WORLD_PT_stars(WorldButtonsPanel, bpy.types.Panel):
+    bl_label = "Stars"
+    bl_default_closed = True
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
+
+    def draw_header(self, context):
+        world = context.world
+
+        self.layout.prop(world.stars, "use_stars", text="")
+
+    def draw(self, context):
+        layout = self.layout
+        world = context.world
+
+        layout.active = world.stars.use_stars
+
+        split = layout.split()
+
+        col = split.column()
+        col.prop(world.stars, "size")
+        col.prop(world.stars, "color_randomization", text="Colors")
+
+        col = split.column()
+        col.prop(world.stars, "min_distance", text="Min. Dist")
+        col.prop(world.stars, "average_separation", text="Separation")
+
+
+class WORLD_PT_custom_props(WorldButtonsPanel, PropertyPanel, bpy.types.Panel):
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+    _context_path = "world"
+
+
 def register():
     pass