Another way to disable old obj exporter.

The previous commits to split the obj importer/exporter into two
had the bad side effect of breaking the Python API for the importer
and exporter. So it was reverted and this less drastic method is used:
just don't put the python exporter into the menu. This way the
old scripts using bpy.ops.import_scene.import and .export will still
work (at least until we remove them completely in a future release).
The new obj exporter can be accessed in python right now as
bpy.ops.wm.export_obj(), which is probably not the best name but that
can be fixed later.
This commit is contained in:
Howard Trickey 2022-02-10 19:01:35 -05:00
parent eaf3ebb822
commit bfec050a97
1 changed files with 6 additions and 2 deletions

View File

@ -501,12 +501,16 @@ def register():
bpy.utils.register_class(cls)
bpy.types.TOPBAR_MT_file_import.append(menu_func_import)
bpy.types.TOPBAR_MT_file_export.append(menu_func_export)
# Disabling the menu entry for this python exporter now that
# there is a C++ exporter. For now, leaving the actual
# export_scene.obj pointing at the python version.
# bpy.types.TOPBAR_MT_file_export.append(menu_func_export)
def unregister():
bpy.types.TOPBAR_MT_file_import.remove(menu_func_import)
bpy.types.TOPBAR_MT_file_export.remove(menu_func_export)
# See comment above about menu for the python exporter
# bpy.types.TOPBAR_MT_file_export.remove(menu_func_export)
for cls in classes:
bpy.utils.unregister_class(cls)