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
This commit is contained in:
Jesse Yurkovich
2025-07-18 20:56:01 +02:00
committed by Jesse Yurkovich
parent a27384e389
commit fe54725113
4 changed files with 7 additions and 7 deletions

View File

@@ -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 "

View File

@@ -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);

View File

@@ -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;

View File

@@ -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")