import common classes from bpy.types, saves ~1000 python getattrs on startup.

This commit is contained in:
2011-08-12 06:57:00 +00:00
parent 8fd246cb70
commit b374ab919a
59 changed files with 624 additions and 565 deletions

View File

@@ -18,9 +18,10 @@
# <pep8 compliant>
import bpy
from bpy.types import Header, Menu, Operator
class INFO_HT_header(bpy.types.Header):
class INFO_HT_header(Header):
bl_space_type = 'INFO'
def draw(self, context):
@@ -86,7 +87,7 @@ class INFO_HT_header(bpy.types.Header):
"""
class INFO_MT_report(bpy.types.Menu):
class INFO_MT_report(Menu):
bl_label = "Report"
def draw(self, context):
@@ -98,7 +99,7 @@ class INFO_MT_report(bpy.types.Menu):
layout.operator("console.report_copy")
class INFO_MT_file(bpy.types.Menu):
class INFO_MT_file(Menu):
bl_label = "File"
def draw(self, context):
@@ -152,7 +153,7 @@ class INFO_MT_file(bpy.types.Menu):
layout.operator("wm.quit_blender", text="Quit", icon='QUIT')
class INFO_MT_file_import(bpy.types.Menu):
class INFO_MT_file_import(Menu):
bl_idname = "INFO_MT_file_import"
bl_label = "Import"
@@ -161,7 +162,7 @@ class INFO_MT_file_import(bpy.types.Menu):
self.layout.operator("wm.collada_import", text="COLLADA (.dae)")
class INFO_MT_file_export(bpy.types.Menu):
class INFO_MT_file_export(Menu):
bl_idname = "INFO_MT_file_export"
bl_label = "Export"
@@ -170,7 +171,7 @@ class INFO_MT_file_export(bpy.types.Menu):
self.layout.operator("wm.collada_export", text="COLLADA (.dae)")
class INFO_MT_file_external_data(bpy.types.Menu):
class INFO_MT_file_external_data(Menu):
bl_label = "External Data"
def draw(self, context):
@@ -187,7 +188,7 @@ class INFO_MT_file_external_data(bpy.types.Menu):
layout.operator("file.find_missing_files")
class INFO_MT_mesh_add(bpy.types.Menu):
class INFO_MT_mesh_add(Menu):
bl_idname = "INFO_MT_mesh_add"
bl_label = "Mesh"
@@ -207,7 +208,7 @@ class INFO_MT_mesh_add(bpy.types.Menu):
layout.operator("mesh.primitive_torus_add", text="Torus", icon='MESH_TORUS')
class INFO_MT_curve_add(bpy.types.Menu):
class INFO_MT_curve_add(Menu):
bl_idname = "INFO_MT_curve_add"
bl_label = "Curve"
@@ -221,7 +222,7 @@ class INFO_MT_curve_add(bpy.types.Menu):
layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text="Path")
class INFO_MT_edit_curve_add(bpy.types.Menu):
class INFO_MT_edit_curve_add(Menu):
bl_idname = "INFO_MT_edit_curve_add"
bl_label = "Add"
@@ -237,7 +238,7 @@ class INFO_MT_edit_curve_add(bpy.types.Menu):
INFO_MT_curve_add.draw(self, context)
class INFO_MT_surface_add(bpy.types.Menu):
class INFO_MT_surface_add(Menu):
bl_idname = "INFO_MT_surface_add"
bl_label = "Surface"
@@ -252,7 +253,7 @@ class INFO_MT_surface_add(bpy.types.Menu):
layout.operator("surface.primitive_nurbs_surface_torus_add", icon='SURFACE_NTORUS', text="NURBS Torus")
class INFO_MT_armature_add(bpy.types.Menu):
class INFO_MT_armature_add(Menu):
bl_idname = "INFO_MT_armature_add"
bl_label = "Armature"
@@ -262,7 +263,7 @@ class INFO_MT_armature_add(bpy.types.Menu):
layout.operator("object.armature_add", text="Single Bone", icon='BONE_DATA')
class INFO_MT_add(bpy.types.Menu):
class INFO_MT_add(Menu):
bl_label = "Add"
def draw(self, context):
@@ -302,7 +303,7 @@ class INFO_MT_add(bpy.types.Menu):
layout.operator_menu_enum("object.group_instance_add", "group", text="Group Instance", icon='OUTLINER_OB_EMPTY')
class INFO_MT_game(bpy.types.Menu):
class INFO_MT_game(Menu):
bl_label = "Game"
def draw(self, context):
@@ -323,7 +324,7 @@ class INFO_MT_game(bpy.types.Menu):
layout.prop(gs, "use_auto_start")
class INFO_MT_render(bpy.types.Menu):
class INFO_MT_render(Menu):
bl_label = "Render"
def draw(self, context):
@@ -343,7 +344,7 @@ class INFO_MT_render(bpy.types.Menu):
layout.operator("render.play_rendered_anim")
class INFO_MT_help(bpy.types.Menu):
class INFO_MT_help(Menu):
bl_label = "Help"
def draw(self, context):
@@ -379,7 +380,7 @@ class INFO_MT_help(bpy.types.Menu):
# Help operators
class HELP_OT_operator_cheat_sheet(bpy.types.Operator):
class HELP_OT_operator_cheat_sheet(Operator):
bl_idname = "help.operator_cheat_sheet"
bl_label = "Operator Cheat Sheet"