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 | |
parent | 6e1e6383135689091d9d43462d86a8090ab5b82b (diff) |
rna context rename
* context.main & bpy.types.Main --> context.blend_data & bpy.types.BlendData
* context.manager --> context.window_manager
24 files changed, 48 insertions, 49 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 diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index 24dcb4c5846..7928424e47c 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -701,7 +701,7 @@ Main *CTX_data_main(const bContext *C) { Main *bmain; - if(ctx_data_pointer_verify(C, "main", (void*)&bmain)) + if(ctx_data_pointer_verify(C, "blend_data", (void*)&bmain)) return bmain; else return C->data.main; diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 43697ec5d9e..e454dda0ae6 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -276,7 +276,7 @@ extern StructRNA RNA_LimitScaleConstraint; extern StructRNA RNA_LockedTrackConstraint; extern StructRNA RNA_Macro; extern StructRNA RNA_MagicTexture; -extern StructRNA RNA_Main; +extern StructRNA RNA_BlendData; extern StructRNA RNA_MarbleTexture; extern StructRNA RNA_MaskModifier; extern StructRNA RNA_Material; diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 4be9502d79a..51ad6e55ddd 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -95,7 +95,7 @@ PointerRNA PointerRNA_NULL = {{0}, 0, 0}; void RNA_main_pointer_create(struct Main *main, PointerRNA *r_ptr) { r_ptr->id.data= NULL; - r_ptr->type= &RNA_Main; + r_ptr->type= &RNA_BlendData; r_ptr->data= main; } diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c index 6cc93d088ad..ebe0e363b26 100644 --- a/source/blender/makesrna/intern/rna_context.c +++ b/source/blender/makesrna/intern/rna_context.c @@ -93,7 +93,7 @@ static PointerRNA rna_Context_region_data_get(PointerRNA *ptr) static PointerRNA rna_Context_main_get(PointerRNA *ptr) { bContext *C= (bContext*)ptr->data; - return rna_pointer_inherit_refine(ptr, &RNA_Main, CTX_data_main(C)); + return rna_pointer_inherit_refine(ptr, &RNA_BlendData, CTX_data_main(C)); } static PointerRNA rna_Context_scene_get(PointerRNA *ptr) @@ -151,7 +151,7 @@ void RNA_def_context(BlenderRNA *brna) RNA_def_struct_sdna(srna, "bContext"); /* WM */ - prop= RNA_def_property(srna, "manager", PROP_POINTER, PROP_NONE); + prop= RNA_def_property(srna, "window_manager", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "WindowManager"); RNA_def_property_pointer_funcs(prop, "rna_Context_manager_get", NULL, NULL, NULL); @@ -187,9 +187,9 @@ void RNA_def_context(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, "rna_Context_region_data_get", NULL, NULL, NULL); /* Data */ - prop= RNA_def_property(srna, "main", PROP_POINTER, PROP_NONE); + prop= RNA_def_property(srna, "blend_data", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_struct_type(prop, "Main"); + RNA_def_property_struct_type(prop, "BlendData"); RNA_def_property_pointer_funcs(prop, "rna_Context_main_get", NULL, NULL, NULL); prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index b59f23d3e1f..99758b8f0fe 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -302,8 +302,8 @@ void RNA_def_main(BlenderRNA *brna) int i; - srna= RNA_def_struct(brna, "Main", NULL); - RNA_def_struct_ui_text(srna, "Main", "Main data structure representing a .blend file and all its datablocks"); + srna= RNA_def_struct(brna, "BlendData", NULL); + RNA_def_struct_ui_text(srna, "Blendfile Data", "Main data structure representing a .blend file and all its datablocks"); RNA_def_struct_ui_icon(srna, ICON_BLENDER); prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c index d65d0b6039a..067567b9cda 100644 --- a/source/blender/modifiers/intern/MOD_screw.c +++ b/source/blender/modifiers/intern/MOD_screw.c @@ -436,7 +436,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, vc= vert_connect; for (i=0; i < totvert; i++, vc++) { int v_best=-1, ed_loop_closed=0; /* vert and vert new */ - int ed_loop_flip; + int ed_loop_flip= 0; /* compiler complains if not initialized, but it should be initialized below */ float fl= -1.0f; ScrewVertIter lt_iter; |