From a705f6424567873b64f6309311106ec1e918b4e0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 17 Jul 2009 12:26:40 +0000 Subject: python access to operators now hides the _OT_ syntax, eg. SOME_OT_operator -> some.operator this works for the calling operators from python and using the RNA api. bpy.ops.CONSOLE_exec() is now bpy.ops.console.exec() eg. split.itemO("PARTICLE_OT_editable_set", text="Free Edit") becomes... split.itemO("particle.editable_set", text="Free Edit") For now any operator thats called checks if its missing _OT_ and assumes its python syntax and converts it before doing the lookup. bpy.ops is a python class in release/ui/bpy_ops.py which does the fake submodules and conversion, the C operator api is at bpy.__ops__ personally Id still rather rename C id-names not to contain the _OT_ text which would avoid the conversion, its called a lot since the UI has to convert the operators. --- release/ui/space_filebrowser.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'release/ui/space_filebrowser.py') diff --git a/release/ui/space_filebrowser.py b/release/ui/space_filebrowser.py index 0c37e8c0816..b0aaae8f0a5 100644 --- a/release/ui/space_filebrowser.py +++ b/release/ui/space_filebrowser.py @@ -19,10 +19,10 @@ class FILEBROWSER_HT_header(bpy.types.Header): row.itemM("FILEBROWSER_MT_bookmarks") row = layout.row(align=True) - row.itemO("FILE_OT_parent", text="", icon='ICON_FILE_PARENT') - row.itemO("FILE_OT_refresh", text="", icon='ICON_FILE_REFRESH') - row.itemO("FILE_OT_previous", text="", icon='ICON_PREV_KEYFRAME') - row.itemO("FILE_OT_next", text="", icon='ICON_NEXT_KEYFRAME') + row.itemO("file.parent", text="", icon='ICON_FILE_PARENT') + row.itemO("file.refresh", text="", icon='ICON_FILE_REFRESH') + row.itemO("file.previous", text="", icon='ICON_PREV_KEYFRAME') + row.itemO("file.next", text="", icon='ICON_NEXT_KEYFRAME') layout.itemR(params, "display", expand=True, text="") layout.itemR(params, "sort", expand=True, text="") @@ -49,8 +49,8 @@ class FILEBROWSER_MT_directory(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.itemO("FILE_OT_refresh", text="Refresh", icon='ICON_FILE_REFRESH') - layout.itemO("FILE_OT_parent", text="Parent", icon='ICON_FILE_PARENT') + layout.itemO("file.refresh", text="Refresh", icon='ICON_FILE_REFRESH') + layout.itemO("file.parent", text="Parent", icon='ICON_FILE_PARENT') class FILEBROWSER_MT_bookmarks(bpy.types.Menu): __space_type__ = "FILE_BROWSER" @@ -59,7 +59,7 @@ class FILEBROWSER_MT_bookmarks(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.itemO("FILE_OT_add_bookmark", text="Add current directory", icon='ICON_BOOKMARKS') + layout.itemO("file.add_bookmark", text="Add current directory", icon='ICON_BOOKMARKS') bpy.types.register(FILEBROWSER_HT_header) -- cgit v1.2.3