From fe54725113b91e06c0d42cf059e72ebd6b2b813b Mon Sep 17 00:00:00 2001 From: Jesse Yurkovich Date: Fri, 18 Jul 2025 20:56:01 +0200 Subject: [PATCH] USD: Rename import_subdiv option to import_subdivision This aligns with the option used for USD export (export_subdivision) and the option used for FBX import (import_subdivision). Ref #134012 Pull Request: https://projects.blender.org/blender/blender/pulls/142278 --- source/blender/editors/io/io_usd.cc | 6 +++--- source/blender/io/usd/intern/usd_reader_mesh.cc | 2 +- source/blender/io/usd/usd.hh | 2 +- tests/python/bl_usd_import_test.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/blender/editors/io/io_usd.cc b/source/blender/editors/io/io_usd.cc index db7e6c29219..fc099375503 100644 --- a/source/blender/editors/io/io_usd.cc +++ b/source/blender/editors/io/io_usd.cc @@ -907,7 +907,7 @@ static wmOperatorStatus wm_usd_import_exec(bContext *C, wmOperator *op) params.import_all_materials = RNA_boolean_get(op->ptr, "import_all_materials"); params.import_meshes = RNA_boolean_get(op->ptr, "import_meshes"); params.import_points = RNA_boolean_get(op->ptr, "import_points"); - params.import_subdiv = RNA_boolean_get(op->ptr, "import_subdiv"); + params.import_subdivision = RNA_boolean_get(op->ptr, "import_subdivision"); params.import_volumes = RNA_boolean_get(op->ptr, "import_volumes"); params.create_collection = RNA_boolean_get(op->ptr, "create_collection"); @@ -1014,7 +1014,7 @@ static void wm_usd_import_draw(bContext *C, wmOperator *op) col->prop(ptr, "read_mesh_uvs", UI_ITEM_NONE, std::nullopt, ICON_NONE); col->prop(ptr, "read_mesh_colors", UI_ITEM_NONE, std::nullopt, ICON_NONE); col->prop(ptr, "read_mesh_attributes", UI_ITEM_NONE, std::nullopt, ICON_NONE); - col->prop(ptr, "import_subdiv", UI_ITEM_NONE, IFACE_("Subdivision"), ICON_NONE); + col->prop(ptr, "import_subdivision", UI_ITEM_NONE, IFACE_("Subdivision"), ICON_NONE); col = &panel->column(false); col->prop(ptr, "validate_meshes", UI_ITEM_NONE, std::nullopt, ICON_NONE); @@ -1117,7 +1117,7 @@ void WM_OT_usd_import(wmOperatorType *ot) RNA_def_boolean(ot->srna, "import_points", true, "Point Clouds", ""); RNA_def_boolean(ot->srna, - "import_subdiv", + "import_subdivision", false, "Import Subdivision Scheme", "Create subdivision surface modifiers based on the USD " diff --git a/source/blender/io/usd/intern/usd_reader_mesh.cc b/source/blender/io/usd/intern/usd_reader_mesh.cc index 938413d27ae..6afec4f2c7f 100644 --- a/source/blender/io/usd/intern/usd_reader_mesh.cc +++ b/source/blender/io/usd/intern/usd_reader_mesh.cc @@ -214,7 +214,7 @@ void USDMeshReader::read_object_data(Main *bmain, const pxr::UsdTimeCode time) add_cache_modifier(); } - if (import_params_.import_subdiv) { + if (import_params_.import_subdivision) { pxr::TfToken subdivScheme; mesh_prim_.GetSubdivisionSchemeAttr().Get(&subdivScheme, time); diff --git a/source/blender/io/usd/usd.hh b/source/blender/io/usd/usd.hh index 2769cd28757..74f6ae5eb60 100644 --- a/source/blender/io/usd/usd.hh +++ b/source/blender/io/usd/usd.hh @@ -209,7 +209,7 @@ struct USDImportParams { bool import_all_materials; bool import_meshes; bool import_points; - bool import_subdiv; + bool import_subdivision; bool import_volumes; bool import_shapes; diff --git a/tests/python/bl_usd_import_test.py b/tests/python/bl_usd_import_test.py index 32df4be9795..d9ef734e0d6 100644 --- a/tests/python/bl_usd_import_test.py +++ b/tests/python/bl_usd_import_test.py @@ -256,7 +256,7 @@ class USDImportTest(AbstractUSDTest): # Reload the empty file and import back in bpy.ops.wm.open_mainfile(filepath=str(self.testdir / "empty.blend")) - res = bpy.ops.wm.usd_import(filepath=testfile, import_subdiv=True) + res = bpy.ops.wm.usd_import(filepath=testfile, import_subdivision=True) self.assertEqual({'FINISHED'}, res, f"Unable to import USD file {testfile}") # Validate crease attributes @@ -2012,7 +2012,7 @@ class USDImportComparisonTest(unittest.TestCase): bpy.ops.wm.open_mainfile(filepath=str(self.testdir / "empty.blend")) ok = report.import_and_check( input_file, lambda filepath, params: bpy.ops.wm.usd_import( - filepath=str(input_file), import_subdiv=True, **params)) + filepath=str(input_file), import_subdivision=True, **params)) if not ok: self.fail(f"{input_file.stem} import result does not match expectations")