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:
@@ -22,7 +22,7 @@ import bpy
|
||||
narrowui = bpy.context.user_preferences.view.properties_width_check
|
||||
|
||||
|
||||
class PhysicsButtonsPanel(bpy.types.Panel):
|
||||
class PhysicsButtonsPanel():
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "physics"
|
||||
@@ -33,7 +33,7 @@ class PhysicsButtonsPanel(bpy.types.Panel):
|
||||
return ob and ob.game and (rd.engine in self.COMPAT_ENGINES)
|
||||
|
||||
|
||||
class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
|
||||
class PHYSICS_PT_game_physics(PhysicsButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Physics"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
@@ -162,7 +162,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
|
||||
layout.prop(ob, "hide_render", text="Invisible")
|
||||
|
||||
|
||||
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
|
||||
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Collision Bounds"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
@@ -198,7 +198,7 @@ class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
|
||||
col.prop(game, "collision_compound", text="Compound")
|
||||
|
||||
|
||||
class RenderButtonsPanel(bpy.types.Panel):
|
||||
class RenderButtonsPanel():
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "render"
|
||||
@@ -208,7 +208,7 @@ class RenderButtonsPanel(bpy.types.Panel):
|
||||
return (rd.engine in self.COMPAT_ENGINES)
|
||||
|
||||
|
||||
class RENDER_PT_game(RenderButtonsPanel):
|
||||
class RENDER_PT_game(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Game"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
@@ -220,7 +220,7 @@ class RENDER_PT_game(RenderButtonsPanel):
|
||||
row.label()
|
||||
|
||||
|
||||
class RENDER_PT_game_player(RenderButtonsPanel):
|
||||
class RENDER_PT_game_player(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Standalone Player"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
@@ -258,7 +258,7 @@ class RENDER_PT_game_player(RenderButtonsPanel):
|
||||
col.prop(gs, "framing_color", text="")
|
||||
|
||||
|
||||
class RENDER_PT_game_stereo(RenderButtonsPanel):
|
||||
class RENDER_PT_game_stereo(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Stereo"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
@@ -318,7 +318,7 @@ class RENDER_PT_game_stereo(RenderButtonsPanel):
|
||||
layout.prop(gs, "dome_text")
|
||||
|
||||
|
||||
class RENDER_PT_game_shading(RenderButtonsPanel):
|
||||
class RENDER_PT_game_shading(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Shading"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
@@ -347,7 +347,7 @@ class RENDER_PT_game_shading(RenderButtonsPanel):
|
||||
col.prop(gs, "glsl_extra_textures", text="Extra Textures")
|
||||
|
||||
|
||||
class RENDER_PT_game_performance(RenderButtonsPanel):
|
||||
class RENDER_PT_game_performance(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Performance"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
@@ -373,7 +373,7 @@ class RENDER_PT_game_performance(RenderButtonsPanel):
|
||||
col.prop(gs, "use_display_lists")
|
||||
|
||||
|
||||
class RENDER_PT_game_sound(RenderButtonsPanel):
|
||||
class RENDER_PT_game_sound(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Sound"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
@@ -391,7 +391,7 @@ class RENDER_PT_game_sound(RenderButtonsPanel):
|
||||
layout.prop(scene, "doppler_factor")
|
||||
|
||||
|
||||
class WorldButtonsPanel(bpy.types.Panel):
|
||||
class WorldButtonsPanel():
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "world"
|
||||
@@ -401,7 +401,7 @@ class WorldButtonsPanel(bpy.types.Panel):
|
||||
return (scene.render.engine in self.COMPAT_ENGINES) and (scene.world is not None)
|
||||
|
||||
|
||||
class WORLD_PT_game_context_world(WorldButtonsPanel):
|
||||
class WORLD_PT_game_context_world(WorldButtonsPanel, bpy.types.Panel):
|
||||
bl_label = ""
|
||||
bl_show_header = False
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
@@ -431,7 +431,7 @@ class WORLD_PT_game_context_world(WorldButtonsPanel):
|
||||
layout.template_ID(space, "pin_id")
|
||||
|
||||
|
||||
class WORLD_PT_game_world(WorldButtonsPanel):
|
||||
class WORLD_PT_game_world(WorldButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "World"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
@@ -451,7 +451,7 @@ class WORLD_PT_game_world(WorldButtonsPanel):
|
||||
col.prop(world, "ambient_color")
|
||||
|
||||
|
||||
class WORLD_PT_game_mist(WorldButtonsPanel):
|
||||
class WORLD_PT_game_mist(WorldButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Mist"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
@@ -477,7 +477,7 @@ class WORLD_PT_game_mist(WorldButtonsPanel):
|
||||
col.prop(world.mist, "depth")
|
||||
|
||||
|
||||
class WORLD_PT_game_physics(WorldButtonsPanel):
|
||||
class WORLD_PT_game_physics(WorldButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Physics"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
@@ -523,33 +523,12 @@ class WORLD_PT_game_physics(WorldButtonsPanel):
|
||||
col.prop(gs, "logic_step_max", text="Max")
|
||||
|
||||
|
||||
classes = [
|
||||
PHYSICS_PT_game_physics,
|
||||
PHYSICS_PT_game_collision_bounds,
|
||||
|
||||
RENDER_PT_game,
|
||||
RENDER_PT_game_player,
|
||||
RENDER_PT_game_stereo,
|
||||
RENDER_PT_game_shading,
|
||||
RENDER_PT_game_performance,
|
||||
RENDER_PT_game_sound,
|
||||
|
||||
WORLD_PT_game_context_world,
|
||||
WORLD_PT_game_world,
|
||||
WORLD_PT_game_mist,
|
||||
WORLD_PT_game_physics]
|
||||
|
||||
|
||||
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