diff options
author | Thomas Dinges <blender@dingto.org> | 2010-08-12 23:36:10 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2010-08-12 23:36:10 +0400 |
commit | 76e1773548fcacc2cec5a9fc5fcc84e6a47ea93c (patch) | |
tree | 417bb38f9eff098218bdc6e93f904baf1f97d3c1 | |
parent | 6faa93036954a420ee3bb4670b6be03502bea348 (diff) |
2.5 User Interface / UI Scripts
* 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.
-rw-r--r-- | release/scripts/ui/properties_data_armature.py | 10 | ||||
-rw-r--r-- | release/scripts/ui/properties_data_bone.py | 24 | ||||
-rw-r--r-- | release/scripts/ui/properties_data_camera.py | 10 | ||||
-rw-r--r-- | release/scripts/ui/properties_data_curve.py | 10 | ||||
-rw-r--r-- | release/scripts/ui/properties_data_lamp.py | 19 | ||||
-rw-r--r-- | release/scripts/ui/properties_data_lattice.py | 10 | ||||
-rw-r--r-- | release/scripts/ui/properties_data_mesh.py | 10 | ||||
-rw-r--r-- | release/scripts/ui/properties_data_metaball.py | 10 | ||||
-rw-r--r-- | release/scripts/ui/properties_material.py | 587 | ||||
-rw-r--r-- | release/scripts/ui/properties_scene.py | 10 | ||||
-rw-r--r-- | release/scripts/ui/properties_texture.py | 38 | ||||
-rw-r--r-- | release/scripts/ui/properties_world.py | 150 |
12 files changed, 448 insertions, 440 deletions
diff --git a/release/scripts/ui/properties_data_armature.py b/release/scripts/ui/properties_data_armature.py index 3d8f2cdc092..29ef85e6c60 100644 --- a/release/scripts/ui/properties_data_armature.py +++ b/release/scripts/ui/properties_data_armature.py @@ -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 diff --git a/release/scripts/ui/properties_data_bone.py b/release/scripts/ui/properties_data_bone.py index 1296ccd7e70..973cb115a2f 100644 --- a/release/scripts/ui/properties_data_bone.py +++ b/release/scripts/ui/properties_data_bone.py @@ -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 diff --git a/release/scripts/ui/properties_data_camera.py b/release/scripts/ui/properties_data_camera.py index cda2b79c909..a1d468709d8 100644 --- a/release/scripts/ui/properties_data_camera.py +++ b/release/scripts/ui/properties_data_camera.py @@ -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 diff --git a/release/scripts/ui/properties_data_curve.py b/release/scripts/ui/properties_data_curve.py index 1262f6739b7..1292a2a3d8d 100644 --- a/release/scripts/ui/properties_data_curve.py +++ b/release/scripts/ui/properties_data_curve.py @@ -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 diff --git a/release/scripts/ui/properties_data_lamp.py b/release/scripts/ui/properties_data_lamp.py index 9a58622974e..91ccce3b011 100644 --- a/release/scripts/ui/properties_data_lamp.py +++ b/release/scripts/ui/properties_data_lamp.py @@ -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 diff --git a/release/scripts/ui/properties_data_lattice.py b/release/scripts/ui/properties_data_lattice.py index 5e313b79d85..0ae3e03aebe 100644 --- a/release/scripts/ui/properties_data_lattice.py +++ b/release/scripts/ui/properties_data_lattice.py @@ -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(): diff --git a/release/scripts/ui/properties_data_mesh.py b/release/scripts/ui/properties_data_mesh.py index 1be2ce824fa..7a5f7e3f3ff 100644 --- a/release/scripts/ui/properties_data_mesh.py +++ b/release/scripts/ui/properties_data_mesh.py @@ -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 diff --git a/release/scripts/ui/properties_data_metaball.py b/release/scripts/ui/properties_data_metaball.py index a6b1bb75cbe..4a811bafad5 100644 --- a/release/scripts/ui/properties_data_metaball.py +++ b/release/scripts/ui/properties_data_metaball.py @@ -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 diff --git a/release/scripts/ui/properties_material.py b/release/scripts/ui/properties_material.py index 5034f4f40ae..3a30edc150f 100644 --- a/release/scripts/ui/properties_material.py +++ b/release/scripts/ui/properties_material.py @@ -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,8 +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" +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_transp(MaterialButtonsPanel, bpy.types.Panel): + bl_label = "Transparency" bl_default_closed = True COMPAT_ENGINES = {'BLENDER_RENDER'} @@ -470,44 +311,55 @@ class MATERIAL_PT_sss(MaterialButtonsPanel, bpy.types.Panel): 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="") + self.layout.prop(mat, "transparency", text="") 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) + rayt = mat.raytrace_transparency - 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") + 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(sss, "ior") - col.prop(sss, "scale") - col.prop(sss, "color", text="") - col.prop(sss, "radius", text="RGB Radius", expand=True) + 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() - 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") + col.active = (not mat.shadeless) + col.prop(rayt, "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 + 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_mirror(MaterialButtonsPanel, bpy.types.Panel): bl_label = "Mirror" bl_default_closed = True @@ -566,8 +418,8 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel, bpy.types.Panel): sub.prop(raym, "gloss_anisotropic", text="Anisotropic") -class MATERIAL_PT_transp(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_RENDER'} @@ -579,85 +431,42 @@ class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel): 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) - split = layout.split() + 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") - 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") + split = layout.split() col = split.column() - col.active = (not mat.shadeless) - col.prop(rayt, "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 - - 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_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.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, "alpha") + 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 diff --git a/release/scripts/ui/properties_scene.py b/release/scripts/ui/properties_scene.py index 3ed8dfb72b8..3afa5d2f53f 100644 --- a/release/scripts/ui/properties_scene.py +++ b/release/scripts/ui/properties_scene.py @@ -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 * diff --git a/release/scripts/ui/properties_texture.py b/release/scripts/ui/properties_texture.py index b675576ec3f..21cdae98524 100644 --- a/release/scripts/ui/properties_texture.py +++ b/release/scripts/ui/properties_texture.py @@ -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 diff --git a/release/scripts/ui/properties_world.py b/release/scripts/ui/properties_world.py index eec1caf58f7..1fa0d15a90b 100644 --- a/release/scripts/ui/properties_world.py +++ b/release/scripts/ui/properties_world.py @@ -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 |