Python / Cleanup: rename INFO_MT to TOPBAR_MT/VIEW3D_MT to reflect actual location.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 29 Aug 2018 13:02:21 +0000 (15:02 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 29 Aug 2018 14:25:50 +0000 (16:25 +0200)
17 files changed:
doc/python_api/examples/bpy.types.Menu.2.py
doc/python_api/examples/bpy.types.Operator.2.py
release/scripts/presets/keyconfig/3dsmax.py
release/scripts/presets/keyconfig/blender_27x.py
release/scripts/presets/keyconfig/maya.py
release/scripts/startup/bl_ui/space_topbar.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/templates_py/addon_add_object.py
release/scripts/templates_py/operator_file_export.py
release/scripts/templates_py/operator_file_import.py
release/scripts/templates_py/operator_mesh_add.py
source/blender/editors/armature/armature_ops.c
source/blender/editors/curve/curve_ops.c
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/object/object_ops.c
source/blender/editors/space_info/space_info.c
source/blender/windowmanager/intern/wm_operators.c

index a1cce0c3ce2caff34cef939977063d8a1521908b..fbdf747d472cf81727352cce419b4b96c38a7ba9 100644 (file)
@@ -15,4 +15,4 @@ def menu_draw(self, context):
     self.layout.operator("wm.save_homefile")
 
 
-bpy.types.INFO_MT_file.append(menu_draw)
+bpy.types.TOPBAR_MT_file.append(menu_draw)
index d1f0edf15aaaaf936e6ce86dd67324026b0bd932..901bd7b21f827f7e1757f7fd86a1bb84bc47cc6d 100644 (file)
@@ -45,7 +45,7 @@ def menu_func(self, context):
 
 # Register and add to the file selector
 bpy.utils.register_class(ExportSomeData)
-bpy.types.INFO_MT_file_export.append(menu_func)
+bpy.types.TOPBAR_MT_file_export.append(menu_func)
 
 
 # test call
index 8bce68a0a307aa53282cbedbf033daa32354a30b..fa5d40b1868c191c909c70368094031ce3c6a5bc 100644 (file)
@@ -11,7 +11,7 @@ kmi = km.keymap_items.new('wm.window_new', 'W', 'PRESS', ctrl=True, alt=True)
 kmi = km.keymap_items.new('wm.read_homefile', 'N', 'PRESS', ctrl=True)
 kmi = km.keymap_items.new('wm.save_homefile', 'U', 'PRESS', ctrl=True)
 kmi = km.keymap_items.new('wm.call_menu', 'O', 'PRESS', shift=True, ctrl=True)
-kmi.properties.name = 'INFO_MT_file_open_recent'
+kmi.properties.name = 'TOPBAR_MT_file_open_recent'
 kmi = km.keymap_items.new('wm.open_mainfile', 'O', 'PRESS', ctrl=True)
 kmi = km.keymap_items.new('wm.open_mainfile', 'F1', 'PRESS')
 kmi = km.keymap_items.new('wm.link', 'O', 'PRESS', ctrl=True, alt=True)
@@ -214,7 +214,7 @@ km = kc.keymaps.new('Pose', space_type='EMPTY', region_type='WINDOW', modal=Fals
 
 kmi = km.keymap_items.new('object.parent_set', 'P', 'PRESS', ctrl=True)
 kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True)
-kmi.properties.name = 'INFO_MT_add'
+kmi.properties.name = 'VIEW3D_MT_add'
 kmi = km.keymap_items.new('pose.hide', 'H', 'PRESS')
 kmi.properties.unselected = False
 kmi = km.keymap_items.new('pose.hide', 'H', 'PRESS', shift=True)
@@ -333,7 +333,7 @@ kmi = km.keymap_items.new('object.delete', 'DEL', 'PRESS')
 kmi = km.keymap_items.new('object.delete', 'DEL', 'PRESS', shift=True)
 kmi.properties.use_global = True
 kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True)
-kmi.properties.name = 'INFO_MT_add'
+kmi.properties.name = 'VIEW3D_MT_add'
 kmi = km.keymap_items.new('object.duplicates_make_real', 'A', 'PRESS', shift=True, ctrl=True)
 kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True, ctrl=True)
 kmi.properties.name = 'VIEW3D_MT_object_apply'
@@ -2157,7 +2157,7 @@ kmi = km.keymap_items.new('transform.shrink_fatten', 'S', 'PRESS', alt=True)
 kmi = km.keymap_items.new('mesh.edge_face_add', 'F', 'PRESS', ctrl=True)
 kmi = km.keymap_items.new('mesh.duplicate_move', 'D', 'PRESS', shift=True)
 kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True)
-kmi.properties.name = 'INFO_MT_mesh_add'
+kmi.properties.name = 'VIEW3D_MT_mesh_add'
 kmi = km.keymap_items.new('mesh.separate', 'P', 'PRESS')
 kmi = km.keymap_items.new('mesh.split', 'Y', 'PRESS')
 kmi = km.keymap_items.new('mesh.vert_connect', 'J', 'PRESS')
