diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-02 08:53:05 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-02 08:53:05 +0400 |
commit | ddbfb05c84d1b20df82d8b1264d897dd55006695 (patch) | |
tree | 6cbd6cbc0201aa69c60af750527c114733acfcb8 /release/scripts | |
parent | 6e1e6383135689091d9d43462d86a8090ab5b82b (diff) |
rna context rename
* context.main & bpy.types.Main --> context.blend_data & bpy.types.BlendData
* context.manager --> context.window_manager
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/modules/io_utils.py | 7 | ||||
-rw-r--r-- | release/scripts/op/console_python.py | 2 | ||||
-rw-r--r-- | release/scripts/op/nla.py | 2 | ||||
-rw-r--r-- | release/scripts/op/object.py | 2 | ||||
-rw-r--r-- | release/scripts/op/presets.py | 2 | ||||
-rw-r--r-- | release/scripts/op/uv.py | 2 | ||||
-rw-r--r-- | release/scripts/op/wm.py | 6 | ||||
-rw-r--r-- | release/scripts/presets/interaction/blender.py | 2 | ||||
-rw-r--r-- | release/scripts/presets/interaction/maya.py | 2 | ||||
-rw-r--r-- | release/scripts/templates/operator.py | 2 | ||||
-rw-r--r-- | release/scripts/templates/operator_modal.py | 2 | ||||
-rw-r--r-- | release/scripts/templates/operator_modal_draw.py | 2 | ||||
-rw-r--r-- | release/scripts/templates/operator_modal_view3d.py | 2 | ||||
-rw-r--r-- | release/scripts/ui/properties_data_armature_rigify.py | 2 | ||||
-rw-r--r-- | release/scripts/ui/properties_scene.py | 2 | ||||
-rw-r--r-- | release/scripts/ui/space_info.py | 2 | ||||
-rw-r--r-- | release/scripts/ui/space_userpref.py | 4 | ||||
-rw-r--r-- | release/scripts/ui/space_userpref_keymap.py | 32 |
18 files changed, 38 insertions, 39 deletions
diff --git a/release/scripts/modules/io_utils.py b/release/scripts/modules/io_utils.py index 9492814009e..5150b5153c0 100644 --- a/release/scripts/modules/io_utils.py +++ b/release/scripts/modules/io_utils.py @@ -28,9 +28,9 @@ class ExportHelper: def invoke(self, context, event): import os if not self.properties.is_property_set("filepath"): - self.properties.filepath = os.path.splitext(context.main.filepath)[0] + self.filename_ext + self.properties.filepath = os.path.splitext(context.blend_data.filepath)[0] + self.filename_ext - context.manager.add_fileselect(self) + context.window_manager.add_fileselect(self) return {'RUNNING_MODAL'} @@ -38,8 +38,7 @@ class ImportHelper: filepath = StringProperty(name="File Path", description="Filepath used for importing the file", maxlen= 1024, default= "", subtype='FILE_PATH') def invoke(self, context, event): - wm = context.manager - wm.add_fileselect(self) + context.window_manager.add_fileselect(self) return {'RUNNING_MODAL'} diff --git a/release/scripts/op/console_python.py b/release/scripts/op/console_python.py index 918c31cff04..81046322967 100644 --- a/release/scripts/op/console_python.py +++ b/release/scripts/op/console_python.py @@ -44,7 +44,7 @@ def get_console(console_id): from code import InteractiveConsole consoles = getattr(get_console, "consoles", None) - hash_next = hash(bpy.context.manager) + hash_next = hash(bpy.context.window_manager) if consoles is None: consoles = get_console.consoles = {} diff --git a/release/scripts/op/nla.py b/release/scripts/op/nla.py index 44bd5d91e32..cc48d39188a 100644 --- a/release/scripts/op/nla.py +++ b/release/scripts/op/nla.py @@ -169,7 +169,7 @@ class BakeAction(bpy.types.Operator): return {'FINISHED'} def invoke(self, context, event): - wm = context.manager + wm = context.window_manager return wm.invoke_props_dialog(self) diff --git a/release/scripts/op/object.py b/release/scripts/op/object.py index cb97fb736b9..74b7ed933f6 100644 --- a/release/scripts/op/object.py +++ b/release/scripts/op/object.py @@ -59,7 +59,7 @@ class SelectPattern(bpy.types.Operator): return {'FINISHED'} def invoke(self, context, event): - wm = context.manager + wm = context.window_manager # return wm.invoke_props_popup(self, event) wm.invoke_props_popup(self, event) return {'RUNNING_MODAL'} diff --git a/release/scripts/op/presets.py b/release/scripts/op/presets.py index 4d15d94f408..7364f0021ce 100644 --- a/release/scripts/op/presets.py +++ b/release/scripts/op/presets.py @@ -64,7 +64,7 @@ class AddPresetBase(): return {'FINISHED'} def invoke(self, context, event): - wm = context.manager + wm = context.window_manager #crashes, TODO - fix #return wm.invoke_props_popup(self, event) diff --git a/release/scripts/op/uv.py b/release/scripts/op/uv.py index 238c11d6e06..011deea1f17 100644 --- a/release/scripts/op/uv.py +++ b/release/scripts/op/uv.py @@ -207,7 +207,7 @@ class ExportUVLayout(bpy.types.Operator): return {'FINISHED'} def invoke(self, context, event): - wm = context.manager + wm = context.window_manager wm.add_fileselect(self) return {'RUNNING_MODAL'} diff --git a/release/scripts/op/wm.py b/release/scripts/op/wm.py index cc35a0ab3dd..63acb2bf29b 100644 --- a/release/scripts/op/wm.py +++ b/release/scripts/op/wm.py @@ -449,7 +449,7 @@ class WM_OT_context_modal_mouse(bpy.types.Operator): else: self.properties.initial_x = event.mouse_x - context.manager.add_modal_handler(self) + context.window_manager.add_modal_handler(self) return {'RUNNING_MODAL'} @@ -608,7 +608,7 @@ class WM_OT_doc_edit(bpy.types.Operator): layout.prop(props, "doc_new", text="") def invoke(self, context, event): - wm = context.manager + wm = context.window_manager return wm.invoke_props_dialog(self, width=600) @@ -692,7 +692,7 @@ class WM_OT_properties_edit(bpy.types.Operator): self.properties.max = prop_ui.get("max", 1000000000) self.properties.description = prop_ui.get("description", "") - wm = context.manager + wm = context.window_manager # This crashes, TODO - fix #return wm.invoke_props_popup(self, event) diff --git a/release/scripts/presets/interaction/blender.py b/release/scripts/presets/interaction/blender.py index af905a89b68..7ac9cd1eb0b 100644 --- a/release/scripts/presets/interaction/blender.py +++ b/release/scripts/presets/interaction/blender.py @@ -1,7 +1,7 @@ # Configuration Blender import bpy -wm = bpy.context.manager +wm = bpy.context.window_manager wm.keyconfigs.active = wm.keyconfigs['Blender'] bpy.context.user_preferences.view.use_mouse_auto_depth = False diff --git a/release/scripts/presets/interaction/maya.py b/release/scripts/presets/interaction/maya.py index 0f95616527d..4a40326325e 100644 --- a/release/scripts/presets/interaction/maya.py +++ b/release/scripts/presets/interaction/maya.py @@ -1,7 +1,7 @@ # Configuration Maya import bpy -wm = bpy.context.manager +wm = bpy.context.window_manager kc = wm.keyconfigs.new('Maya') # Map 3D View diff --git a/release/scripts/templates/operator.py b/release/scripts/templates/operator.py index 5a525784b51..423b0b85402 100644 --- a/release/scripts/templates/operator.py +++ b/release/scripts/templates/operator.py @@ -38,7 +38,7 @@ class ExportSomeData(bpy.types.Operator): return {'FINISHED'} def invoke(self, context, event): - wm = context.manager + wm = context.window_manager if True: # File selector diff --git a/release/scripts/templates/operator_modal.py b/release/scripts/templates/operator_modal.py index 0c5db47674b..1e88ef3a3f6 100644 --- a/release/scripts/templates/operator_modal.py +++ b/release/scripts/templates/operator_modal.py @@ -25,7 +25,7 @@ class ModalOperator(bpy.types.Operator): def invoke(self, context, event): if context.object: - context.manager.add_modal_handler(self) + context.window_manager.add_modal_handler(self) self.properties.first_mouse_x = event.mouse_x self.properties.first_value = context.object.location.x return {'RUNNING_MODAL'} diff --git a/release/scripts/templates/operator_modal_draw.py b/release/scripts/templates/operator_modal_draw.py index 56ffb95f555..2a3db3e3018 100644 --- a/release/scripts/templates/operator_modal_draw.py +++ b/release/scripts/templates/operator_modal_draw.py @@ -52,7 +52,7 @@ class ModalDrawOperator(bpy.types.Operator): def invoke(self, context, event): if context.area.type == 'VIEW_3D': - context.manager.add_modal_handler(self) + context.window_manager.add_modal_handler(self) # Add the region OpenGL drawing callback # draw in view space with 'POST_VIEW' and 'PRE_VIEW' diff --git a/release/scripts/templates/operator_modal_view3d.py b/release/scripts/templates/operator_modal_view3d.py index 9b49fd947ad..d7d691dacf2 100644 --- a/release/scripts/templates/operator_modal_view3d.py +++ b/release/scripts/templates/operator_modal_view3d.py @@ -39,7 +39,7 @@ class ViewOperator(bpy.types.Operator): v3d = context.space_data rv3d = v3d.region_3d - context.manager.add_modal_handler(self) + context.window_manager.add_modal_handler(self) if rv3d.view_perspective == 'CAMERA': rv3d.view_perspective = 'PERSP' diff --git a/release/scripts/ui/properties_data_armature_rigify.py b/release/scripts/ui/properties_data_armature_rigify.py index 5903e433a4e..aca41d59d3a 100644 --- a/release/scripts/ui/properties_data_armature_rigify.py +++ b/release/scripts/ui/properties_data_armature_rigify.py @@ -250,7 +250,7 @@ class AsScript(bpy.types.Operator): import os obj = context.object self.properties.filepath = os.path.splitext(bpy.data.filepath)[0] + "-" + bpy.path.clean_name(obj.name) + ".py" - wm = context.manager + wm = context.window_manager wm.add_fileselect(self) return {'RUNNING_MODAL'} diff --git a/release/scripts/ui/properties_scene.py b/release/scripts/ui/properties_scene.py index a26b09f0692..c8c76904829 100644 --- a/release/scripts/ui/properties_scene.py +++ b/release/scripts/ui/properties_scene.py @@ -314,7 +314,7 @@ class ANIM_OT_keying_set_export(bpy.types.Operator): return {'FINISHED'} def invoke(self, context, event): - wm = context.manager + wm = context.window_manager wm.add_fileselect(self) return {'RUNNING_MODAL'} diff --git a/release/scripts/ui/space_info.py b/release/scripts/ui/space_info.py index fd6d2708aa1..d8bd4177098 100644 --- a/release/scripts/ui/space_info.py +++ b/release/scripts/ui/space_info.py @@ -26,7 +26,7 @@ class INFO_HT_header(bpy.types.Header): def draw(self, context): layout = self.layout - wm = context.manager + wm = context.window_manager window = context.window scene = context.scene rd = scene.render diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index a08e2d5ecfd..4870c789aee 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -789,7 +789,7 @@ class USERPREF_PT_input(InputKeyMapPanel): #start = time.time() userpref = context.user_preferences - wm = context.manager + wm = context.window_manager inputs = userpref.inputs @@ -1183,7 +1183,7 @@ class WM_OT_addon_install(bpy.types.Operator): self.report({'ERROR'}, "No 'addons' path could be found in " + str(bpy.utils.script_paths())) return {'CANCELLED'} - wm = context.manager + wm = context.window_manager wm.add_fileselect(self) return {'RUNNING_MODAL'} diff --git a/release/scripts/ui/space_userpref_keymap.py b/release/scripts/ui/space_userpref_keymap.py index bab087b946a..3d76c014694 100644 --- a/release/scripts/ui/space_userpref_keymap.py +++ b/release/scripts/ui/space_userpref_keymap.py @@ -352,7 +352,7 @@ class InputKeyMapPanel(bpy.types.Panel): self.draw_entry(display_keymaps, entry, layout) def draw_keymaps(self, context, layout): - wm = context.manager + wm = context.window_manager kc = wm.keyconfigs.active defkc = wm.keyconfigs.default @@ -486,7 +486,7 @@ class WM_OT_keyconfig_test(bpy.types.Operator): return result def execute(self, context): - wm = context.manager + wm = context.window_manager kc = wm.keyconfigs.default if self.testConfig(kc): @@ -552,23 +552,23 @@ class WM_OT_keyconfig_import(bpy.types.Operator): shutil.move(self.properties.filepath, path) # sneaky way to check we're actually running the code. - wm = context.manager + wm = context.window_manager while config_name in wm.keyconfigs: wm.keyconfigs.remove(wm.keyconfigs[config_name]) - wm = context.manager + wm = context.window_manager totmap = len(wm.keyconfigs) mod = __import__(config_name) if totmap == len(wm.keyconfigs): reload(mod) - wm = bpy.context.manager + wm = bpy.context.window_manager wm.keyconfigs.active = wm.keyconfigs[config_name] return {'FINISHED'} def invoke(self, context, event): - wm = context.manager + wm = context.window_manager wm.add_fileselect(self) return {'RUNNING_MODAL'} @@ -594,7 +594,7 @@ class WM_OT_keyconfig_export(bpy.types.Operator): if not f: raise Exception("Could not open file") - wm = context.manager + wm = context.window_manager kc = wm.keyconfigs.active if self.properties.kc_name != '': @@ -607,7 +607,7 @@ class WM_OT_keyconfig_export(bpy.types.Operator): f.write("# Configuration %s\n" % name) f.write("import bpy\n\n") - f.write("wm = bpy.context.manager\n") + f.write("wm = bpy.context.window_manager\n") f.write("kc = wm.keyconfigs.new('%s')\n\n" % name) # Generate a list of keymaps to export: @@ -667,7 +667,7 @@ class WM_OT_keyconfig_export(bpy.types.Operator): return {'FINISHED'} def invoke(self, context, event): - wm = context.manager + wm = context.window_manager wm.add_fileselect(self) return {'RUNNING_MODAL'} @@ -678,7 +678,7 @@ class WM_OT_keymap_edit(bpy.types.Operator): bl_label = "Edit Key Map" def execute(self, context): - wm = context.manager + wm = context.window_manager km = context.keymap km.copy_to_user() return {'FINISHED'} @@ -692,7 +692,7 @@ class WM_OT_keymap_restore(bpy.types.Operator): all = BoolProperty(attr="all", name="All Keymaps", description="Restore all keymaps to default") def execute(self, context): - wm = context.manager + wm = context.window_manager if self.properties.all: for km in wm.keyconfigs.default.keymaps: @@ -712,7 +712,7 @@ class WM_OT_keyitem_restore(bpy.types.Operator): item_id = IntProperty(attr="item_id", name="Item Identifier", description="Identifier of the item to remove") def execute(self, context): - wm = context.manager + wm = context.window_manager km = context.keymap kmi = km.items.from_id(self.properties.item_id) @@ -727,7 +727,7 @@ class WM_OT_keyitem_add(bpy.types.Operator): bl_label = "Add Key Map Item" def execute(self, context): - wm = context.manager + wm = context.window_manager km = context.keymap kc = wm.keyconfigs.default @@ -753,7 +753,7 @@ class WM_OT_keyitem_remove(bpy.types.Operator): item_id = IntProperty(attr="item_id", name="Item Identifier", description="Identifier of the item to remove") def execute(self, context): - wm = context.manager + wm = context.window_manager km = context.keymap kmi = km.items.from_id(self.properties.item_id) km.items.remove(kmi) @@ -767,12 +767,12 @@ class WM_OT_keyconfig_remove(bpy.types.Operator): @classmethod def poll(cls, context): - wm = context.manager + wm = context.window_manager return wm.keyconfigs.active.is_user_defined def execute(self, context): import sys - wm = context.manager + wm = context.window_manager keyconfig = wm.keyconfigs.active |