[Bf-blender-cvs] [b92caa6a4a2] usd-importer-T81257-merge: USD import: remove Convert to Z Up option.
makowalski
noreply at git.blender.org
Mon May 17 23:05:30 CEST 2021
Commit: b92caa6a4a2b6daf79e8ff43c2da1ed28f477ec2
Author: makowalski
Date: Mon May 17 15:39:48 2021 -0400
Branches: usd-importer-T81257-merge
https://developer.blender.org/rBb92caa6a4a2b6daf79e8ff43c2da1ed28f477ec2
USD import: remove Convert to Z Up option.
Removing the z-up conversion option, per suggestion
from reviewers.
===================================================================
M source/blender/editors/io/io_usd.c
M source/blender/io/usd/intern/usd_capi_import.cc
M source/blender/io/usd/usd.h
===================================================================
diff --git a/source/blender/editors/io/io_usd.c b/source/blender/editors/io/io_usd.c
index 0a579ad58f2..3f39ac03950 100644
--- a/source/blender/editors/io/io_usd.c
+++ b/source/blender/editors/io/io_usd.c
@@ -313,8 +313,6 @@ static int wm_usd_import_exec(bContext *C, wmOperator *op)
const bool import_usd_preview = RNA_boolean_get(op->ptr, "import_usd_preview");
const bool set_material_blend = RNA_boolean_get(op->ptr, "set_material_blend");
- const bool convert_to_z_up = RNA_boolean_get(op->ptr, "convert_to_z_up");
-
const float light_intensity_scale = RNA_float_get(op->ptr, "light_intensity_scale");
/* TODO(makowalski): Add support for sequences. */
@@ -355,7 +353,6 @@ static int wm_usd_import_exec(bContext *C, wmOperator *op)
use_instancing,
import_usd_preview,
set_material_blend,
- convert_to_z_up,
light_intensity_scale};
const bool ok = USD_import(C, filename, ¶ms, as_background_job);
@@ -385,7 +382,6 @@ static void wm_usd_import_draw(bContext *UNUSED(C), wmOperator *op)
uiItemR(box, ptr, "import_instance_proxies", 0, NULL, ICON_NONE);
uiItemR(box, ptr, "import_visible_only", 0, NULL, ICON_NONE);
uiItemR(box, ptr, "create_collection", 0, NULL, ICON_NONE);
- uiItemR(box, ptr, "convert_to_z_up", 0, NULL, ICON_NONE);
uiItemR(box, ptr, "light_intensity_scale", 0, NULL, ICON_NONE);
uiLayout *prim_path_mask_box = uiLayoutBox(box);
@@ -527,13 +523,6 @@ void WM_OT_usd_import(struct wmOperatorType *ot)
"the material blend method will automatically be set based on the "
"shader's opacity and opacityThreshold inputs");
- RNA_def_boolean(ot->srna,
- "convert_to_z_up",
- true,
- "Convert to Z Up",
- "If the USD stage up-axis is Y, apply a rotation "
- "to the imported objects to convert their orientation to Z up");
-
RNA_def_float(ot->srna,
"light_intensity_scale",
1.0f,
diff --git a/source/blender/io/usd/intern/usd_capi_import.cc b/source/blender/io/usd/intern/usd_capi_import.cc
index 636d176c8d8..b9556a12a1f 100644
--- a/source/blender/io/usd/intern/usd_capi_import.cc
+++ b/source/blender/io/usd/intern/usd_capi_import.cc
@@ -112,7 +112,7 @@ static bool gather_objects_paths(const pxr::UsdPrim &object, ListBase *object_pa
// Update the given import settings with the global rotation matrix to orient
// imported objects with Z-up, if necessary
-static void set_global_rotation(pxr::UsdStageRefPtr stage, ImportSettings &r_settings)
+static void convert_to_z_up(pxr::UsdStageRefPtr stage, ImportSettings &r_settings)
{
if (!stage || pxr::UsdGeomGetStageUpAxis(stage) == pxr::UsdGeomTokens->z) {
// Nothing to do.
@@ -231,9 +231,7 @@ static void import_startjob(void *customdata, short *stop, short *do_update, flo
return;
}
- if (data->params.convert_to_z_up) {
- set_global_rotation(archive->stage(), data->settings);
- }
+ convert_to_z_up(archive->stage(), data->settings);
// Set up the stage for animated data.
if (data->params.set_frame_range) {
diff --git a/source/blender/io/usd/usd.h b/source/blender/io/usd/usd.h
index 59399babcc6..67b34ad58b0 100644
--- a/source/blender/io/usd/usd.h
+++ b/source/blender/io/usd/usd.h
@@ -68,7 +68,6 @@ struct USDImportParams {
bool use_instancing;
bool import_usd_preview;
bool set_material_blend;
- bool convert_to_z_up;
float light_intensity_scale;
};
More information about the Bf-blender-cvs
mailing list