[Bf-extensions-cvs] [bfec050a] blender-v3.1-release: Another way to disable old obj exporter.

Howard Trickey noreply at git.blender.org
Fri Feb 11 01:07:48 CET 2022


Commit: bfec050a9716e0867dfe1b884877ac0e5ebcae54
Author: Howard Trickey
Date:   Thu Feb 10 19:01:35 2022 -0500
Branches: blender-v3.1-release
https://developer.blender.org/rBAbfec050a9716e0867dfe1b884877ac0e5ebcae54

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.

===================================================================

M	io_scene_obj/__init__.py

===================================================================

diff --git a/io_scene_obj/__init__.py b/io_scene_obj/__init__.py
index 78c2314e..c5335f3d 100644
--- a/io_scene_obj/__init__.py
+++ b/io_scene_obj/__init__.py
@@ -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)



More information about the Bf-extensions-cvs mailing list