Skip to content

Commit

Permalink
IO: remove OBJ and PLY Python add-ons (#104503, #104504)
Browse files Browse the repository at this point in the history
With C++ based built-in implementations having both more features
and way better performance, it's time to retire the add-ons. Implements
#104503 and #104504.

Pull Request: https://projects.blender.org/blender/blender/pulls/108440

(cherry picked from commit 23afc61)
  • Loading branch information
aras-p authored and lordloki committed Jul 1, 2023
1 parent 61ef941 commit ac174bc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 129 deletions.
4 changes: 2 additions & 2 deletions scripts/startup/bl_ui/space_topbar.py
Expand Up @@ -476,7 +476,7 @@ def draw(self, _context):
if bpy.app.build_options.io_wavefront_obj:
self.layout.operator("wm.obj_import", text="Wavefront (.obj)")
if bpy.app.build_options.io_ply:
self.layout.operator("wm.ply_import", text="Stanford PLY (.ply) (experimental)")
self.layout.operator("wm.ply_import", text="Stanford PLY (.ply)")
if bpy.app.build_options.io_stl:
self.layout.operator("wm.stl_import", text="STL (.stl) (experimental)")

Expand Down Expand Up @@ -506,7 +506,7 @@ def draw(self, _context):
if bpy.app.build_options.io_wavefront_obj:
self.layout.operator("wm.obj_export", text="Wavefront (.obj)")
if bpy.app.build_options.io_ply:
self.layout.operator("wm.ply_export", text="Stanford PLY (.ply) (experimental)")
self.layout.operator("wm.ply_export", text="Stanford PLY (.ply)")


class TOPBAR_MT_file_external_data(Menu):
Expand Down
2 changes: 0 additions & 2 deletions source/blender/blenkernel/intern/blendfile.cc
Expand Up @@ -749,12 +749,10 @@ UserDef *BKE_blendfile_userdef_from_defaults(void)
const char *addons[] = {
"io_anim_bvh",
"io_curve_svg",
"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",
Expand Down
6 changes: 6 additions & 0 deletions source/blender/blenloader/intern/versioning_userdef.c
Expand Up @@ -824,6 +824,12 @@ void blo_do_versions_userdef(UserDef *userdef)
}
}

if (!USER_VERSION_ATLEAST(400, 4)) {
/* obj and ply python addons were removed. */
BKE_addon_remove_safe(&userdef->addons, "io_mesh_ply");
BKE_addon_remove_safe(&userdef->addons, "io_scene_obj");
}