@@ -2227,7 +2227,7 @@ kmi.properties.value = '(False,False,True)'
 km = kc.keymaps.new('Curve', space_type='EMPTY', region_type='WINDOW', modal=False)
 
 kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True)
-kmi.properties.name = 'INFO_MT_edit_curve_add'
+kmi.properties.name = 'TOPBAR_MT_edit_curve_add'
 kmi = km.keymap_items.new('curve.handle_type_set', 'V', 'PRESS')
 kmi = km.keymap_items.new('curve.vertex_add', 'LEFTMOUSE', 'CLICK', ctrl=True)
 kmi = km.keymap_items.new('curve.select_all', 'LEFTMOUSE', 'CLICK')
index c71b7456cffddab31de3d986b2072872988bb78b..cf736e1a5a5da1e6a2d77b7bf2e8d6ed930735e6 100644 (file)
@@ -8,7 +8,7 @@ keyconfig_data = \
     ("wm.call_menu",
      {"type": 'O', "value": 'PRESS', "shift": True, "ctrl": True},
      {"properties":
-      [("name", 'INFO_MT_file_open_recent'),
+      [("name", 'TOPBAR_MT_file_open_recent'),
        ],
       },
      ),
@@ -1020,7 +1020,7 @@ keyconfig_data = \
     ("wm.call_menu",
      {"type": 'A', "value": 'PRESS', "shift": True},
      {"properties":
-      [("name", 'INFO_MT_add'),
+      [("name", 'VIEW3D_MT_add'),
        ],
       },
      ),
@@ -1321,7 +1321,7 @@ keyconfig_data = \
     ("wm.call_menu",
      {"type": 'A', "value": 'PRESS', "shift": True},
      {"properties":
-      [("name", 'INFO_MT_add'),
+      [("name", 'VIEW3D_MT_add'),
        ],
       },
      ),
@@ -1460,7 +1460,7 @@ keyconfig_data = \
    [("wm.call_menu",
      {"type": 'A', "value": 'PRESS', "shift": True},
      {"properties":
-      [("name", 'INFO_MT_edit_curve_add'),
+      [("name", 'TOPBAR_MT_edit_curve_add'),
        ],
       },
      ),
@@ -3249,7 +3249,7 @@ keyconfig_data = \
     ("wm.call_menu",
      {"type": 'A', "value": 'PRESS', "shift": True},
      {"properties":
-      [("name", 'INFO_MT_mesh_add'),
+      [("name", 'VIEW3D_MT_mesh_add'),
        ],
       },
      ),
index da1446f6f43c60e4cf4fff0ef3f0a668c968b976..676ccb8bec36b86059b9235660439db75294723c 100644 (file)
@@ -12,7 +12,7 @@ kmi = km.keymap_items.new('wm.window_new', 'W', 'PRESS', ctrl=True, alt=True)
 kmi = km.keymap_items.new('wm.read_homefile', 'N', 'PRESS', ctrl=True)
 kmi = km.keymap_items.new('wm.save_homefile', 'U', 'PRESS', ctrl=True)
 kmi = km.keymap_items.new('wm.call_menu', 'O', 'PRESS', shift=True, ctrl=True)
-kmi.properties.name = 'INFO_MT_file_open_recent'
+kmi.properties.name = 'TOPBAR_MT_file_open_recent'
 kmi = km.keymap_items.new('wm.open_mainfile', 'O', 'PRESS', ctrl=True)
 kmi = km.keymap_items.new('wm.open_mainfile', 'F1', 'PRESS')
 kmi = km.keymap_items.new('wm.link', 'O', 'PRESS', ctrl=True, alt=True)
@@ -274,7 +274,7 @@ km = kc.keymaps.new('Pose', space_type='EMPTY', region_type='WINDOW', modal=Fals
 
 kmi = km.keymap_items.new('object.parent_set', 'P', 'PRESS')
 kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True)
-kmi.properties.name = 'INFO_MT_add'
+kmi.properties.name = 'VIEW3D_MT_add'
 kmi = km.keymap_items.new('pose.hide', 'H', 'PRESS', ctrl=True)
 kmi.properties.unselected = False
 kmi = km.keymap_items.new('pose.hide', 'H', 'PRESS', alt=True)
@@ -383,7 +383,7 @@ kmi.properties.unselected = True
 kmi = km.keymap_items.new('object.delete', 'BACK_SPACE', 'PRESS')
 kmi = km.keymap_items.new('object.delete', 'DEL', 'PRESS')
 kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True)
-kmi.properties.name = 'INFO_MT_add'
+kmi.properties.name = 'VIEW3D_MT_add'
 kmi = km.keymap_items.new('object.duplicates_make_real', 'A', 'PRESS', shift=True, ctrl=True)
 kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', ctrl=True, alt=True)
 kmi.properties.name = 'VIEW3D_MT_object_apply'
@@ -650,7 +650,7 @@ kmi = km.keymap_items.new('mesh.merge', 'M', 'PRESS', alt=True)
 kmi = km.keymap_items.new('mesh.edge_face_add', 'F', 'PRESS', alt=True)
 kmi = km.keymap_items.new('mesh.duplicate_move', 'D', 'PRESS', ctrl=True)
 kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True)
-kmi.properties.name = 'INFO_MT_mesh_add'
+kmi.properties.name = 'VIEW3D_MT_mesh_add'
 kmi = km.keymap_items.new('mesh.dupli_extrude_cursor', 'MIDDLEMOUSE', 'CLICK', ctrl=True)
 kmi = km.keymap_items.new('wm.call_menu', 'BACK_SPACE', 'PRESS')
 kmi.properties.name = 'VIEW3D_MT_edit_mesh_delete'
@@ -720,7 +720,7 @@ kmi = km.keymap_items.new_modal('CUT_THROUGH_TOGGLE', 'Z', 'PRESS')
 km = kc.keymaps.new('Curve', space_type='EMPTY', region_type='WINDOW', modal=False)
 
 kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True)
-kmi.properties.name = 'INFO_MT_edit_curve_add'
+kmi.properties.name = 'TOPBAR_MT_edit_curve_add'
 kmi = km.keymap_items.new('curve.handle_type_set', 'RIGHTMOUSE', 'PRESS')
 kmi = km.keymap_items.new('curve.vertex_add', 'MIDDLEMOUSE', 'CLICK', ctrl=True)
 kmi = km.keymap_items.new('curve.select_all', 'A', 'PRESS', ctrl=True)
index cc3d92547e37e1b6d7ad83cc02452fc0debd5ef1..b6a68f067852ffa5457eea2443fd63ca59eab891 100644 (file)
@@ -40,7 +40,7 @@ class TOPBAR_HT_upper_bar(Header):
 
         layout.operator("wm.splash", text="", icon='BLENDER', emboss=False)
 
-        INFO_MT_editor_menus.draw_collapsible(context, layout)
+        TOPBAR_MT_editor_menus.draw_collapsible(context, layout)
 
         layout.separator()
 
@@ -262,8 +262,8 @@ class _draw_left_context_mode:
                     layout.prop(brush, "use_puff_volume")
 
 
-class INFO_MT_editor_menus(Menu):
-    bl_idname = "INFO_MT_editor_menus"
+class TOPBAR_MT_editor_menus(Menu):
+    bl_idname = "TOPBAR_MT_editor_menus"
     bl_label = ""
 
     def draw(self, context):
@@ -271,16 +271,16 @@ class INFO_MT_editor_menus(Menu):
 
     @staticmethod
     def draw_menus(layout, context):
-        layout.menu("INFO_MT_file")
-        layout.menu("INFO_MT_edit")
+        layout.menu("TOPBAR_MT_file")
+        layout.menu("TOPBAR_MT_edit")
 
-        layout.menu("INFO_MT_render")
+        layout.menu("TOPBAR_MT_render")
 
-        layout.menu("INFO_MT_window")
-        layout.menu("INFO_MT_help")
+        layout.menu("TOPBAR_MT_window")
+        layout.menu("TOPBAR_MT_help")
 
 
-class INFO_MT_file(Menu):
+class TOPBAR_MT_file(Menu):
     bl_label = "File"
 
     def draw(self, context):
@@ -289,7 +289,7 @@ class INFO_MT_file(Menu):
         layout.operator_context = 'INVOKE_AREA'
         layout.operator("wm.read_homefile", text="New", icon='NEW')
         layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
-        layout.menu("INFO_MT_file_open_recent")
+        layout.menu("TOPBAR_MT_file_open_recent")
         layout.operator("wm.revert_mainfile")
         layout.operator("wm.recover_last_session")
         layout.operator("wm.recover_auto_save", text="Recover Auto Save...")
@@ -315,16 +315,16 @@ class INFO_MT_file(Menu):
         layout.operator_context = 'INVOKE_AREA'
         layout.operator("wm.link", text="Link...", icon='LINK_BLEND')
         layout.operator("wm.append", text="Append...", icon='APPEND_BLEND')
-        layout.menu("INFO_MT_file_previews")
+        layout.menu("TOPBAR_MT_file_previews")
 
         layout.separator()
 
-        layout.menu("INFO_MT_file_import", icon='IMPORT')
-        layout.menu("INFO_MT_file_export", icon='EXPORT')
+        layout.menu("TOPBAR_MT_file_import", icon='IMPORT')
+        layout.menu("TOPBAR_MT_file_export", icon='EXPORT')
 
         layout.separator()
 
-        layout.menu("INFO_MT_file_external_data")
+        layout.menu("TOPBAR_MT_file_external_data")
 
         layout.separator()
 
@@ -334,8 +334,8 @@ class INFO_MT_file(Menu):
         layout.operator("wm.quit_blender", text="Quit", icon='QUIT')
 
 
-class INFO_MT_file_import(Menu):
-    bl_idname = "INFO_MT_file_import"
+class TOPBAR_MT_file_import(Menu):
+    bl_idname = "TOPBAR_MT_file_import"
     bl_label = "Import"
 
     def draw(self, context):
@@ -345,8 +345,8 @@ class INFO_MT_file_import(Menu):
             self.layout.operator("wm.alembic_import", text="Alembic (.abc)")
 
 
-class INFO_MT_file_export(Menu):
-    bl_idname = "INFO_MT_file_export"
+class TOPBAR_MT_file_export(Menu):
+    bl_idname = "TOPBAR_MT_file_export"
     bl_label = "Export"
 
     def draw(self, context):
@@ -356,7 +356,7 @@ class INFO_MT_file_export(Menu):
             self.layout.operator("wm.alembic_export", text="Alembic (.abc)")
 
 
-class INFO_MT_file_external_data(Menu):
+class TOPBAR_MT_file_external_data(Menu):
     bl_label = "External Data"
 
     def draw(self, context):
@@ -383,7 +383,7 @@ class INFO_MT_file_external_data(Menu):
         layout.operator("file.find_missing_files")
 
 
-class INFO_MT_file_previews(Menu):
+class TOPBAR_MT_file_previews(Menu):
     bl_label = "Data Previews"
 
     def draw(self, context):
@@ -398,28 +398,7 @@ class INFO_MT_file_previews(Menu):
         layout.operator("wm.previews_batch_clear")
 
 
-class INFO_MT_game(Menu):
-    bl_label = "Game"
-
-    def draw(self, context):
-        layout = self.layout
-
-        gs = context.scene.game_settings
-
-        layout.operator("view3d.game_start")
-
-        layout.separator()
-
-        layout.prop(gs, "show_debug_properties")
-        layout.prop(gs, "show_framerate_profile")
-        layout.prop(gs, "show_physics_visualization")
-        layout.prop(gs, "use_deprecation_warnings")
-        layout.prop(gs, "use_animation_record")
-        layout.separator()
-        layout.prop(gs, "use_auto_start")
-
-
-class INFO_MT_render(Menu):
+class TOPBAR_MT_render(Menu):
     bl_label = "Render"
 
     def draw(self, context):
@@ -447,21 +426,7 @@ class INFO_MT_render(Menu):
         layout.prop(rd, "use_lock_interface", text="Lock Interface")
 
 
-class INFO_MT_opengl_render(Menu):
-    bl_label = "OpenGL Render Options"
-
-    def draw(self, context):
-        layout = self.layout
-
-        rd = context.scene.render
-        layout.prop(rd, "use_antialiasing")
-        layout.prop(rd, "use_full_sample")
-
-        layout.prop_menu_enum(rd, "antialiasing_samples")
-        layout.prop_menu_enum(rd, "alpha_mode")
-
-
-class INFO_MT_edit(Menu):
+class TOPBAR_MT_edit(Menu):
     bl_label = "Edit"
 
     def draw(self, context):
@@ -498,7 +463,7 @@ class INFO_MT_edit(Menu):
         layout.operator("screen.userpref_show", text="User Preferences...", icon='PREFERENCES')
 
 
-class INFO_MT_window(Menu):
+class TOPBAR_MT_window(Menu):
     bl_label = "Window"
 
     def draw(self, context):
@@ -536,7 +501,7 @@ class INFO_MT_window(Menu):
             layout.operator("wm.set_stereo_3d")
 
 
-class INFO_MT_help(Menu):
+class TOPBAR_MT_help(Menu):
     bl_label = "Help"
 
     def draw(self, context):
@@ -607,8 +572,8 @@ class TOPBAR_MT_file_specials(Menu):
 
         layout.separator()
 
-        layout.menu("INFO_MT_file_import", icon='IMPORT')
-        layout.menu("INFO_MT_file_export", icon='EXPORT')
+        layout.menu("TOPBAR_MT_file_import", icon='IMPORT')
+        layout.menu("TOPBAR_MT_file_export", icon='EXPORT')
 
 
 class TOPBAR_MT_window_specials(Menu):
@@ -655,17 +620,16 @@ classes = (
     TOPBAR_MT_file_specials,
     TOPBAR_MT_window_specials,
     TOPBAR_MT_workspace_menu,
-    INFO_MT_editor_menus,
-    INFO_MT_file,
-    INFO_MT_file_import,
-    INFO_MT_file_export,
-    INFO_MT_file_external_data,
-    INFO_MT_file_previews,
-    INFO_MT_edit,
-    INFO_MT_game,
-    INFO_MT_render,
-    INFO_MT_window,
-    INFO_MT_help,
+    TOPBAR_MT_editor_menus,
+    TOPBAR_MT_file,
+    TOPBAR_MT_file_import,
+    TOPBAR_MT_file_export,
+    TOPBAR_MT_file_external_data,
+    TOPBAR_MT_file_previews,
+    TOPBAR_MT_edit,
+    TOPBAR_MT_render,
+    TOPBAR_MT_window,
+    TOPBAR_MT_help,
 )
 
 if __name__ == "__main__":  # only for live edit.
index 987430b2335a919b09c71fb81c440750ee8c5e8b..07ded525d61f746c68606eec17da2a2e788095d2 100644 (file)
@@ -276,17 +276,17 @@ class VIEW3D_MT_editor_menus(Menu):
         if gp_edit:
             pass
         elif mode_string == 'OBJECT':
-            layout.menu("INFO_MT_add", text="Add")
+            layout.menu("VIEW3D_MT_add", text="Add")
         elif mode_string == 'EDIT_MESH':
-            layout.menu("INFO_MT_mesh_add", text="Add")
+            layout.menu("VIEW3D_MT_mesh_add", text="Add")
         elif mode_string == 'EDIT_CURVE':
-            layout.menu("INFO_MT_curve_add", text="Add")
+            layout.menu("VIEW3D_MT_curve_add", text="Add")
         elif mode_string == 'EDIT_SURFACE':
-            layout.menu("INFO_MT_surface_add", text="Add")
+            layout.menu("VIEW3D_MT_surface_add", text="Add")
         elif mode_string == 'EDIT_METABALL':
-            layout.menu("INFO_MT_metaball_add", text="Add")
+            layout.menu("VIEW3D_MT_metaball_add", text="Add")
         elif mode_string == 'EDIT_ARMATURE':
-            layout.menu("INFO_MT_edit_armature_add", text="Add")
+            layout.menu("TOPBAR_MT_edit_armature_add", text="Add")
 
         if gp_edit:
             if obj and obj.mode == 'GPENCIL_PAINT':
@@ -1314,9 +1314,8 @@ class VIEW3D_MT_angle_control(Menu):
                 layout.prop(tex_slot, "use_random", text="Random")
 
 
-# XXX: INFO_MT_ names used to keep backwards compatibility (Add-ons etc. that hook into the menu)
-class INFO_MT_mesh_add(Menu):
-    bl_idname = "INFO_MT_mesh_add"
+class VIEW3D_MT_mesh_add(Menu):
+    bl_idname = "VIEW3D_MT_mesh_add"
     bl_label = "Mesh"
 
     def draw(self, context):
@@ -1339,8 +1338,8 @@ class INFO_MT_mesh_add(Menu):
         layout.operator("mesh.primitive_monkey_add", text="Monkey", icon='MESH_MONKEY')
 
 
-class INFO_MT_curve_add(Menu):
-    bl_idname = "INFO_MT_curve_add"
+class VIEW3D_MT_curve_add(Menu):
+    bl_idname = "VIEW3D_MT_curve_add"
     bl_label = "Curve"
 
     def draw(self, context):
@@ -1362,8 +1361,8 @@ class INFO_MT_curve_add(Menu):
         layout.operator("curve.draw", icon='LINE_DATA')
 
 
-class INFO_MT_surface_add(Menu):
-    bl_idname = "INFO_MT_surface_add"
+class VIEW3D_MT_surface_add(Menu):
+    bl_idname = "VIEW3D_MT_surface_add"
     bl_label = "Surface"
 
     def draw(self, context):
@@ -1380,8 +1379,8 @@ class INFO_MT_surface_add(Menu):
         layout.operator("surface.primitive_nurbs_surface_torus_add", text="Nurbs Torus", icon='SURFACE_NTORUS')
 
 
-class INFO_MT_metaball_add(Menu):
-    bl_idname = "INFO_MT_metaball_add"
+class VIEW3D_MT_metaball_add(Menu):
+    bl_idname = "VIEW3D_MT_metaball_add"
     bl_label = "Metaball"
 
     def draw(self, context):
@@ -1391,8 +1390,8 @@ class INFO_MT_metaball_add(Menu):
         layout.operator_enum("object.metaball_add", "type")
 
 
-class INFO_MT_edit_curve_add(Menu):
-    bl_idname = "INFO_MT_edit_curve_add"
+class TOPBAR_MT_edit_curve_add(Menu):
+    bl_idname = "TOPBAR_MT_edit_curve_add"
     bl_label = "Add"
 
     def draw(self, context):
@@ -1402,13 +1401,13 @@ class INFO_MT_edit_curve_add(Menu):
         layout.operator_context = 'EXEC_REGION_WIN'
 
         if is_surf:
-            INFO_MT_surface_add.draw(self, context)
+            VIEW3D_MT_surface_add.draw(self, context)
         else:
-            INFO_MT_curve_add.draw(self, context)
+            VIEW3D_MT_curve_add.draw(self, context)
 
 
-class INFO_MT_edit_armature_add(Menu):
-    bl_idname = "INFO_MT_edit_armature_add"
+class TOPBAR_MT_edit_armature_add(Menu):
+    bl_idname = "TOPBAR_MT_edit_armature_add"
     bl_label = "Armature"
 
     def draw(self, context):
@@ -1418,8 +1417,8 @@ class INFO_MT_edit_armature_add(Menu):
         layout.operator("armature.bone_primitive_add", text="Single Bone", icon='BONE_DATA')
 
 
-class INFO_MT_armature_add(Menu):
-    bl_idname = "INFO_MT_armature_add"
+class VIEW3D_MT_armature_add(Menu):
+    bl_idname = "VIEW3D_MT_armature_add"
     bl_label = "Armature"
 
     def draw(self, context):
@@ -1429,8 +1428,8 @@ class INFO_MT_armature_add(Menu):
         layout.operator("object.armature_add", text="Single Bone", icon='BONE_DATA')
 
 
-class INFO_MT_light_add(Menu):
-    bl_idname = "INFO_MT_light_add"
+class VIEW3D_MT_light_add(Menu):
+    bl_idname = "VIEW3D_MT_light_add"
     bl_label = "Light"
 
     def draw(self, context):
@@ -1440,8 +1439,8 @@ class INFO_MT_light_add(Menu):
         layout.operator_enum("object.light_add", "type")
 
 
-class INFO_MT_lightprobe_add(Menu):
-    bl_idname = "INFO_MT_lightprobe_add"
+class VIEW3D_MT_lightprobe_add(Menu):
+    bl_idname = "VIEW3D_MT_lightprobe_add"
     bl_label = "Light Probe"
 
     def draw(self, context):
@@ -1451,8 +1450,8 @@ class INFO_MT_lightprobe_add(Menu):
         layout.operator_enum("object.lightprobe_add", "type")
 
 
-class INFO_MT_camera_add(Menu):
-    bl_idname = "INFO_MT_camera_add"
+class VIEW3D_MT_camera_add(Menu):
+    bl_idname = "VIEW3D_MT_camera_add"
     bl_label = "Camera"
 
     def draw(self, context):
@@ -1461,7 +1460,7 @@ class INFO_MT_camera_add(Menu):
         layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA')
 
 
-class INFO_MT_add(Menu):
+class VIEW3D_MT_add(Menu):
     bl_label = "Add"
 
     def draw(self, context):
@@ -1474,18 +1473,18 @@ class INFO_MT_add(Menu):
         layout.operator_context = 'EXEC_REGION_WIN'
 
         # layout.operator_menu_enum("object.mesh_add", "type", text="Mesh", icon='OUTLINER_OB_MESH')
-        layout.menu("INFO_MT_mesh_add", icon='OUTLINER_OB_MESH')
+        layout.menu("VIEW3D_MT_mesh_add", icon='OUTLINER_OB_MESH')
 
         # layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='OUTLINER_OB_CURVE')
-        layout.menu("INFO_MT_curve_add", icon='OUTLINER_OB_CURVE')
+        layout.menu("VIEW3D_MT_curve_add", icon='OUTLINER_OB_CURVE')
         # layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE')
-        layout.menu("INFO_MT_surface_add", icon='OUTLINER_OB_SURFACE')
-        layout.menu("INFO_MT_metaball_add", text="Metaball", icon='OUTLINER_OB_META')
+        layout.menu("VIEW3D_MT_surface_add", icon='OUTLINER_OB_SURFACE')
+        layout.menu("VIEW3D_MT_metaball_add", text="Metaball", icon='OUTLINER_OB_META')
         layout.operator("object.text_add", text="Text", icon='OUTLINER_OB_FONT')
         layout.operator_menu_enum("object.gpencil_add", "type", text="Grease Pencil", icon='OUTLINER_OB_GREASEPENCIL')
         layout.separator()
 
-        layout.menu("INFO_MT_armature_add", icon='OUTLINER_OB_ARMATURE')
+        layout.menu("VIEW3D_MT_armature_add", icon='OUTLINER_OB_ARMATURE')
         layout.operator("object.add", text="Lattice", icon='OUTLINER_OB_LATTICE').type = 'LATTICE'
         layout.operator_menu_enum("object.empty_add", "type", text="Empty", icon='OUTLINER_OB_EMPTY')
         layout.separator()
@@ -1493,14 +1492,14 @@ class INFO_MT_add(Menu):
         layout.operator("object.speaker_add", text="Speaker", icon='OUTLINER_OB_SPEAKER')
         layout.separator()
 
-        if INFO_MT_camera_add.is_extended():
-            layout.menu("INFO_MT_camera_add", icon='OUTLINER_OB_CAMERA')
+        if VIEW3D_MT_camera_add.is_extended():
+            layout.menu("VIEW3D_MT_camera_add", icon='OUTLINER_OB_CAMERA')
         else:
-            INFO_MT_camera_add.draw(self, context)
+            VIEW3D_MT_camera_add.draw(self, context)
 
-        layout.menu("INFO_MT_light_add", icon='OUTLINER_OB_LIGHT')
+        layout.menu("VIEW3D_MT_light_add", icon='OUTLINER_OB_LIGHT')
         layout.separator()
-        layout.menu("INFO_MT_lightprobe_add", icon='OUTLINER_OB_LIGHTPROBE')
+        layout.menu("VIEW3D_MT_lightprobe_add", icon='OUTLINER_OB_LIGHTPROBE')
         layout.separator()
 
         layout.operator_menu_enum("object.effector_add", "type", text="Force Field", icon='OUTLINER_OB_FORCE_FIELD')
@@ -5053,17 +5052,17 @@ classes = (
     VIEW3D_MT_select_paint_mask,
     VIEW3D_MT_select_paint_mask_vertex,
     VIEW3D_MT_angle_control,
-    INFO_MT_mesh_add,
-    INFO_MT_curve_add,
-    INFO_MT_surface_add,
-    INFO_MT_metaball_add,
-    INFO_MT_edit_curve_add,
-    INFO_MT_edit_armature_add,
-    INFO_MT_armature_add,
-    INFO_MT_light_add,
-    INFO_MT_lightprobe_add,
-    INFO_MT_camera_add,
-    INFO_MT_add,
+    VIEW3D_MT_mesh_add,
+    VIEW3D_MT_curve_add,
+    VIEW3D_MT_surface_add,
+    VIEW3D_MT_metaball_add,
+    TOPBAR_MT_edit_curve_add,
+    TOPBAR_MT_edit_armature_add,
+    VIEW3D_MT_armature_add,
+    VIEW3D_MT_light_add,
+    VIEW3D_MT_lightprobe_add,
+    VIEW3D_MT_camera_add,
+    VIEW3D_MT_add,
     VIEW3D_MT_object,
     VIEW3D_MT_object_animation,
     VIEW3D_MT_object_rigid_body,
index d26f3d351bf74df0d0c828f0fcd837e333425868..d7ee145175feef8bdac0fa702470303e7f3fd351 100644 (file)
@@ -80,13 +80,13 @@ def add_object_manual_map():
 def register():
     bpy.utils.register_class(OBJECT_OT_add_object)
     bpy.utils.register_manual_map(add_object_manual_map)
-    bpy.types.INFO_MT_mesh_add.append(add_object_button)
+    bpy.types.VIEW3D_MT_mesh_add.append(add_object_button)
 
 
 def unregister():
     bpy.utils.unregister_class(OBJECT_OT_add_object)
     bpy.utils.unregister_manual_map(add_object_manual_map)
-    bpy.types.INFO_MT_mesh_add.remove(add_object_button)
+    bpy.types.VIEW3D_MT_mesh_add.remove(add_object_button)
 
 
 if __name__ == "__main__":
index 4ea817d3507fd3a73d63fa1e7276577299033c99..45910772dc7058ca3368889515f77c42f4e1939b 100644 (file)
@@ -60,12 +60,12 @@ def menu_func_export(self, context):
 
 def register():
     bpy.utils.register_class(ExportSomeData)
-    bpy.types.INFO_MT_file_export.append(menu_func_export)
+    bpy.types.TOPBAR_MT_file_export.append(menu_func_export)
 
 
 def unregister():
     bpy.utils.unregister_class(ExportSomeData)
-    bpy.types.INFO_MT_file_export.remove(menu_func_export)
+    bpy.types.TOPBAR_MT_file_export.remove(menu_func_export)
 
 
 if __name__ == "__main__":
index b932b008c49bef84580dc8657b6ddf9ae5a62e9c..5438a7a6f9d59fbf9bddbd324dd05561c86ba2f7 100644 (file)
@@ -63,12 +63,12 @@ def menu_func_import(self, context):
 
 def register():
     bpy.utils.register_class(ImportSomeData)
-    bpy.types.INFO_MT_file_import.append(menu_func_import)
+    bpy.types.TOPBAR_MT_file_import.append(menu_func_import)
 
 
 def unregister():
     bpy.utils.unregister_class(ImportSomeData)
-    bpy.types.INFO_MT_file_import.remove(menu_func_import)
+    bpy.types.TOPBAR_MT_file_import.remove(menu_func_import)
 
 
 if __name__ == "__main__":
index 6b39ef7bbba2fcbf0da46cb4886238fae40720f5..5a9acce3026978df01427ccbd03c40b11a86d3f1 100644 (file)
@@ -123,12 +123,12 @@ def menu_func(self, context):
 
 def register():
     bpy.utils.register_class(AddBox)
-    bpy.types.INFO_MT_mesh_add.append(menu_func)
+    bpy.types.VIEW3D_MT_mesh_add.append(menu_func)
 
 
 def unregister():
     bpy.utils.unregister_class(AddBox)
-    bpy.types.INFO_MT_mesh_add.remove(menu_func)
+    bpy.types.VIEW3D_MT_mesh_add.remove(menu_func)
 
 
 if __name__ == "__main__":
index 366aafcfa07a7c71775dd37c0663f6dab7f028c3..70894741b7f3c2cb567ba3689d93e1842dcb062c 100644 (file)
@@ -300,7 +300,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
        /* set parent and add object are object-based operators, but we make them
         * available here because it's useful to do in pose mode too */
        WM_keymap_add_item(keymap, "OBJECT_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
-       WM_keymap_add_menu(keymap, "INFO_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0);
+       WM_keymap_add_menu(keymap, "VIEW3D_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0);
 
        kmi = WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, 0, 0);
        RNA_boolean_set(kmi->ptr, "unselected", false);
index 2cfbc2f44c63f2b74ff180587a27e86e70d87ec6..8f7cb911824affbedd03045fd8179eafe8526dd8 100644 (file)
@@ -233,7 +233,7 @@ void ED_keymap_curve(wmKeyConfig *keyconf)
        keymap = WM_keymap_find(keyconf, "Curve", 0, 0);
        keymap->poll = ED_operator_editsurfcurve;
 
-       WM_keymap_add_menu(keymap, "INFO_MT_edit_curve_add", AKEY, KM_PRESS, KM_SHIFT, 0);
+       WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_curve_add", AKEY, KM_PRESS, KM_SHIFT, 0);
 
        WM_keymap_add_item(keymap, "CURVE_OT_handle_type_set", VKEY, KM_PRESS, 0, 0);
 
index 07390cc4017cd3cde397b42bdba5ca1f60caf3cf..fe5b85e69fbb4a8b7d6223ba7597b2c0fbebc4af 100644 (file)
@@ -475,7 +475,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
 //     WM_keymap_add_item(keymap, "MESH_OT_skin", FKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); /* python, removed */
        WM_keymap_add_item(keymap, "MESH_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0);
 
-       WM_keymap_add_menu(keymap, "INFO_MT_mesh_add", AKEY, KM_PRESS, KM_SHIFT, 0);
+       WM_keymap_add_menu(keymap, "VIEW3D_MT_mesh_add", AKEY, KM_PRESS, KM_SHIFT, 0);
 
        WM_keymap_add_item(keymap, "MESH_OT_separate", PKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "MESH_OT_split", YKEY, KM_PRESS, 0, 0);
index c8726d929839fadf31f329cfa6303618e4580514..b6135eb177cd3de91edfe0287c536f08de62234c 100644 (file)
@@ -402,7 +402,7 @@ void ED_keymap_object(wmKeyConfig *keyconf)
        kmi = WM_keymap_add_item(keymap, "OBJECT_OT_delete", DELKEY, KM_PRESS, KM_SHIFT, 0);
        RNA_boolean_set(kmi->ptr, "use_global", true);
 
-       WM_keymap_add_menu(keymap, "INFO_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0);
+       WM_keymap_add_menu(keymap, "VIEW3D_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0);
 
 #ifdef USE_WM_KEYMAP_27X
        WM_keymap_add_item(keymap, "OBJECT_OT_duplicates_make_real", AKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
index 7f4d2a7f6c7132115eeba520dd4d74ae1e42428d..397a58ea3eae1723b76d7bdcb43af4a973c7a808 100644 (file)
@@ -306,35 +306,6 @@ static void info_header_region_message_subscribe(
        WM_msg_subscribe_rna_anon_prop(mbus, ViewLayer, name, &msg_sub_value_region_tag_redraw);
 }
 
-static void recent_files_menu_draw(const bContext *UNUSED(C), Menu *menu)
-{
-       struct RecentFile *recent;
-       uiLayout *layout = menu->layout;
-       uiLayoutSetOperatorContext(layout, WM_OP_EXEC_REGION_WIN);
-       if (!BLI_listbase_is_empty(&G.recent_files)) {
-               for (recent = G.recent_files.first; (recent); recent = recent->next) {
-                       const char *file = BLI_path_basename(recent->filepath);
-                       const int icon = BLO_has_bfile_extension(file) ? ICON_FILE_BLEND : ICON_FILE_BACKUP;
-                       uiItemStringO(layout, file, icon, "WM_OT_open_mainfile", "filepath", recent->filepath);
-               }
-       }
-       else {
-               uiItemL(layout, IFACE_("No Recent Files"), ICON_NONE);
-       }
-}
-
-static void recent_files_menu_register(void)
-{
-       MenuType *mt;
-
-       mt = MEM_callocN(sizeof(MenuType), "spacetype info menu recent files");
-       strcpy(mt->idname, "INFO_MT_file_open_recent");
-       strcpy(mt->label, N_("Open Recent..."));
-       strcpy(mt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA);
-       mt->draw = recent_files_menu_draw;
-       WM_menutype_add(mt);
-}
-
 /* only called once, from space/spacetypes.c */
 void ED_spacetype_info(void)
 {
@@ -375,7 +346,5 @@ void ED_spacetype_info(void)
 
        BLI_addhead(&st->regiontypes, art);
 
-       recent_files_menu_register();
-
        BKE_spacetype_register(st);
 }
index 4f39d2131b90a8ccc1294a18e9377e58802a8f86..baeae5fc68ccba0c5b33a5b0eff83d0f16f8fc74 100644 (file)
@@ -3454,7 +3454,7 @@ void wm_window_keymap(wmKeyConfig *keyconf)
 
 #ifdef __APPLE__
        WM_keymap_add_item(keymap, "WM_OT_read_homefile", NKEY, KM_PRESS, KM_OSKEY, 0);
-       WM_keymap_add_menu(keymap, "INFO_MT_file_open_recent", OKEY, KM_PRESS, KM_SHIFT | KM_OSKEY, 0);
+       WM_keymap_add_menu(keymap, "TOPBAR_MT_file_open_recent", OKEY, KM_PRESS, KM_SHIFT | KM_OSKEY, 0);
        WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_OSKEY, 0);
        WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_OSKEY, 0);
        WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT | KM_OSKEY, 0);
@@ -3464,7 +3464,7 @@ void wm_window_keymap(wmKeyConfig *keyconf)
 #ifdef USE_WM_KEYMAP_27X
        WM_keymap_add_item(keymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_CTRL, 0);
 #endif
-       WM_keymap_add_menu(keymap, "INFO_MT_file_open_recent", OKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
+       WM_keymap_add_menu(keymap, "TOPBAR_MT_file_open_recent", OKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
        WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_CTRL, 0);
 #ifdef USE_WM_KEYMAP_27X
        WM_keymap_add_item(keymap, "WM_OT_open_mainfile", F1KEY, KM_PRESS, 0, 0);