import common classes from bpy.types, saves ~1000 python getattrs on startup.
This commit is contained in:
@@ -19,13 +19,14 @@
|
||||
# <pep8 compliant>
|
||||
|
||||
import bpy
|
||||
from bpy.types import Menu, Operator
|
||||
from bpy.props import StringProperty, BoolProperty, IntProperty, \
|
||||
FloatProperty, EnumProperty
|
||||
|
||||
from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear
|
||||
|
||||
|
||||
class MESH_OT_delete_edgeloop(bpy.types.Operator):
|
||||
class MESH_OT_delete_edgeloop(Operator):
|
||||
'''Delete an edge loop by merging the faces on each side to a single face loop'''
|
||||
bl_idname = "mesh.delete_edgeloop"
|
||||
bl_label = "Delete Edge Loop"
|
||||
@@ -76,7 +77,7 @@ def execute_context_assign(self, context):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class BRUSH_OT_active_index_set(bpy.types.Operator):
|
||||
class BRUSH_OT_active_index_set(Operator):
|
||||
'''Set active sculpt/paint brush from it's number'''
|
||||
bl_idname = "brush.active_index_set"
|
||||
bl_label = "Set Brush Number"
|
||||
@@ -104,7 +105,7 @@ class BRUSH_OT_active_index_set(bpy.types.Operator):
|
||||
return {'CANCELLED'}
|
||||
|
||||
|
||||
class WM_OT_context_set_boolean(bpy.types.Operator):
|
||||
class WM_OT_context_set_boolean(Operator):
|
||||
'''Set a context value.'''
|
||||
bl_idname = "wm.context_set_boolean"
|
||||
bl_label = "Context Set Boolean"
|
||||
@@ -117,7 +118,7 @@ class WM_OT_context_set_boolean(bpy.types.Operator):
|
||||
execute = execute_context_assign
|
||||
|
||||
|
||||
class WM_OT_context_set_int(bpy.types.Operator): # same as enum
|
||||
class WM_OT_context_set_int(Operator): # same as enum
|
||||
'''Set a context value.'''
|
||||
bl_idname = "wm.context_set_int"
|
||||
bl_label = "Context Set"
|
||||
@@ -130,7 +131,7 @@ class WM_OT_context_set_int(bpy.types.Operator): # same as enum
|
||||
execute = execute_context_assign
|
||||
|
||||
|
||||
class WM_OT_context_scale_int(bpy.types.Operator):
|
||||
class WM_OT_context_scale_int(Operator):
|
||||
'''Scale an int context value.'''
|
||||
bl_idname = "wm.context_scale_int"
|
||||
bl_label = "Context Set"
|
||||
@@ -166,7 +167,7 @@ class WM_OT_context_scale_int(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_context_set_float(bpy.types.Operator): # same as enum
|
||||
class WM_OT_context_set_float(Operator): # same as enum
|
||||
'''Set a context value.'''
|
||||
bl_idname = "wm.context_set_float"
|
||||
bl_label = "Context Set Float"
|
||||
@@ -180,7 +181,7 @@ class WM_OT_context_set_float(bpy.types.Operator): # same as enum
|
||||
execute = execute_context_assign
|
||||
|
||||
|
||||
class WM_OT_context_set_string(bpy.types.Operator): # same as enum
|
||||
class WM_OT_context_set_string(Operator): # same as enum
|
||||
'''Set a context value.'''
|
||||
bl_idname = "wm.context_set_string"
|
||||
bl_label = "Context Set String"
|
||||
@@ -193,7 +194,7 @@ class WM_OT_context_set_string(bpy.types.Operator): # same as enum
|
||||
execute = execute_context_assign
|
||||
|
||||
|
||||
class WM_OT_context_set_enum(bpy.types.Operator):
|
||||
class WM_OT_context_set_enum(Operator):
|
||||
'''Set a context value.'''
|
||||
bl_idname = "wm.context_set_enum"
|
||||
bl_label = "Context Set Enum"
|
||||
@@ -207,7 +208,7 @@ class WM_OT_context_set_enum(bpy.types.Operator):
|
||||
execute = execute_context_assign
|
||||
|
||||
|
||||
class WM_OT_context_set_value(bpy.types.Operator):
|
||||
class WM_OT_context_set_value(Operator):
|
||||
'''Set a context value.'''
|
||||
bl_idname = "wm.context_set_value"
|
||||
bl_label = "Context Set Value"
|
||||
@@ -225,7 +226,7 @@ class WM_OT_context_set_value(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_context_toggle(bpy.types.Operator):
|
||||
class WM_OT_context_toggle(Operator):
|
||||
'''Toggle a context value.'''
|
||||
bl_idname = "wm.context_toggle"
|
||||
bl_label = "Context Toggle"
|
||||
@@ -244,7 +245,7 @@ class WM_OT_context_toggle(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_context_toggle_enum(bpy.types.Operator):
|
||||
class WM_OT_context_toggle_enum(Operator):
|
||||
'''Toggle a context value.'''
|
||||
bl_idname = "wm.context_toggle_enum"
|
||||
bl_label = "Context Toggle Values"
|
||||
@@ -270,7 +271,7 @@ class WM_OT_context_toggle_enum(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_context_cycle_int(bpy.types.Operator):
|
||||
class WM_OT_context_cycle_int(Operator):
|
||||
'''Set a context value. Useful for cycling active material, '''
|
||||
'''vertex keys, groups' etc.'''
|
||||
bl_idname = "wm.context_cycle_int"
|
||||
@@ -305,7 +306,7 @@ class WM_OT_context_cycle_int(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_context_cycle_enum(bpy.types.Operator):
|
||||
class WM_OT_context_cycle_enum(Operator):
|
||||
'''Toggle a context value.'''
|
||||
bl_idname = "wm.context_cycle_enum"
|
||||
bl_label = "Context Enum Cycle"
|
||||
@@ -357,7 +358,7 @@ class WM_OT_context_cycle_enum(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_context_cycle_array(bpy.types.Operator):
|
||||
class WM_OT_context_cycle_array(Operator):
|
||||
'''Set a context array value.
|
||||
Useful for cycling the active mesh edit mode.'''
|
||||
bl_idname = "wm.context_cycle_array"
|
||||
@@ -385,7 +386,7 @@ class WM_OT_context_cycle_array(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_MT_context_menu_enum(bpy.types.Menu):
|
||||
class WM_MT_context_menu_enum(Menu):
|
||||
bl_label = ""
|
||||
data_path = "" # BAD DESIGN, set from operator below.
|
||||
|
||||
@@ -405,7 +406,7 @@ class WM_MT_context_menu_enum(bpy.types.Menu):
|
||||
prop.value = identifier
|
||||
|
||||
|
||||
class WM_OT_context_menu_enum(bpy.types.Operator):
|
||||
class WM_OT_context_menu_enum(Operator):
|
||||
bl_idname = "wm.context_menu_enum"
|
||||
bl_label = "Context Enum Menu"
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
@@ -418,7 +419,7 @@ class WM_OT_context_menu_enum(bpy.types.Operator):
|
||||
return {'PASS_THROUGH'}
|
||||
|
||||
|
||||
class WM_OT_context_set_id(bpy.types.Operator):
|
||||
class WM_OT_context_set_id(Operator):
|
||||
'''Toggle a context value.'''
|
||||
bl_idname = "wm.context_set_id"
|
||||
bl_label = "Set Library ID"
|
||||
@@ -466,7 +467,7 @@ data_path_item = StringProperty(
|
||||
description="The data path from each iterable to the value (int or float)")
|
||||
|
||||
|
||||
class WM_OT_context_collection_boolean_set(bpy.types.Operator):
|
||||
class WM_OT_context_collection_boolean_set(Operator):
|
||||
'''Set boolean values for a collection of items'''
|
||||
bl_idname = "wm.context_collection_boolean_set"
|
||||
bl_label = "Context Collection Boolean Set"
|
||||
@@ -520,7 +521,7 @@ class WM_OT_context_collection_boolean_set(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_context_modal_mouse(bpy.types.Operator):
|
||||
class WM_OT_context_modal_mouse(Operator):
|
||||
'''Adjust arbitrary values with mouse input'''
|
||||
bl_idname = "wm.context_modal_mouse"
|
||||
bl_label = "Context Modal Mouse"
|
||||
@@ -607,7 +608,7 @@ class WM_OT_context_modal_mouse(bpy.types.Operator):
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
|
||||
class WM_OT_url_open(bpy.types.Operator):
|
||||
class WM_OT_url_open(Operator):
|
||||
"Open a website in the Webbrowser"
|
||||
bl_idname = "wm.url_open"
|
||||
bl_label = ""
|
||||
@@ -621,7 +622,7 @@ class WM_OT_url_open(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_path_open(bpy.types.Operator):
|
||||
class WM_OT_path_open(Operator):
|
||||
"Open a path in a file browser"
|
||||
bl_idname = "wm.path_open"
|
||||
bl_label = ""
|
||||
@@ -654,7 +655,7 @@ class WM_OT_path_open(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_doc_view(bpy.types.Operator):
|
||||
class WM_OT_doc_view(Operator):
|
||||
'''Load online reference docs'''
|
||||
bl_idname = "wm.doc_view"
|
||||
bl_label = "View Documentation"
|
||||
@@ -708,7 +709,7 @@ class WM_OT_doc_view(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_doc_edit(bpy.types.Operator):
|
||||
class WM_OT_doc_edit(Operator):
|
||||
'''Load online reference docs'''
|
||||
bl_idname = "wm.doc_edit"
|
||||
bl_label = "Edit Documentation"
|
||||
@@ -792,7 +793,7 @@ rna_min = FloatProperty(name="Min", default=0.0, precision=3)
|
||||
rna_max = FloatProperty(name="Max", default=1.0, precision=3)
|
||||
|
||||
|
||||
class WM_OT_properties_edit(bpy.types.Operator):
|
||||
class WM_OT_properties_edit(Operator):
|
||||
'''Internal use (edit a property data_path)'''
|
||||
bl_idname = "wm.properties_edit"
|
||||
bl_label = "Edit Property"
|
||||
@@ -876,7 +877,7 @@ class WM_OT_properties_edit(bpy.types.Operator):
|
||||
return wm.invoke_props_dialog(self)
|
||||
|
||||
|
||||
class WM_OT_properties_add(bpy.types.Operator):
|
||||
class WM_OT_properties_add(Operator):
|
||||
'''Internal use (edit a property data_path)'''
|
||||
bl_idname = "wm.properties_add"
|
||||
bl_label = "Add Property"
|
||||
@@ -902,7 +903,7 @@ class WM_OT_properties_add(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_properties_context_change(bpy.types.Operator):
|
||||
class WM_OT_properties_context_change(Operator):
|
||||
"Change the context tab in a Properties Window"
|
||||
bl_idname = "wm.properties_context_change"
|
||||
bl_label = ""
|
||||
@@ -914,7 +915,7 @@ class WM_OT_properties_context_change(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_properties_remove(bpy.types.Operator):
|
||||
class WM_OT_properties_remove(Operator):
|
||||
'''Internal use (edit a property data_path)'''
|
||||
bl_idname = "wm.properties_remove"
|
||||
bl_label = "Remove Property"
|
||||
@@ -928,7 +929,7 @@ class WM_OT_properties_remove(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_keyconfig_activate(bpy.types.Operator):
|
||||
class WM_OT_keyconfig_activate(Operator):
|
||||
bl_idname = "wm.keyconfig_activate"
|
||||
bl_label = "Activate Keyconfig"
|
||||
|
||||
@@ -939,7 +940,7 @@ class WM_OT_keyconfig_activate(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_appconfig_default(bpy.types.Operator):
|
||||
class WM_OT_appconfig_default(Operator):
|
||||
bl_idname = "wm.appconfig_default"
|
||||
bl_label = "Default Application Configuration"
|
||||
|
||||
@@ -956,7 +957,7 @@ class WM_OT_appconfig_default(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_appconfig_activate(bpy.types.Operator):
|
||||
class WM_OT_appconfig_activate(Operator):
|
||||
bl_idname = "wm.appconfig_activate"
|
||||
bl_label = "Activate Application Configuration"
|
||||
|
||||
@@ -974,7 +975,7 @@ class WM_OT_appconfig_activate(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_sysinfo(bpy.types.Operator):
|
||||
class WM_OT_sysinfo(Operator):
|
||||
'''Generate System Info'''
|
||||
bl_idname = "wm.sysinfo"
|
||||
bl_label = "System Info"
|
||||
@@ -985,7 +986,7 @@ class WM_OT_sysinfo(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_copy_prev_settings(bpy.types.Operator):
|
||||
class WM_OT_copy_prev_settings(Operator):
|
||||
'''Copy settings from previous version'''
|
||||
bl_idname = "wm.copy_prev_settings"
|
||||
bl_label = "Copy Previous Settings"
|
||||
|
||||
Reference in New Issue
Block a user