/**
* Versioning code until next subversion bump goes here.
*
Expand Down
4 changes: 0 additions & 4 deletions source/blender/makesrna/intern/rna_image.c
Expand Up @@ -1286,10 +1286,6 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Image Tiles", "Tiles of the image");
rna_def_udim_tiles(brna, prop);

/*
* Image.has_data and Image.depth are temporary,
* Update import_obj.py when they are replaced (Arystan)
*/
prop = RNA_def_property(srna, "has_data", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_Image_has_data_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
Expand Down
121 changes: 0 additions & 121 deletions tests/python/CMakeLists.txt
Expand Up @@ -314,127 +314,6 @@ add_blender_test(
# ------------------------------------------------------------------------------
# IO TESTS

# OBJ Import tests
# disabled until updated & working
if(FALSE)
add_blender_test(
import_obj_cube
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.import_scene.obj\(filepath='${TEST_SRC_DIR}/io_tests/obj/cube.obj'\)
--md5=39cce4bacac2d1b18fc470380279bc15 --md5_method=SCENE
--write-blend=${TEST_OUT_DIR}/io_tests/import_obj_cube.blend
)

add_blender_test(
import_obj_nurbs_cyclic
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.import_scene.obj\(filepath='${TEST_SRC_DIR}/io_tests/obj/nurbs_cyclic.obj'\)
--md5=ad3c307e5883224a0492378cd32691ab --md5_method=SCENE
--write-blend=${TEST_OUT_DIR}/io_tests/import_obj_nurbs_cyclic.blend
)

add_blender_test(
import_obj_makehuman
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.import_scene.obj\(filepath='${TEST_SRC_DIR}/io_tests/obj/makehuman.obj'\)
--md5=c9f78b185e58358daa4ecaecfa75464e --md5_method=SCENE
--write-blend=${TEST_OUT_DIR}/io_tests/import_obj_makehuman.blend
)
endif()

# OBJ Export tests
add_blender_test(
export_obj_cube
${TEST_SRC_DIR}/io_tests/blend_geometry/all_quads.blend
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.obj\(filepath='${TEST_OUT_DIR}/io_tests/export_obj_cube.obj',use_selection=False\)
--md5_source=${TEST_OUT_DIR}/io_tests/export_obj_cube.obj
--md5_source=${TEST_OUT_DIR}/io_tests/export_obj_cube.mtl
--md5=e80660437ad9bfe082849641c361a233 --md5_method=FILE
)

add_blender_test(
export_obj_nurbs
${TEST_SRC_DIR}/io_tests/blend_geometry/nurbs.blend
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.obj\(filepath='${TEST_OUT_DIR}/io_tests/export_obj_nurbs.obj',use_selection=False,use_nurbs=True\)
--md5_source=${TEST_OUT_DIR}/io_tests/export_obj_nurbs.obj
--md5_source=${TEST_OUT_DIR}/io_tests/export_obj_nurbs.mtl
--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
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.obj\(filepath='${TEST_OUT_DIR}/io_tests/export_obj_all_objects.obj',use_selection=False,use_nurbs=True\)
--md5_source=${TEST_OUT_DIR}/io_tests/export_obj_all_objects.obj
--md5_source=${TEST_OUT_DIR}/io_tests/export_obj_all_objects.mtl
--md5=04b3ed97cede07a19548fc518ce9f8ca --md5_method=FILE
)
endif()



# PLY Import tests
add_blender_test(
import_ply_cube
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.import_mesh.ply\(filepath='${TEST_SRC_DIR}/io_tests/ply/cube_ascii.ply'\)
--md5=527134343c27fc0ea73115b85fbfd3ac --md5_method=SCENE
--write-blend=${TEST_OUT_DIR}/io_tests/import_ply_cube.blend
)

add_blender_test(
import_ply_bunny
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.import_mesh.ply\(filepath='${TEST_SRC_DIR}/io_tests/ply/bunny2.ply'\)
--md5=6ea5b8533400a17accf928b8fd024eaa --md5_method=SCENE
--write-blend=${TEST_OUT_DIR}/io_tests/import_ply_bunny.blend
)

add_blender_test(
import_ply_small_holes
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.import_mesh.ply\(filepath='${TEST_SRC_DIR}/io_tests/ply/many_small_holes.ply'\)
--md5=c3093e26ecae5b6d59fbbcf2a0d0b39f --md5_method=SCENE
--write-blend=${TEST_OUT_DIR}/io_tests/import_ply_small_holes.blend
)

# PLY Export
# disabled until updated & working
if(FALSE)
add_blender_test(
export_ply_cube_all_data
${TEST_SRC_DIR}/io_tests/blend_geometry/cube_all_data.blend
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_mesh.ply\(filepath='${TEST_OUT_DIR}/io_tests/export_ply_cube_all_data.ply'\)
--md5_source=${TEST_OUT_DIR}/io_tests/export_ply_cube_all_data.ply
--md5=6adc3748ceae8298496f99d0e7e76c15 --md5_method=FILE
)

add_blender_test(
export_ply_suzanne_all_data
${TEST_SRC_DIR}/io_tests/blend_geometry/suzanne_all_data.blend
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_mesh.ply\(filepath='${TEST_OUT_DIR}/io_tests/export_ply_suzanne_all_data.ply'\)
--md5_source=${TEST_OUT_DIR}/io_tests/export_ply_suzanne_all_data.ply
--md5=68ba23f02efd6511bfd093f45f703221 --md5_method=FILE
)
endif()

add_blender_test(
export_ply_vertices # lame, add a better one
${TEST_SRC_DIR}/io_tests/blend_geometry/vertices.blend
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_mesh.ply\(filepath='${TEST_OUT_DIR}/io_tests/export_ply_vertices.ply'\)
--md5_source=${TEST_OUT_DIR}/io_tests/export_ply_vertices.ply
--md5=ee6ce2e69c1d9a7418ff0548f6338f70 --md5_method=FILE
)


# STL Import tests
# disabled until updated & working
if(FALSE)
Expand Down

0 comments on commit ac174bc

Please sign in to comment.