diff --git a/apps/cesium.omniverse.dev.kit b/apps/cesium.omniverse.dev.kit index 1cffa5d04..dad997037 100644 --- a/apps/cesium.omniverse.dev.kit +++ b/apps/cesium.omniverse.dev.kit @@ -5,7 +5,7 @@ app = true [dependencies] # Include basic configuration (that brings most of basic extensions) -"omni.app.dev" = {} +"omni.app.base" = {} "omni.kit.window.material_graph" = {optional = true} "cesium.omniverse" = {} "cesium.powertools" = {} diff --git a/apps/omni.app.base.kit b/apps/omni.app.base.kit new file mode 100644 index 000000000..b69e30973 --- /dev/null +++ b/apps/omni.app.base.kit @@ -0,0 +1,116 @@ +# This app is a copy of omni.app.dev.kit, minus any extensions that are no longer published. + +[package] +title = "Kit Dev App" +description = "Default app kit runs. Minimal USD viewer." +version = "1.0.0" +keywords = ["app"] +support_level = "Sample" + +[dependencies] +# The Main UI App. Bring everything needed for UI application. +"omni.kit.uiapp" = {} + +# USD file open/close +"omni.kit.window.file" = {} + +# Basic Menus +"omni.kit.menu.utils" = {} +"omni.kit.menu.file" = {} +"omni.kit.menu.edit" = {} +"omni.kit.menu.create" = {} +"omni.kit.menu.common" = {} +"omni.kit.menu.aov" = {} +"omni.kit.context_menu" = {} +"omni.kit.selection" = {} + +# Stage Templates +"omni.kit.stage_templates" = {} + +# Some Editing Windows +"omni.kit.window.title" = {} +"omni.kit.widget.live" = {} +"omni.kit.widget.cache_indicator" = {} +"omni.kit.window.stage" = {} +"omni.kit.window.toolbar" = {} +"omni.kit.widget.filebrowser" = {} +"omni.kit.window.filepicker" = {} +"omni.kit.window.content_browser" = {} +"omni.kit.collaboration.channel_manager" = {} +"omni.kit.collaboration.viewport.camera" = {} +"omni.kit.collaboration.selection_outline" = {} +"omni.kit.collaboration.stage_columns" = {} +"omni.kit.stage_column.active" = {} + +# Tools +"omni.kit.tool.collect" = {} + +# Viewport and Renderer +"omni.kit.viewport.bundle" = {} +"omni.kit.viewport.rtx" = {} +"omni.kit.viewport.pxr" = {} +"omni.kit.viewport.iray" = {} +"omni.resourcemonitor" = {} + +# MDL +"omni.mdl" = {} +"omni.mdl.neuraylib" = {} + +# RTX Tests +# "omni.rtx.tests" = {} +# "omni.kit.renderer.capture" = {} + +# Status Bar +"omni.kit.window.status_bar" = {} + +# Graphics Stats +"omni.stats" = {} + +# Render Settings 2.0 +"omni.rtx.settings.core" = {} + +# Dev & Utils Windows +"omni.kit.window.about" = {} +"omni.kit.window.privacy" = {} +"omni.kit.window.stats" = { order = 1000 } +"omni.kit.window.script_editor" = {} +"omni.kit.window.console" = {} +"omni.kit.window.preferences" = { order = 1000 } # so the menu is in the correct place +"omni.kit.window.tests" = {} + +# Extensions Manager UI +"omni.kit.window.extensions" = {} + +# Property Widgets and Window +"omni.kit.window.property" = {} +"omni.kit.property.bundle" = {} + +# Misc +"omni.kit.primitive.mesh" = {} +"omni.kit.telemetry" = {} + +[settings.app.settings] +persistent = true + +[settings] +exts."omni.kit.window.file".useNewFilePicker = true +exts."omni.kit.renderer.core".imgui.enableMips = true +app.content.emptyStageOnStart = true + +app.extensions.enabledDeprecated = [] + +renderer.enabled='rtx,iray,pxr' +renderer.active='rtx' + +# Fast shutdown by default +app.fastShutdown = true + +exts."omni.kit.viewport.window".startup.dockTabInvisible=true + +[settings.app.window] +saveSizeOnExit = true +title = "Kit Dev App" +width = 1920 +height = 1080 +x = -1 +y = -1 diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 3c1a94afb..8e9a020d3 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -92,9 +92,10 @@ endif() set(NVIDIA_BUILD_DIR "${PROJECT_SOURCE_DIR}/extern/nvidia/_build") set(NVIDIA_USD_ROOT "${NVIDIA_BUILD_DIR}/target-deps/usd") set(PYTHON_ROOT "${NVIDIA_BUILD_DIR}/target-deps/python") -set(USDRT_ROOT "${NVIDIA_BUILD_DIR}/target-deps/usdrt") set(CARB_ROOT "${NVIDIA_BUILD_DIR}/target-deps/carb_sdk_plugins") set(KIT_SDK_ROOT "${NVIDIA_BUILD_DIR}/target-deps/kit-sdk") +set(KIT_OMNI_UI_ROOT "${NVIDIA_BUILD_DIR}/target-deps/omni-ui") +set(KIT_IMGUI_ROOT "${NVIDIA_BUILD_DIR}/target-deps/omni-kit-renderer-imgui") set(PYBIND11_ROOT "${NVIDIA_BUILD_DIR}/target-deps/pybind11") set(CUDA_ROOT "${NVIDIA_BUILD_DIR}/target-deps/cuda") @@ -215,20 +216,10 @@ else() endif() # cmake-format: off -add_prebuilt_project( - RELEASE_INCLUDE_DIR - "${USDRT_ROOT}/include/usdrt_only" - DEBUG_INCLUDE_DIR - "${USDRT_ROOT}/include/usdrt_only" - RELEASE_LIBRARY_DIR - "${USDRT_ROOT}/_build/${NVIDIA_PLATFORM_NAME}/${NVIDIA_RELEASE_FOLDER_NAME}/usdrt_only" - DEBUG_LIBRARY_DIR - "${USDRT_ROOT}/_build/${NVIDIA_PLATFORM_NAME}/${NVIDIA_DEBUG_FOLDER_NAME}/usdrt_only" - RELEASE_LIBRARIES - omni.fabric.plugin - DEBUG_LIBRARIES - omni.fabric.plugin - TARGET_NAMES +add_prebuilt_project_header_only( + INCLUDE_DIR + "${KIT_SDK_ROOT}/dev/fabric/include" + TARGET_NAME fabric ) # cmake-format: on @@ -373,9 +364,9 @@ add_prebuilt_project( DEBUG_INCLUDE_DIR "${KIT_SDK_ROOT}/dev/include" RELEASE_LIBRARY_DIR - "${KIT_SDK_ROOT}/exts/omni.ui/bin" + "${KIT_OMNI_UI_ROOT}/bin" DEBUG_LIBRARY_DIR - "${KIT_SDK_ROOT}/exts/omni.ui/bin" + "${KIT_OMNI_UI_ROOT}/bin" RELEASE_LIBRARIES omni.ui DEBUG_LIBRARIES @@ -387,8 +378,8 @@ add_prebuilt_project( if(WIN32) set(NVIDIA_ADDITIONAL_LIBRARIES - "${PROJECT_SOURCE_DIR}/extern/nvidia/_build/target-deps/kit-sdk/exts/omni.kit.renderer.imgui/bin/imgui.dll" - "${PROJECT_SOURCE_DIR}/extern/nvidia/_build/target-deps/kit-sdk/exts/omni.kit.renderer.imgui/bin/deps/freetype.dll" + "${KIT_IMGUI_ROOT}/bin/imgui.dll" + "${KIT_IMGUI_ROOT}/bin/deps/freetype.dll" ) set_property(GLOBAL PROPERTY NVIDIA_ADDITIONAL_LIBRARIES_PROPERTY "${NVIDIA_ADDITIONAL_LIBRARIES}") @@ -398,11 +389,11 @@ else() "$" "$" # This is where freetype is located on Linux - "${PROJECT_SOURCE_DIR}/extern/nvidia/_build/target-deps/kit-sdk/exts/omni.kit.renderer.imgui/bin/deps") + "${KIT_IMGUI_ROOT}/bin/deps") set(NVIDIA_ADDITIONAL_LINK_DIRECTORIES # This is where freetype is located on Linux. Needed by imgui which doesn't set its rpath properly - "${PROJECT_SOURCE_DIR}/extern/nvidia/_build/target-deps/kit-sdk/exts/omni.kit.renderer.imgui/bin/deps") + "${KIT_IMGUI_ROOT}/bin/deps") set_property(GLOBAL PROPERTY NVIDIA_ADDITIONAL_SEARCH_PATHS_PROPERTY "${NVIDIA_ADDITIONAL_SEARCH_PATHS}") set_property(GLOBAL PROPERTY NVIDIA_ADDITIONAL_LINK_DIRECTORIES_PROPERTY "${NVIDIA_ADDITIONAL_LINK_DIRECTORIES}") diff --git a/extern/nvidia/debug-deps/kit-sdk.packman.user.xml b/extern/nvidia/debug-deps/kit-sdk.packman.user.xml index 567f4332e..f9725f58b 100644 --- a/extern/nvidia/debug-deps/kit-sdk.packman.user.xml +++ b/extern/nvidia/debug-deps/kit-sdk.packman.user.xml @@ -1,5 +1,25 @@ - - + + + + + + + + + + + + + + + diff --git a/extern/nvidia/deps/kit-sdk.packman.xml b/extern/nvidia/deps/kit-sdk.packman.xml index 59e3dc9b6..63abf7114 100644 --- a/extern/nvidia/deps/kit-sdk.packman.xml +++ b/extern/nvidia/deps/kit-sdk.packman.xml @@ -1,5 +1,25 @@ - - + + + + + + + + + + + + + + + diff --git a/extern/nvidia/deps/target-deps.packman.xml b/extern/nvidia/deps/target-deps.packman.xml index 67cc0c76f..4442d836b 100644 --- a/extern/nvidia/deps/target-deps.packman.xml +++ b/extern/nvidia/deps/target-deps.packman.xml @@ -3,7 +3,6 @@ - @@ -11,7 +10,6 @@ - diff --git a/extern/nvidia/tools/packman/config.packman.xml b/extern/nvidia/tools/packman/config.packman.xml index 24ca05d68..20fe00b77 100644 --- a/extern/nvidia/tools/packman/config.packman.xml +++ b/extern/nvidia/tools/packman/config.packman.xml @@ -1,5 +1,8 @@ - + + + + diff --git a/src/core/include/cesium/omniverse/UsdTokens.h b/src/core/include/cesium/omniverse/UsdTokens.h index d92ce88f3..b7c90093e 100644 --- a/src/core/include/cesium/omniverse/UsdTokens.h +++ b/src/core/include/cesium/omniverse/UsdTokens.h @@ -82,16 +82,12 @@ __pragma(warning(push)) __pragma(warning(disable : 4003)) (subdivisionScheme) \ (vertex) \ (vertexId) \ - (_cesium_gltfLocalToEcefTransform) \ (_cesium_tilesetId) \ (_deletedPrims) \ (_materialSource) \ (_paramColorSpace) \ (_sdrMetadata) \ (_worldExtent) \ - (_worldOrientation) \ - (_worldPosition) \ - (_worldScale) \ (_worldVisibility) \ ((info_implementationSource, "info:implementationSource")) \ ((info_mdl_sourceAsset, "info:mdl:sourceAsset")) \ @@ -152,6 +148,8 @@ __pragma(warning(push)) __pragma(warning(disable : 4003)) ((xformOp_rotateZYX, "xformOp:rotateZYX")) \ ((xformOp_scale, "xformOp:scale")) \ ((xformOp_translate, "xformOp:translate")) \ + ((_localMatrix, "omni:fabric:localMatrix")) \ + ((_worldMatrix, "omni:fabric:worldMatrix")) \ ((_auto, "auto")) #ifdef CESIUM_OMNI_CLANG @@ -274,15 +272,14 @@ const omni::fabric::Type primvars_st(omni::fabric::BaseDataType::eFloat, 2, 1, o const omni::fabric::Type primvars_vertexId(omni::fabric::BaseDataType::eFloat, 1, 1, omni::fabric::AttributeRole::eNone); const omni::fabric::Type Shader(omni::fabric::BaseDataType::eTag, 1, 0, omni::fabric::AttributeRole::ePrimTypeName); const omni::fabric::Type subdivisionScheme(omni::fabric::BaseDataType::eToken, 1, 0, omni::fabric::AttributeRole::eNone); -const omni::fabric::Type _cesium_gltfLocalToEcefTransform(omni::fabric::BaseDataType::eDouble, 16, 0, omni::fabric::AttributeRole::eMatrix); const omni::fabric::Type _cesium_tilesetId(omni::fabric::BaseDataType::eInt64, 1, 0, omni::fabric::AttributeRole::eNone); const omni::fabric::Type _materialSource(omni::fabric::BaseDataType::eRelationship, 1, 0, omni::fabric::AttributeRole::eNone); const omni::fabric::Type _paramColorSpace(omni::fabric::BaseDataType::eToken, 1, 1, omni::fabric::AttributeRole::eNone); const omni::fabric::Type _sdrMetadata(omni::fabric::BaseDataType::eToken, 1, 1, omni::fabric::AttributeRole::eNone); const omni::fabric::Type _worldExtent(omni::fabric::BaseDataType::eDouble, 6, 0, omni::fabric::AttributeRole::eNone); -const omni::fabric::Type _worldOrientation(omni::fabric::BaseDataType::eFloat, 4, 0, omni::fabric::AttributeRole::eQuaternion); -const omni::fabric::Type _worldPosition(omni::fabric::BaseDataType::eDouble, 3, 0, omni::fabric::AttributeRole::eNone); -const omni::fabric::Type _worldScale(omni::fabric::BaseDataType::eFloat, 3, 0, omni::fabric::AttributeRole::eVector); const omni::fabric::Type _worldVisibility(omni::fabric::BaseDataType::eBool, 1, 0, omni::fabric::AttributeRole::eNone); +const omni::fabric::Type _localMatrix(omni::fabric::BaseDataType::eDouble, 16, 0, omni::fabric::AttributeRole::eMatrix); +const omni::fabric::Type _worldMatrix(omni::fabric::BaseDataType::eDouble, 16, 0, omni::fabric::AttributeRole::eMatrix); + } // clang-format on diff --git a/src/core/src/FabricGeometry.cpp b/src/core/src/FabricGeometry.cpp index 4b8889ce4..6b4adfab2 100644 --- a/src/core/src/FabricGeometry.cpp +++ b/src/core/src/FabricGeometry.cpp @@ -121,8 +121,7 @@ void FabricGeometry::setMaterial(const omni::fabric::Path& materialPath) { auto& fabricStage = _pContext->getFabricStage(); fabricStage.setArrayAttributeSize(_path, FabricTokens::material_binding, 1); - const auto materialBindingFabric = - fabricStage.getArrayAttributeWr(_path, FabricTokens::material_binding); + auto materialBindingFabric = fabricStage.getArrayAttributeWr(_path, FabricTokens::material_binding); materialBindingFabric[0] = materialPath; } @@ -150,10 +149,8 @@ void FabricGeometry::initialize() { attributes.addAttribute(FabricTypes::primvarInterpolations, FabricTokens::primvarInterpolations); attributes.addAttribute(FabricTypes::Mesh, FabricTokens::Mesh); attributes.addAttribute(FabricTypes::_cesium_tilesetId, FabricTokens::_cesium_tilesetId); - attributes.addAttribute(FabricTypes::_cesium_gltfLocalToEcefTransform, FabricTokens::_cesium_gltfLocalToEcefTransform); - attributes.addAttribute(FabricTypes::_worldPosition, FabricTokens::_worldPosition); - attributes.addAttribute(FabricTypes::_worldOrientation, FabricTokens::_worldOrientation); - attributes.addAttribute(FabricTypes::_worldScale, FabricTokens::_worldScale); + attributes.addAttribute(FabricTypes::_localMatrix, FabricTokens::_localMatrix); + attributes.addAttribute(FabricTypes::_worldMatrix, FabricTokens::_worldMatrix); attributes.addAttribute(FabricTypes::doubleSided, FabricTokens::doubleSided); attributes.addAttribute(FabricTypes::subdivisionScheme, FabricTokens::subdivisionScheme); attributes.addAttribute(FabricTypes::material_binding, FabricTokens::material_binding); @@ -267,10 +264,9 @@ void FabricGeometry::reset() { const auto extentFabric = fabricStage.getAttributeWr(_path, FabricTokens::extent); const auto worldExtentFabric = fabricStage.getAttributeWr(_path, FabricTokens::_worldExtent); const auto worldVisibilityFabric = fabricStage.getAttributeWr(_path, FabricTokens::_worldVisibility); - const auto gltfLocalToEcefTransformFabric = fabricStage.getAttributeWr(_path, FabricTokens::_cesium_gltfLocalToEcefTransform); - const auto worldPositionFabric = fabricStage.getAttributeWr(_path, FabricTokens::_worldPosition); - const auto worldOrientationFabric = fabricStage.getAttributeWr(_path, FabricTokens::_worldOrientation); - const auto worldScaleFabric = fabricStage.getAttributeWr(_path, FabricTokens::_worldScale); + auto worldMatrixFabric = fabricStage.getAttributeWr(_path, FabricTokens::_worldMatrix); + auto localMatrixFabric = fabricStage.getAttributeWr(_path, FabricTokens::_localMatrix); + const auto tilesetIdFabric = fabricStage.getAttributeWr(_path, FabricTokens::_cesium_tilesetId); // clang-format on @@ -278,10 +274,8 @@ void FabricGeometry::reset() { *extentFabric = UsdUtil::glmToUsdExtent(DEFAULT_EXTENT); *worldExtentFabric = UsdUtil::glmToUsdExtent(DEFAULT_EXTENT); *worldVisibilityFabric = DEFAULT_VISIBILITY; - *gltfLocalToEcefTransformFabric = UsdUtil::glmToUsdMatrix(DEFAULT_MATRIX); - *worldPositionFabric = UsdUtil::glmToUsdVector(DEFAULT_POSITION); - *worldOrientationFabric = UsdUtil::glmToUsdQuat(glm::fquat(DEFAULT_ORIENTATION)); - *worldScaleFabric = UsdUtil::glmToUsdVector(glm::fvec3(DEFAULT_SCALE)); + *localMatrixFabric = UsdUtil::glmToUsdMatrix(DEFAULT_MATRIX); + *worldMatrixFabric = UsdUtil::glmToUsdMatrix(DEFAULT_MATRIX); *tilesetIdFabric = FabricUtil::NO_TILESET_ID; fabricStage.setArrayAttributeSize(_path, FabricTokens::material_binding, 0); @@ -347,8 +341,7 @@ void FabricGeometry::setGeometry( const auto doubleSided = materialInfo.doubleSided; const auto gltfLocalToPrimWorldTransform = ecefToPrimWorldTransform * gltfLocalToEcefTransform; - const auto [primWorldPosition, primWorldOrientation, primWorldScale] = - MathUtil::decompose(gltfLocalToPrimWorldTransform); + const auto worldMatrix = UsdUtil::glmToUsdMatrix(gltfLocalToPrimWorldTransform); const auto primWorldExtent = MathUtil::transformExtent(gltfLocalExtent.value(), gltfLocalToPrimWorldTransform); if (primitive.mode == CesiumGltf::MeshPrimitive::Mode::POINTS) { @@ -526,20 +519,18 @@ void FabricGeometry::setGeometry( const auto doubleSidedFabric = fabricStage.getAttributeWr(_path, FabricTokens::doubleSided); const auto extentFabric = fabricStage.getAttributeWr(_path, FabricTokens::extent); const auto worldExtentFabric = fabricStage.getAttributeWr(_path, FabricTokens::_worldExtent); - const auto gltfLocalToEcefTransformFabric = fabricStage.getAttributeWr(_path, FabricTokens::_cesium_gltfLocalToEcefTransform); - const auto worldPositionFabric = fabricStage.getAttributeWr(_path, FabricTokens::_worldPosition); - const auto worldOrientationFabric = fabricStage.getAttributeWr(_path, FabricTokens::_worldOrientation); - const auto worldScaleFabric = fabricStage.getAttributeWr(_path, FabricTokens::_worldScale); + auto worldMatrixFabric = fabricStage.getAttributeWr(_path, FabricTokens::_worldMatrix); + auto localMatrixFabric = fabricStage.getAttributeWr(_path, FabricTokens::_localMatrix); const auto tilesetIdFabric = fabricStage.getAttributeWr(_path, FabricTokens::_cesium_tilesetId); // clang-format on *doubleSidedFabric = doubleSided; *extentFabric = UsdUtil::glmToUsdExtent(gltfLocalExtent.value()); *worldExtentFabric = UsdUtil::glmToUsdExtent(primWorldExtent); - *gltfLocalToEcefTransformFabric = UsdUtil::glmToUsdMatrix(gltfLocalToEcefTransform); - *worldPositionFabric = UsdUtil::glmToUsdVector(primWorldPosition); - *worldOrientationFabric = UsdUtil::glmToUsdQuat(glm::fquat(primWorldOrientation)); - *worldScaleFabric = UsdUtil::glmToUsdVector(glm::fvec3(primWorldScale)); + *localMatrixFabric = UsdUtil::glmToUsdMatrix(gltfLocalToEcefTransform); + *worldMatrixFabric = worldMatrix; + + *tilesetIdFabric = tilesetId; } diff --git a/src/core/src/FabricMaterial.cpp b/src/core/src/FabricMaterial.cpp index c049700d1..cd6569fba 100644 --- a/src/core/src/FabricMaterial.cpp +++ b/src/core/src/FabricMaterial.cpp @@ -530,20 +530,13 @@ FabricMaterial::FabricMaterial( } FabricMaterial::~FabricMaterial() { - // The code below is temporarily commented out to avoid a crash. - // It will cause a leak, but since this only happens when materials - // pools are destroyed (which doesn't happen during normal usage) it - // shouldn't be a huge concern. - // - // See https://github.com/CesiumGS/cesium-omniverse/issues/444 for details. - - // if (stageDestroyed()) { - // return; - // } - - // for (const auto& path : _allPaths) { - // FabricUtil::destroyPrim(_pContext->getFabricStage(), path); - // } + if (stageDestroyed()) { + return; + } + + for (const auto& path : _allPaths) { + FabricUtil::destroyPrim(_pContext->getFabricStage(), path); + } } void FabricMaterial::setActive(bool active) { diff --git a/src/core/src/FabricUtil.cpp b/src/core/src/FabricUtil.cpp index 839d4dec3..554ee7b96 100644 --- a/src/core/src/FabricUtil.cpp +++ b/src/core/src/FabricUtil.cpp @@ -530,9 +530,9 @@ void destroyPrim(omni::fabric::StageReaderWriter& fabricStage, const omni::fabri const auto deletedPrimsSize = fabricStage.getArrayAttributeSize(changeTrackingPath, FabricTokens::_deletedPrims); fabricStage.setArrayAttributeSize(changeTrackingPath, FabricTokens::_deletedPrims, deletedPrimsSize + 1); const auto deletedPrimsFabric = - fabricStage.getArrayAttributeWr(changeTrackingPath, FabricTokens::_deletedPrims); + fabricStage.getArrayAttributeWr(changeTrackingPath, FabricTokens::_deletedPrims); - deletedPrimsFabric[deletedPrimsSize] = path; + new (&deletedPrimsFabric[deletedPrimsSize]) PXR_NS::SdfPath(omni::fabric::toSdfPath(path.asPathC())); } void setTilesetTransform( @@ -542,17 +542,15 @@ void setTilesetTransform( const auto buckets = fabricStage.findPrims( {omni::fabric::AttrNameAndType(FabricTypes::_cesium_tilesetId, FabricTokens::_cesium_tilesetId)}, {omni::fabric::AttrNameAndType( - FabricTypes::_cesium_gltfLocalToEcefTransform, FabricTokens::_cesium_gltfLocalToEcefTransform)}); + FabricTypes::_localMatrix, FabricTokens::_localMatrix)}); for (uint64_t bucketId = 0; bucketId < buckets.bucketCount(); ++bucketId) { // clang-format off const auto tilesetIdFabric = fabricStage.getAttributeArrayRd(buckets, bucketId, FabricTokens::_cesium_tilesetId); - const auto gltfLocalToEcefTransformFabric = fabricStage.getAttributeArrayRd(buckets, bucketId, FabricTokens::_cesium_gltfLocalToEcefTransform); + const auto gltfLocalToEcefTransformFabric = fabricStage.getAttributeArrayRd(buckets, bucketId, FabricTokens::_localMatrix); const auto extentFabric = fabricStage.getAttributeArrayRd(buckets, bucketId, FabricTokens::extent); - const auto worldPositionFabric = fabricStage.getAttributeArrayWr(buckets, bucketId, FabricTokens::_worldPosition); - const auto worldOrientationFabric = fabricStage.getAttributeArrayWr(buckets, bucketId, FabricTokens::_worldOrientation); - const auto worldScaleFabric = fabricStage.getAttributeArrayWr(buckets, bucketId, FabricTokens::_worldScale); const auto worldExtentFabric = fabricStage.getAttributeArrayWr(buckets, bucketId, FabricTokens::_worldExtent); + const auto worldMatrixFabric = fabricStage.getAttributeArrayWr(buckets, bucketId, FabricTokens::_worldMatrix); // clang-format on for (uint64_t i = 0; i < tilesetIdFabric.size(); ++i) { @@ -560,13 +558,9 @@ void setTilesetTransform( const auto gltfLocalToEcefTransform = UsdUtil::usdToGlmMatrix(gltfLocalToEcefTransformFabric[i]); const auto gltfLocalToPrimWorldTransform = ecefToPrimWorldTransform * gltfLocalToEcefTransform; const auto gltfLocalExtent = UsdUtil::usdToGlmExtent(extentFabric[i]); - const auto [primWorldPosition, primWorldOrientation, primWorldScale] = - MathUtil::decompose(gltfLocalToPrimWorldTransform); const auto primWorldExtent = MathUtil::transformExtent(gltfLocalExtent, gltfLocalToPrimWorldTransform); - - worldPositionFabric[i] = UsdUtil::glmToUsdVector(primWorldPosition); - worldOrientationFabric[i] = UsdUtil::glmToUsdQuat(glm::fquat(primWorldOrientation)); - worldScaleFabric[i] = UsdUtil::glmToUsdVector(glm::fvec3(primWorldScale)); + const auto worldMatrix = UsdUtil::glmToUsdMatrix(gltfLocalToPrimWorldTransform); + worldMatrixFabric[i] = worldMatrix; worldExtentFabric[i] = UsdUtil::glmToUsdExtent(primWorldExtent); } }