Split Python OBJ importer and exporter, enabling only the importer.

This is from patch D13988. It removes the "- New" from the menu of the
new obj exporter, changes the default addon to just io_import_obj,
and does the right versioning thing.
Also disables the python tests for the old python exporter.
This commit is contained in:
Howard Trickey 2022-02-03 07:56:55 -05:00
parent 3bf2a6e3c9
commit ff9dc1986e
Notes: blender-bot 2023-02-14 06:55:40 +01:00
Referenced by commit 4d29ec42bc, Revert "Split Python OBJ importer and exporter, enabling only the importer."
Referenced by commit f39698de77, Revert "Split Python OBJ importer and exporter, enabling only the importer."
4 changed files with 12 additions and 4 deletions

View File

@ -481,7 +481,7 @@ class TOPBAR_MT_file_export(Menu):
bl_owner_use_filter = False
def draw(self, _context):
self.layout.operator("wm.obj_export", text="Wavefront OBJ (.obj) - New")
self.layout.operator("wm.obj_export", text="Wavefront OBJ (.obj)")
if bpy.app.build_options.collada:
self.layout.operator("wm.collada_export",
text="Collada (Default) (.dae)")

View File

@ -621,12 +621,12 @@ UserDef *BKE_blendfile_userdef_from_defaults(void)
const char *addons[] = {
"io_anim_bvh",
"io_curve_svg",
"io_import_obj",
"io_mesh_ply",
"io_mesh_stl",
"io_mesh_uv_layout",
"io_scene_fbx",
"io_scene_gltf2",
"io_scene_obj",
"io_scene_x3d",
"cycles",
"pose_library",

View File

@ -973,6 +973,13 @@ void blo_do_versions_userdef(UserDef *userdef)
*/
{
/* Keep this block, even when empty. */
if (!USER_VERSION_ATLEAST(301, 7)) {
/* io_scene_obj directory is gone, split into io_import_obj and io_export_obj,
* with io_import_obj enabled by default and io_export_obj replaced by the C++ version.
*/
BKE_addon_remove_safe(&userdef->addons, "io_scene_obj");
BKE_addon_ensure(&userdef->addons, "io_import_obj");
}
}
LISTBASE_FOREACH (bTheme *, btheme, &userdef->themes) {

View File

@ -324,7 +324,10 @@ add_blender_test(
)
endif()
if(FALSE)
# OBJ Export tests
# Disabled because new C++ Obj exporter has C++ tests.
add_blender_test(
export_obj_cube
${TEST_SRC_DIR}/io_tests/blend_geometry/all_quads.blend
@ -345,8 +348,6 @@ add_blender_test(
--md5=a733ae4fa4a591ea9b0912da3af042de --md5_method=FILE
)
# disabled until updated & working
if(FALSE)
add_blender_test(
export_obj_all_objects
${TEST_SRC_DIR}/io_tests/blend_scene/all_objects.blend