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:
@@ -31,7 +31,7 @@ class LAMP_MT_sunsky_presets(bpy.types.Menu):
|
||||
draw = bpy.types.Menu.draw_preset
|
||||
|
||||
|
||||
class DataButtonsPanel(bpy.types.Panel):
|
||||
class DataButtonsPanel():
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "data"
|
||||
@@ -40,16 +40,14 @@ class DataButtonsPanel(bpy.types.Panel):
|
||||
engine = context.scene.render.engine
|
||||
return context.lamp and (engine in self.COMPAT_ENGINES)
|
||||
|
||||
|
||||
class DATA_PT_preview(DataButtonsPanel):
|
||||
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):
|
||||
class DATA_PT_context_lamp(DataButtonsPanel, bpy.types.Panel):
|
||||
bl_label = ""
|
||||
bl_show_header = False
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
@@ -77,12 +75,12 @@ class DATA_PT_context_lamp(DataButtonsPanel):
|
||||
layout.template_ID(space, "pin_id")
|
||||
|
||||
|
||||
class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel):
|
||||
class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
|
||||
_context_path = "object.data"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
|
||||
class DATA_PT_lamp(DataButtonsPanel):
|
||||
class DATA_PT_lamp(DataButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Lamp"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
@@ -129,7 +127,7 @@ class DATA_PT_lamp(DataButtonsPanel):
|
||||
col.prop(lamp, "diffuse")
|
||||
|
||||
|
||||
class DATA_PT_sunsky(DataButtonsPanel):
|
||||
class DATA_PT_sunsky(DataButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Sky & Atmosphere"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
@@ -202,7 +200,7 @@ class DATA_PT_sunsky(DataButtonsPanel):
|
||||
sub.prop(lamp, "atmosphere_extinction", slider=True, text="Extinction")
|
||||
|
||||
|
||||
class DATA_PT_shadow(DataButtonsPanel):
|
||||
class DATA_PT_shadow(DataButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Shadow"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
@@ -327,7 +325,7 @@ class DATA_PT_shadow(DataButtonsPanel):
|
||||
sub.prop(lamp, "shadow_buffer_clip_end", text=" Clip End")
|
||||
|
||||
|
||||
class DATA_PT_area(DataButtonsPanel):
|
||||
class DATA_PT_area(DataButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Area Shape"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
@@ -354,7 +352,7 @@ class DATA_PT_area(DataButtonsPanel):
|
||||
sub.prop(lamp, "size_y", text="Size Y")
|
||||
|
||||
|
||||
class DATA_PT_spot(DataButtonsPanel):
|
||||
class DATA_PT_spot(DataButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Spot Shape"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
@@ -390,7 +388,7 @@ class DATA_PT_spot(DataButtonsPanel):
|
||||
sub.prop(lamp, "halo_step", text="Step")
|
||||
|
||||
|
||||
class DATA_PT_falloff_curve(DataButtonsPanel):
|
||||
class DATA_PT_falloff_curve(DataButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Falloff Curve"
|
||||
bl_default_closed = True
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
@@ -407,31 +405,12 @@ class DATA_PT_falloff_curve(DataButtonsPanel):
|
||||
self.layout.template_curve_mapping(lamp, "falloff_curve")
|
||||
|
||||
|
||||
classes = [
|
||||
LAMP_MT_sunsky_presets,
|
||||
|
||||
DATA_PT_context_lamp,
|
||||
DATA_PT_preview,
|
||||
DATA_PT_lamp,
|
||||
DATA_PT_falloff_curve,
|
||||
DATA_PT_area,
|
||||
DATA_PT_spot,
|
||||
DATA_PT_shadow,
|
||||
DATA_PT_sunsky,
|
||||
|
||||
DATA_PT_custom_props_lamp]
|
||||
|
||||
|
||||
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