RNA Types metaclass registration
See mailing list posts for details [1][2][3] Addons still need to be fixed; Campbell said he'd do it today. See any of the py files (outside netrender) in this commit for how to do it (it's rather simple). [1] http://lists.blender.org/pipermail/bf-committers/2010-February/026328.html [2] http://lists.blender.org/pipermail/bf-committers/2010-August/028311.html [3] http://lists.blender.org/pipermail/bf-committers/2010-August/028321.html
This commit is contained in:
@@ -54,7 +54,7 @@ class MATERIAL_MT_specials(bpy.types.Menu):
|
||||
layout.operator("material.paste", icon='PASTEDOWN')
|
||||
|
||||
|
||||
class MaterialButtonsPanel(bpy.types.Panel):
|
||||
class MaterialButtonsPanel():
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "material"
|
||||
@@ -66,7 +66,7 @@ class MaterialButtonsPanel(bpy.types.Panel):
|
||||
return mat and (engine in self.COMPAT_ENGINES)
|
||||
|
||||
|
||||
class MATERIAL_PT_preview(MaterialButtonsPanel):
|
||||
class MATERIAL_PT_preview(MaterialButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Preview"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
@@ -74,7 +74,7 @@ class MATERIAL_PT_preview(MaterialButtonsPanel):
|
||||
self.layout.template_preview(context.material)
|
||||
|
||||
|
||||
class MATERIAL_PT_context_material(MaterialButtonsPanel):
|
||||
class MATERIAL_PT_context_material(MaterialButtonsPanel, bpy.types.Panel):
|
||||
bl_label = ""
|
||||
bl_show_header = False
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
@@ -141,12 +141,12 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
|
||||
layout.prop(mat, "type", text="")
|
||||
|
||||
|
||||
class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel):
|
||||
class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel, bpy.types.Panel):
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
_context_path = "material"
|
||||
|
||||
|
||||
class MATERIAL_PT_shading(MaterialButtonsPanel):
|
||||
class MATERIAL_PT_shading(MaterialButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Shading"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
@@ -184,7 +184,7 @@ class MATERIAL_PT_shading(MaterialButtonsPanel):
|
||||
layout.prop(mat, "alpha")
|
||||
|
||||
|
||||
class MATERIAL_PT_strand(MaterialButtonsPanel):
|
||||
class MATERIAL_PT_strand(MaterialButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Strand"
|
||||
bl_default_closed = True
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
@@ -233,7 +233,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel):
|
||||
sub.prop(tan, "blend_distance", text="Distance")
|
||||
|
||||
|
||||
class MATERIAL_PT_physics(MaterialButtonsPanel):
|
||||
class MATERIAL_PT_physics(MaterialButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Physics"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
@@ -257,7 +257,7 @@ class MATERIAL_PT_physics(MaterialButtonsPanel):
|
||||
col.prop(phys, "damp", slider=True)
|
||||
|
||||
|
||||
class MATERIAL_PT_options(MaterialButtonsPanel):
|
||||
class MATERIAL_PT_options(MaterialButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Options"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
@@ -302,7 +302,7 @@ class MATERIAL_PT_options(MaterialButtonsPanel):
|
||||
col.prop(mat, "object_color")
|
||||
|
||||
|
||||
class MATERIAL_PT_shadow(MaterialButtonsPanel):
|
||||
class MATERIAL_PT_shadow(MaterialButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Shadow"
|
||||
bl_default_closed = True
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
@@ -339,8 +339,7 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel):
|
||||
sub.prop(mat, "shadow_ray_bias", text="Ray Bias")
|
||||
col.prop(mat, "cast_approximate")
|
||||
|
||||
|
||||
class MATERIAL_PT_diffuse(MaterialButtonsPanel):
|
||||
class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Diffuse"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
@@ -411,7 +410,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
|
||||
row.prop(mat, "diffuse_ramp_factor", text="Factor")
|
||||
|
||||
|
||||
class MATERIAL_PT_specular(MaterialButtonsPanel):
|
||||
class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Specular"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
@@ -480,7 +479,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
|
||||
row.prop(mat, "specular_ramp_factor", text="Factor")
|
||||
|
||||
|
||||
class MATERIAL_PT_sss(MaterialButtonsPanel):
|
||||
class MATERIAL_PT_sss(MaterialButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Subsurface Scattering"
|
||||
bl_default_closed = True
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
@@ -532,7 +531,7 @@ class MATERIAL_PT_sss(MaterialButtonsPanel):
|
||||
col.prop(sss, "error_tolerance", text="Error")
|
||||
|
||||
|
||||
class MATERIAL_PT_mirror(MaterialButtonsPanel):
|
||||
class MATERIAL_PT_mirror(MaterialButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Mirror"
|
||||
bl_default_closed = True
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
@@ -592,7 +591,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel):
|
||||
sub.prop(raym, "gloss_anisotropic", text="Anisotropic")
|
||||
|
||||
|
||||
class MATERIAL_PT_transp(MaterialButtonsPanel):
|
||||
class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Transparency"
|
||||
bl_default_closed = True
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
@@ -659,7 +658,7 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
|
||||
sub.prop(rayt, "gloss_samples", text="Samples")
|
||||
|
||||
|
||||
class MATERIAL_PT_transp_game(MaterialButtonsPanel):
|
||||
class MATERIAL_PT_transp_game(MaterialButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Transparency"
|
||||
bl_default_closed = True
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
@@ -694,7 +693,7 @@ class MATERIAL_PT_transp_game(MaterialButtonsPanel):
|
||||
col.prop(mat, "alpha")
|
||||
|
||||
|
||||
class MATERIAL_PT_halo(MaterialButtonsPanel):
|
||||
class MATERIAL_PT_halo(MaterialButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Halo"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
@@ -744,7 +743,7 @@ class MATERIAL_PT_halo(MaterialButtonsPanel):
|
||||
sub.prop(halo, "star_tips")
|
||||
|
||||
|
||||
class MATERIAL_PT_flare(MaterialButtonsPanel):
|
||||
class MATERIAL_PT_flare(MaterialButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Flare"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
@@ -779,7 +778,7 @@ class MATERIAL_PT_flare(MaterialButtonsPanel):
|
||||
col.prop(halo, "flare_subsize", text="Subsize")
|
||||
|
||||
|
||||
class VolumeButtonsPanel(bpy.types.Panel):
|
||||
class VolumeButtonsPanel():
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "material"
|
||||
@@ -790,7 +789,7 @@ class VolumeButtonsPanel(bpy.types.Panel):
|
||||
return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
|
||||
|
||||
|
||||
class MATERIAL_PT_volume_density(VolumeButtonsPanel):
|
||||
class MATERIAL_PT_volume_density(VolumeButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Density"
|
||||
bl_default_closed = False
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
@@ -810,7 +809,7 @@ class MATERIAL_PT_volume_density(VolumeButtonsPanel):
|
||||
col.prop(vol, "density_scale")
|
||||
|
||||
|
||||
class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
|
||||
class MATERIAL_PT_volume_shading(VolumeButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Shading"
|
||||
bl_default_closed = False
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
@@ -838,7 +837,7 @@ class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
|
||||
sub.prop(vol, "reflection_color", text="")
|
||||
|
||||
|
||||
class MATERIAL_PT_volume_lighting(VolumeButtonsPanel):
|
||||
class MATERIAL_PT_volume_lighting(VolumeButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Lighting"
|
||||
bl_default_closed = False
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
@@ -876,7 +875,7 @@ class MATERIAL_PT_volume_lighting(VolumeButtonsPanel):
|
||||
sub.prop(vol, "ms_intensity")
|
||||
|
||||
|
||||
class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
|
||||
class MATERIAL_PT_volume_transp(VolumeButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Transparency"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
@@ -892,7 +891,7 @@ class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
|
||||
layout.prop(mat, "transparency_method", text="")
|
||||
|
||||
|
||||
class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
|
||||
class MATERIAL_PT_volume_integration(VolumeButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Integration"
|
||||
bl_default_closed = False
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
@@ -917,7 +916,7 @@ class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
|
||||
col.prop(vol, "depth_cutoff")
|
||||
|
||||
|
||||
class MATERIAL_PT_volume_options(VolumeButtonsPanel):
|
||||
class MATERIAL_PT_volume_options(VolumeButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Options"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
bl_default_closed = True
|
||||
@@ -943,46 +942,12 @@ class MATERIAL_PT_volume_options(VolumeButtonsPanel):
|
||||
row.prop(mat, "light_group_exclusive", text="Exclusive")
|
||||
|
||||
|
||||
classes = [
|
||||
MATERIAL_PT_context_material,
|
||||
MATERIAL_PT_preview,
|
||||
MATERIAL_PT_diffuse,
|
||||
MATERIAL_PT_specular,
|
||||
MATERIAL_PT_shading,
|
||||
MATERIAL_PT_transp,
|
||||
MATERIAL_PT_mirror,
|
||||
MATERIAL_PT_sss,
|
||||
MATERIAL_PT_halo,
|
||||
MATERIAL_PT_flare,
|
||||
MATERIAL_PT_physics,
|
||||
MATERIAL_PT_strand,
|
||||
MATERIAL_PT_options,
|
||||
MATERIAL_PT_shadow,
|
||||
MATERIAL_PT_transp_game,
|
||||
|
||||
MATERIAL_MT_sss_presets,
|
||||
MATERIAL_MT_specials,
|
||||
|
||||
MATERIAL_PT_volume_density,
|
||||
MATERIAL_PT_volume_shading,
|
||||
MATERIAL_PT_volume_lighting,
|
||||
MATERIAL_PT_volume_transp,
|
||||
MATERIAL_PT_volume_integration,
|
||||
MATERIAL_PT_volume_options,
|
||||
|
||||
MATERIAL_PT_custom_props]
|
||||
|
||||
|
||||
def register():
|
||||
register = bpy.types.register
|
||||
for cls in classes:
|
||||
register(cls)
|
||||
pass
|
||||
|
||||
|
||||
def unregister():
|
||||
unregister = bpy.types.unregister
|
||||
for cls in classes:
|
||||
unregister(cls)
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
register()
|
||||
|
Reference in New Issue
Block a user