diff --git a/.vscode/cesium-omniverse-linux.code-workspace b/.vscode/cesium-omniverse-linux.code-workspace index 1124cb54..3cede43c 100644 --- a/.vscode/cesium-omniverse-linux.code-workspace +++ b/.vscode/cesium-omniverse-linux.code-workspace @@ -96,6 +96,7 @@ "${workspaceFolder}/extern/nvidia/_build/target-deps/kit-sdk/exts/omni.kit.audio.test.usd", "${workspaceFolder}/extern/nvidia/_build/target-deps/kit-sdk/exts/omni.kit.autocapture", "${workspaceFolder}/extern/nvidia/_build/target-deps/kit-sdk/exts/omni.kit.capture", + "${workspaceFolder}/extern/nvidia/_build/target-deps/kit-sdk/exts/omni.kit.capture.viewport", "${workspaceFolder}/extern/nvidia/_build/target-deps/kit-sdk/exts/omni.kit.clipboard", "${workspaceFolder}/extern/nvidia/_build/target-deps/kit-sdk/exts/omni.kit.collaboration.channel_manager", "${workspaceFolder}/extern/nvidia/_build/target-deps/kit-sdk/exts/omni.kit.collaboration.presence_layer", diff --git a/.vscode/cesium-omniverse-windows.code-workspace b/.vscode/cesium-omniverse-windows.code-workspace index d7eac20f..677cec7d 100644 --- a/.vscode/cesium-omniverse-windows.code-workspace +++ b/.vscode/cesium-omniverse-windows.code-workspace @@ -96,6 +96,7 @@ "${workspaceFolder}/extern/nvidia/_build/target-deps/kit-sdk/exts/omni.kit.audiodeviceenum", "${workspaceFolder}/extern/nvidia/_build/target-deps/kit-sdk/exts/omni.kit.autocapture", "${workspaceFolder}/extern/nvidia/_build/target-deps/kit-sdk/exts/omni.kit.capture", + "${workspaceFolder}/extern/nvidia/_build/target-deps/kit-sdk/exts/omni.kit.capture.viewport", "${workspaceFolder}/extern/nvidia/_build/target-deps/kit-sdk/exts/omni.kit.clipboard", "${workspaceFolder}/extern/nvidia/_build/target-deps/kit-sdk/exts/omni.kit.collaboration.channel_manager", "${workspaceFolder}/extern/nvidia/_build/target-deps/kit-sdk/exts/omni.kit.collaboration.presence_layer", diff --git a/CHANGES.md b/CHANGES.md index c43aa276..1340531f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ ### v0.18.0 - 2024-03-01 +* **Breaking change:** removed deprecated properties `projectDefaultIonAccessToken` and `projectDefaultIonAccessToken` from `CesiumDataPrim`. `CesiumIonServerPrim` should be used instead. * Added support for globe anchors on non-georeferenced tilesets. * Fixed zooming to tileset extents when tileset prims have non identity transformation. * Fixed crash when updating tilesets shader inputs. @@ -10,6 +11,7 @@ * Fixed a bug where save stage dialog would appear when reloading Fabric stage at startup. * Fixed crash when removing USD prims in certain order. * Fixed issue where Cesium ion session would not resume on reload. +* The movie capture tool now waits for tilesets to complete loading before it captures a frame. ### v0.17.0 - 2024-02-01 diff --git a/exts/cesium.omniverse/cesium/omniverse/extension.py b/exts/cesium.omniverse/cesium/omniverse/extension.py index 79dc7f40..28a8c39c 100644 --- a/exts/cesium.omniverse/cesium/omniverse/extension.py +++ b/exts/cesium.omniverse/cesium/omniverse/extension.py @@ -32,6 +32,7 @@ from typing import List, Optional, Callable from .ui.credits_viewport_controller import CreditsViewportController from cesium.usd.plugins.CesiumUsdSchemas import Data as CesiumData, IonServer as CesiumIonServer +from omni.kit.capture.viewport import CaptureExtension CESIUM_DATA_PRIM_PATH = "/Cesium" @@ -70,6 +71,7 @@ def __init__(self) -> None: self._logger: logging.Logger = logging.getLogger(__name__) self._menus = [] self._num_credits_viewport_frames: int = 0 + self._capture_instance = None perform_vendor_install() @@ -171,6 +173,8 @@ def on_startup(self): add_raster_overlay_event, self._on_add_raster_overlay_to_tileset ) + self._capture_instance = CaptureExtension.get_instance() + def on_shutdown(self): self._menus.clear() @@ -235,6 +239,8 @@ def on_shutdown(self): self._add_menu_controller.destroy() self._add_menu_controller = None + self._capture_instance = None + self._destroy_credits_viewport_frames() self._logger.info("CesiumOmniverse shutdown") @@ -261,7 +267,10 @@ def _on_update_frame(self, _): self._setup_credits_viewport_frames() self._num_credits_viewport_frames = len(viewports) - _cesium_omniverse_interface.on_update_frame(viewports) + wait_for_loading_tiles = ( + self._capture_instance.progress.capture_status == omni.kit.capture.viewport.CaptureStatus.CAPTURING + ) + _cesium_omniverse_interface.on_update_frame(viewports, wait_for_loading_tiles) def _on_stage_event(self, event): if _cesium_omniverse_interface is None: @@ -498,10 +507,3 @@ def _setup_ion_server_prims(self): data_prim: CesiumData = CesiumData.Get(stage, CESIUM_DATA_PRIM_PATH) data_prim.GetSelectedIonServerRel().AddTarget(path) - - # For backwards compatibility. Add access token from CesiumData prim. - defaultAccessToken = data_prim.GetProjectDefaultIonAccessTokenAttr().Get() - defaultAccessTokenId = data_prim.GetProjectDefaultIonAccessTokenIdAttr().Get() - - prim.GetProjectDefaultIonAccessTokenAttr().Set(defaultAccessToken) - prim.GetProjectDefaultIonAccessTokenIdAttr().Set(defaultAccessTokenId) diff --git a/exts/cesium.omniverse/config/extension.toml b/exts/cesium.omniverse/config/extension.toml index 1d05692b..91d30a24 100644 --- a/exts/cesium.omniverse/config/extension.toml +++ b/exts/cesium.omniverse/config/extension.toml @@ -45,6 +45,7 @@ python = false "omni.kit.viewport.utility" = {} "omni.kit.property.usd" = {} "omni.kit.menu.utils" = {} +"omni.kit.capture.viewport" = {} # Main python module this extension provides, it will be publicly available as "import cesium.omniverse" [[python.module]] diff --git a/exts/cesium.usd.plugins/cesium/usd/plugins/CesiumUsdSchemas/__init__.pyi b/exts/cesium.usd.plugins/cesium/usd/plugins/CesiumUsdSchemas/__init__.pyi index c519ba08..3fb07134 100644 --- a/exts/cesium.usd.plugins/cesium/usd/plugins/CesiumUsdSchemas/__init__.pyi +++ b/exts/cesium.usd.plugins/cesium/usd/plugins/CesiumUsdSchemas/__init__.pyi @@ -31,10 +31,6 @@ class Data(pxr.Usd.Typed): @classmethod def CreateDebugTexturePoolInitialCapacityAttr(cls, *args, **kwargs) -> Any: ... @classmethod - def CreateProjectDefaultIonAccessTokenAttr(cls, *args, **kwargs) -> Any: ... - @classmethod - def CreateProjectDefaultIonAccessTokenIdAttr(cls, *args, **kwargs) -> Any: ... - @classmethod def CreateSelectedIonServerRel(cls, *args, **kwargs) -> Any: ... @classmethod def Define(cls, *args, **kwargs) -> Any: ... @@ -61,10 +57,6 @@ class Data(pxr.Usd.Typed): @classmethod def GetDebugTexturePoolInitialCapacityAttr(cls, *args, **kwargs) -> Any: ... @classmethod - def GetProjectDefaultIonAccessTokenAttr(cls, *args, **kwargs) -> Any: ... - @classmethod - def GetProjectDefaultIonAccessTokenIdAttr(cls, *args, **kwargs) -> Any: ... - @classmethod def GetSchemaAttributeNames(cls, *args, **kwargs) -> Any: ... @classmethod def GetSelectedIonServerRel(cls, *args, **kwargs) -> Any: ... @@ -471,8 +463,6 @@ class Tokens(Boost.Python.instance): @property def cesiumGeoreferenceOriginLongitude(self) -> Any: ... @property - def cesiumHeight(self) -> Any: ... - @property def cesiumInvertSelection(self) -> Any: ... @property def cesiumIonAccessToken(self) -> Any: ... @@ -525,9 +515,11 @@ class Tokens(Boost.Python.instance): @property def cesiumSuspendUpdate(self) -> Any: ... @property - def cesiumUrl(self) -> Any: ... + def cesiumTileHeight(self) -> Any: ... @property - def cesiumWidth(self) -> Any: ... + def cesiumTileWidth(self) -> Any: ... + @property + def cesiumUrl(self) -> Any: ... @property def clip(self) -> Any: ... @property @@ -544,15 +536,15 @@ class WebMapServiceRasterOverlay(RasterOverlay): @classmethod def CreateBaseUrlAttr(cls, *args, **kwargs) -> Any: ... @classmethod - def CreateHeightAttr(cls, *args, **kwargs) -> Any: ... - @classmethod def CreateLayersAttr(cls, *args, **kwargs) -> Any: ... @classmethod def CreateMaximumLevelAttr(cls, *args, **kwargs) -> Any: ... @classmethod def CreateMinimumLevelAttr(cls, *args, **kwargs) -> Any: ... @classmethod - def CreateWidthAttr(cls, *args, **kwargs) -> Any: ... + def CreateTileHeightAttr(cls, *args, **kwargs) -> Any: ... + @classmethod + def CreateTileWidthAttr(cls, *args, **kwargs) -> Any: ... @classmethod def Define(cls, *args, **kwargs) -> Any: ... @classmethod @@ -560,8 +552,6 @@ class WebMapServiceRasterOverlay(RasterOverlay): @classmethod def GetBaseUrlAttr(cls, *args, **kwargs) -> Any: ... @classmethod - def GetHeightAttr(cls, *args, **kwargs) -> Any: ... - @classmethod def GetLayersAttr(cls, *args, **kwargs) -> Any: ... @classmethod def GetMaximumLevelAttr(cls, *args, **kwargs) -> Any: ... @@ -570,7 +560,9 @@ class WebMapServiceRasterOverlay(RasterOverlay): @classmethod def GetSchemaAttributeNames(cls, *args, **kwargs) -> Any: ... @classmethod - def GetWidthAttr(cls, *args, **kwargs) -> Any: ... + def GetTileHeightAttr(cls, *args, **kwargs) -> Any: ... + @classmethod + def GetTileWidthAttr(cls, *args, **kwargs) -> Any: ... @classmethod def _GetStaticTfType(cls, *args, **kwargs) -> Any: ... @classmethod diff --git a/exts/cesium.usd.plugins/schemas/cesium_schemas.usda b/exts/cesium.usd.plugins/schemas/cesium_schemas.usda index 98c947cf..1612f17f 100644 --- a/exts/cesium.usd.plugins/schemas/cesium_schemas.usda +++ b/exts/cesium.usd.plugins/schemas/cesium_schemas.usda @@ -34,22 +34,6 @@ class CesiumDataPrim "CesiumDataPrim" ( doc = "The current ion Server prim used in the Cesium for Omniverse UI." ) - string cesium:projectDefaultIonAccessToken = "" ( - customData = { - string apiName = "projectDefaultIonAccessToken" - } - displayName = "Project default ion Access Token" - doc = "DEPRECATED: A string representing the token for accessing Cesium ion assets. Moved to CesiumIonServerPrim. Will be removed in a future version." - ) - - string cesium:projectDefaultIonAccessTokenId = "" ( - customData = { - string apiName = "projectDefaultIonAccessTokenId" - } - displayName = "Project default ion Access Token ID" - doc = "DEPRECATED: A string representing the token ID for accessing Cesium ion assets. Moved to CesiumIonServerPrim. Will be removed in a future version." - ) - bool cesium:debug:disableMaterials = false ( customData = { string apiName = "debugDisableMaterials" diff --git a/genStubs.bat b/genStubs.bat index 9358897d..d6f0b07b 100644 --- a/genStubs.bat +++ b/genStubs.bat @@ -22,8 +22,8 @@ set CESIUM_TESTS_STUB_PATH=%PROJECT_ROOT%\exts\cesium.omniverse.cpp.tests\cesium set PYTHONPATH=%NVIDIA_USD_PYTHON_LIBS%;%PYTHONPATH% -echo "Ensuring mypy is installed" -%NVIDIA_PYTHON_EXECUTABLE% -m pip install mypy==1.6.1 +echo "Ensuring mypy and black are installed" +%NVIDIA_PYTHON_EXECUTABLE% -m pip install mypy==1.6.1 black==23.1.0 echo "Building lib files flat in temp dir" cmake -B build-stubs @@ -45,9 +45,9 @@ copy out\_CesiumUsdSchemas.pyi %CESIUM_USD_STUB_PATH% copy out\CesiumOmniverseCppTestsPythonBindings.pyi %CESIUM_TESTS_STUB_PATH% echo "Formatting stubs" -black %CESIUM_OMNI_STUB_PATH% -black %CESIUM_USD_STUB_PATH% -black %CESIUM_TESTS_STUB_PATH% +%NVIDIA_PYTHON_EXECUTABLE% -m black %CESIUM_OMNI_STUB_PATH% +%NVIDIA_PYTHON_EXECUTABLE% -m black %CESIUM_USD_STUB_PATH% +%NVIDIA_PYTHON_EXECUTABLE% -m black %CESIUM_TESTS_STUB_PATH% echo "Cleaning up temp dir" cd %PROJECT_ROOT% diff --git a/genStubs.sh b/genStubs.sh index ed1d7a34..7bbfb5d4 100755 --- a/genStubs.sh +++ b/genStubs.sh @@ -22,8 +22,8 @@ CESIUM_TESTS_STUB_PATH="$PROJECT_ROOT/exts/cesium.omniverse.cpp.tests/cesium/omn export PYTHONPATH="$NVIDIA_USD_PYTHON_LIBS:$PYTHONPATH" -echo "Ensuring mypy is installed" -$NVIDIA_PYTHON_EXECUTABLE -m pip install mypy==1.6.1 +echo "Ensuring mypy and black are installed" +$NVIDIA_PYTHON_EXECUTABLE -m pip install mypy==1.6.1 black==23.1.0 echo "Building lib files flat in temp dir" cmake -B build @@ -45,9 +45,9 @@ cp "out/_CesiumUsdSchemas.pyi" $CESIUM_USD_STUB_PATH cp "out/CesiumOmniverseCppTestsPythonBindings.pyi" $CESIUM_TESTS_STUB_PATH echo "Formatting stubs" -black $CESIUM_OMNI_STUB_PATH -black $CESIUM_USD_STUB_PATH -black $CESIUM_TESTS_STUB_PATH +$NVIDIA_PYTHON_EXECUTABLE -m black $CESIUM_OMNI_STUB_PATH +$NVIDIA_PYTHON_EXECUTABLE -m black $CESIUM_USD_STUB_PATH +$NVIDIA_PYTHON_EXECUTABLE -m black $CESIUM_TESTS_STUB_PATH echo "Cleaning up temp dir" rm -rf $FLAT_LIBRARIES_DIR diff --git a/include/cesium/omniverse/CesiumOmniverse.h b/include/cesium/omniverse/CesiumOmniverse.h index 6c224d96..210745c3 100644 --- a/include/cesium/omniverse/CesiumOmniverse.h +++ b/include/cesium/omniverse/CesiumOmniverse.h @@ -49,9 +49,11 @@ class ICesiumOmniverseInterface { /** * @brief Updates all tilesets this frame. * - * @param viewports A list of viewports. + * @param viewports The viewports. + * @param count The number of viewports. + * @param waitForLoadingTiles Whether to wait for all tiles to load before continuing. */ - virtual void onUpdateFrame(const ViewportApi* viewports, uint64_t count) noexcept = 0; + virtual void onUpdateFrame(const ViewportApi* viewports, uint64_t count, bool waitForLoadingTiles) noexcept = 0; /** * @brief Updates the reference to the USD stage for the C++ layer. diff --git a/src/bindings/PythonBindings.cpp b/src/bindings/PythonBindings.cpp index 36698f74..074ce24d 100644 --- a/src/bindings/PythonBindings.cpp +++ b/src/bindings/PythonBindings.cpp @@ -48,8 +48,8 @@ PYBIND11_MODULE(CesiumOmniversePythonBindings, m) { .def("on_startup", &ICesiumOmniverseInterface::onStartup) .def("on_shutdown", &ICesiumOmniverseInterface::onShutdown) .def("reload_tileset", &ICesiumOmniverseInterface::reloadTileset) - .def("on_update_frame", [](ICesiumOmniverseInterface& interface, const std::vector& viewports) { - return interface.onUpdateFrame(reinterpret_cast(viewports.data()), viewports.size()); + .def("on_update_frame", [](ICesiumOmniverseInterface& interface, const std::vector& viewports, bool waitForLoadingTiles) { + return interface.onUpdateFrame(reinterpret_cast(viewports.data()), viewports.size(), waitForLoadingTiles); }) .def("on_stage_change", &ICesiumOmniverseInterface::onUsdStageChanged) .def("connect_to_ion", &ICesiumOmniverseInterface::connectToIon) diff --git a/src/core/include/cesium/omniverse/AssetRegistry.h b/src/core/include/cesium/omniverse/AssetRegistry.h index 9720bb55..4f0b464e 100644 --- a/src/core/include/cesium/omniverse/AssetRegistry.h +++ b/src/core/include/cesium/omniverse/AssetRegistry.h @@ -43,7 +43,7 @@ class AssetRegistry { AssetRegistry(AssetRegistry&&) noexcept = delete; AssetRegistry& operator=(AssetRegistry&&) noexcept = delete; - void onUpdateFrame(const gsl::span& viewports); + void onUpdateFrame(const gsl::span& viewports, bool waitForLoadingTiles); OmniData& addData(const pxr::SdfPath& path); void removeData(const pxr::SdfPath& path); diff --git a/src/core/include/cesium/omniverse/Context.h b/src/core/include/cesium/omniverse/Context.h index 4ade5328..0a966eab 100644 --- a/src/core/include/cesium/omniverse/Context.h +++ b/src/core/include/cesium/omniverse/Context.h @@ -60,7 +60,7 @@ class Context { void clearStage(); void reloadStage(); - void onUpdateFrame(const gsl::span& viewports); + void onUpdateFrame(const gsl::span& viewports, bool waitForLoadingTiles); void onUsdStageChanged(int64_t stageId); [[nodiscard]] const pxr::UsdStageWeakPtr& getUsdStage() const; diff --git a/src/core/include/cesium/omniverse/OmniTileset.h b/src/core/include/cesium/omniverse/OmniTileset.h index 80bf64f1..1e8fc25b 100644 --- a/src/core/include/cesium/omniverse/OmniTileset.h +++ b/src/core/include/cesium/omniverse/OmniTileset.h @@ -87,11 +87,11 @@ class OmniTileset { void updateShaderInput(const pxr::SdfPath& shaderPath, const pxr::TfToken& attributeName); void updateDisplayColorAndOpacity(); - void onUpdateFrame(const gsl::span& viewports); + void onUpdateFrame(const gsl::span& viewports, bool waitForLoadingTiles); private: void updateTransform(); - void updateView(const gsl::span& viewports); + void updateView(const gsl::span& viewports, bool waitForLoadingTiles); [[nodiscard]] bool updateExtent(); void updateLoadStatus(); diff --git a/src/core/src/AssetRegistry.cpp b/src/core/src/AssetRegistry.cpp index 578edec0..be868040 100644 --- a/src/core/src/AssetRegistry.cpp +++ b/src/core/src/AssetRegistry.cpp @@ -21,9 +21,9 @@ AssetRegistry::AssetRegistry(Context* pContext) AssetRegistry::~AssetRegistry() = default; -void AssetRegistry::onUpdateFrame(const gsl::span& viewports) { +void AssetRegistry::onUpdateFrame(const gsl::span& viewports, bool waitForLoadingTiles) { for (const auto& pTileset : _tilesets) { - pTileset->onUpdateFrame(viewports); + pTileset->onUpdateFrame(viewports, waitForLoadingTiles); } } diff --git a/src/core/src/Context.cpp b/src/core/src/Context.cpp index 8faa6541..9cb81185 100644 --- a/src/core/src/Context.cpp +++ b/src/core/src/Context.cpp @@ -154,9 +154,9 @@ void Context::reloadStage() { } } -void Context::onUpdateFrame(const gsl::span& viewports) { +void Context::onUpdateFrame(const gsl::span& viewports, bool waitForLoadingTiles) { _pUsdNotificationHandler->onUpdateFrame(); - _pAssetRegistry->onUpdateFrame(viewports); + _pAssetRegistry->onUpdateFrame(viewports, waitForLoadingTiles); _pCesiumIonServerManager->onUpdateFrame(); } diff --git a/src/core/src/OmniTileset.cpp b/src/core/src/OmniTileset.cpp index 4fefe9a3..6c10d416 100644 --- a/src/core/src/OmniTileset.cpp +++ b/src/core/src/OmniTileset.cpp @@ -638,7 +638,7 @@ void OmniTileset::updateShaderInput(const pxr::SdfPath& shaderPath, const pxr::T }); } -void OmniTileset::onUpdateFrame(const gsl::span& viewports) { +void OmniTileset::onUpdateFrame(const gsl::span& viewports, bool waitForLoadingTiles) { if (!UsdUtil::primExists(_pContext->getUsdStage(), _path)) { // TfNotice can be slow, and sometimes we get a frame or two before we actually get a chance to react on it. // This guard prevents us from crashing if the prim no longer exists. @@ -646,7 +646,7 @@ void OmniTileset::onUpdateFrame(const gsl::span& viewports) { } updateTransform(); - updateView(viewports); + updateView(viewports, waitForLoadingTiles); if (!_extentSet) { _extentSet = updateExtent(); @@ -675,7 +675,7 @@ void OmniTileset::updateTransform() { } } -void OmniTileset::updateView(const gsl::span& viewports) { +void OmniTileset::updateView(const gsl::span& viewports, bool waitForLoadingTiles) { const auto visible = UsdUtil::isPrimVisible(_pContext->getUsdStage(), _path); if (visible && !getSuspendUpdate()) { @@ -687,7 +687,11 @@ void OmniTileset::updateView(const gsl::span& viewports) { _viewStates.push_back(UsdUtil::computeViewState(*_pContext, georeferencePath, _path, viewport)); } - _pViewUpdateResult = &_pTileset->updateView(_viewStates); + if (waitForLoadingTiles) { + _pViewUpdateResult = &_pTileset->updateViewOffline(_viewStates); + } else { + _pViewUpdateResult = &_pTileset->updateView(_viewStates); + } } if (!_pViewUpdateResult) { diff --git a/src/plugins/CesiumUsdSchemas/generatedSchema.usda.in b/src/plugins/CesiumUsdSchemas/generatedSchema.usda.in index b102945a..9cc6a15b 100644 --- a/src/plugins/CesiumUsdSchemas/generatedSchema.usda.in +++ b/src/plugins/CesiumUsdSchemas/generatedSchema.usda.in @@ -47,14 +47,6 @@ class CesiumDataPrim "CesiumDataPrim" ( displayName = "Texture Pool Initial Capacity" doc = "Debug option that controls the initial capacity of the texture pool." ) - string cesium:projectDefaultIonAccessToken = "" ( - displayName = "Project default ion Access Token" - doc = "DEPRECATED: A string representing the token for accessing Cesium ion assets. Moved to CesiumIonServerPrim. Will be removed in a future version." - ) - string cesium:projectDefaultIonAccessTokenId = "" ( - displayName = "Project default ion Access Token ID" - doc = "DEPRECATED: A string representing the token ID for accessing Cesium ion assets. Moved to CesiumIonServerPrim. Will be removed in a future version." - ) rel cesium:selectedIonServer ( displayName = "Selected ion Server context" doc = "The current ion Server prim used in the Cesium for Omniverse UI." @@ -343,7 +335,7 @@ class "CesiumRasterOverlayPrim" ( } class CesiumIonRasterOverlayPrim "CesiumIonRasterOverlayPrim" ( - doc = "Adds a prim for representing an Ion raster overlay." + doc = "Adds a prim for representing an ion raster overlay." ) { float cesium:alpha = 1 ( diff --git a/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/data.cpp b/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/data.cpp index 73e7e8fd..329a9fe6 100644 --- a/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/data.cpp +++ b/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/data.cpp @@ -80,40 +80,6 @@ CesiumData::_GetTfType() const return _GetStaticTfType(); } -UsdAttribute -CesiumData::GetProjectDefaultIonAccessTokenAttr() const -{ - return GetPrim().GetAttribute(CesiumTokens->cesiumProjectDefaultIonAccessToken); -} - -UsdAttribute -CesiumData::CreateProjectDefaultIonAccessTokenAttr(VtValue const &defaultValue, bool writeSparsely) const -{ - return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumProjectDefaultIonAccessToken, - SdfValueTypeNames->String, - /* custom = */ false, - SdfVariabilityVarying, - defaultValue, - writeSparsely); -} - -UsdAttribute -CesiumData::GetProjectDefaultIonAccessTokenIdAttr() const -{ - return GetPrim().GetAttribute(CesiumTokens->cesiumProjectDefaultIonAccessTokenId); -} - -UsdAttribute -CesiumData::CreateProjectDefaultIonAccessTokenIdAttr(VtValue const &defaultValue, bool writeSparsely) const -{ - return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumProjectDefaultIonAccessTokenId, - SdfValueTypeNames->String, - /* custom = */ false, - SdfVariabilityVarying, - defaultValue, - writeSparsely); -} - UsdAttribute CesiumData::GetDebugDisableMaterialsAttr() const { @@ -314,8 +280,6 @@ const TfTokenVector& CesiumData::GetSchemaAttributeNames(bool includeInherited) { static TfTokenVector localNames = { - CesiumTokens->cesiumProjectDefaultIonAccessToken, - CesiumTokens->cesiumProjectDefaultIonAccessTokenId, CesiumTokens->cesiumDebugDisableMaterials, CesiumTokens->cesiumDebugDisableTextures, CesiumTokens->cesiumDebugDisableGeometryPool, diff --git a/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/data.h b/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/data.h index 9468d237..9dbaf143 100644 --- a/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/data.h +++ b/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/data.h @@ -125,50 +125,6 @@ class CesiumData : public UsdTyped CESIUMUSDSCHEMAS_API const TfType &_GetTfType() const override; -public: - // --------------------------------------------------------------------- // - // PROJECTDEFAULTIONACCESSTOKEN - // --------------------------------------------------------------------- // - /// DEPRECATED: A string representing the token for accessing Cesium ion assets. Moved to CesiumIonServerPrim. Will be removed in a future version. - /// - /// | || - /// | -- | -- | - /// | Declaration | `string cesium:projectDefaultIonAccessToken = ""` | - /// | C++ Type | std::string | - /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String | - CESIUMUSDSCHEMAS_API - UsdAttribute GetProjectDefaultIonAccessTokenAttr() const; - - /// See GetProjectDefaultIonAccessTokenAttr(), and also - /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create. - /// If specified, author \p defaultValue as the attribute's default, - /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true - - /// the default for \p writeSparsely is \c false. - CESIUMUSDSCHEMAS_API - UsdAttribute CreateProjectDefaultIonAccessTokenAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const; - -public: - // --------------------------------------------------------------------- // - // PROJECTDEFAULTIONACCESSTOKENID - // --------------------------------------------------------------------- // - /// DEPRECATED: A string representing the token ID for accessing Cesium ion assets. Moved to CesiumIonServerPrim. Will be removed in a future version. - /// - /// | || - /// | -- | -- | - /// | Declaration | `string cesium:projectDefaultIonAccessTokenId = ""` | - /// | C++ Type | std::string | - /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String | - CESIUMUSDSCHEMAS_API - UsdAttribute GetProjectDefaultIonAccessTokenIdAttr() const; - - /// See GetProjectDefaultIonAccessTokenIdAttr(), and also - /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create. - /// If specified, author \p defaultValue as the attribute's default, - /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true - - /// the default for \p writeSparsely is \c false. - CESIUMUSDSCHEMAS_API - UsdAttribute CreateProjectDefaultIonAccessTokenIdAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const; - public: // --------------------------------------------------------------------- // // DEBUGDISABLEMATERIALS diff --git a/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/ionRasterOverlay.h b/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/ionRasterOverlay.h index b6a4f946..80a590fb 100644 --- a/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/ionRasterOverlay.h +++ b/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/ionRasterOverlay.h @@ -29,7 +29,7 @@ class SdfAssetPath; /// \class CesiumIonRasterOverlay /// -/// Adds a prim for representing an Ion raster overlay. +/// Adds a prim for representing an ion raster overlay. /// class CesiumIonRasterOverlay : public CesiumRasterOverlay { diff --git a/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/tokens.h b/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/tokens.h index ce48fa09..fd5f669d 100644 --- a/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/tokens.h +++ b/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/tokens.h @@ -237,11 +237,11 @@ struct CesiumTokensType { const TfToken cesiumPreloadSiblings; /// \brief "cesium:projectDefaultIonAccessToken" /// - /// CesiumIonServer, CesiumData + /// CesiumIonServer const TfToken cesiumProjectDefaultIonAccessToken; /// \brief "cesium:projectDefaultIonAccessTokenId" /// - /// CesiumIonServer, CesiumData + /// CesiumIonServer const TfToken cesiumProjectDefaultIonAccessTokenId; /// \brief "cesium:rasterOverlayBinding" /// diff --git a/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/wrapData.cpp b/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/wrapData.cpp index 711e8276..6bdae671 100644 --- a/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/wrapData.cpp +++ b/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/wrapData.cpp @@ -26,20 +26,6 @@ namespace { WRAP_CUSTOM; -static UsdAttribute -_CreateProjectDefaultIonAccessTokenAttr(CesiumData &self, - object defaultVal, bool writeSparsely) { - return self.CreateProjectDefaultIonAccessTokenAttr( - UsdPythonToSdfType(defaultVal, SdfValueTypeNames->String), writeSparsely); -} - -static UsdAttribute -_CreateProjectDefaultIonAccessTokenIdAttr(CesiumData &self, - object defaultVal, bool writeSparsely) { - return self.CreateProjectDefaultIonAccessTokenIdAttr( - UsdPythonToSdfType(defaultVal, SdfValueTypeNames->String), writeSparsely); -} - static UsdAttribute _CreateDebugDisableMaterialsAttr(CesiumData &self, object defaultVal, bool writeSparsely) { @@ -152,20 +138,6 @@ void wrapCesiumData() .def(!self) - .def("GetProjectDefaultIonAccessTokenAttr", - &This::GetProjectDefaultIonAccessTokenAttr) - .def("CreateProjectDefaultIonAccessTokenAttr", - &_CreateProjectDefaultIonAccessTokenAttr, - (arg("defaultValue")=object(), - arg("writeSparsely")=false)) - - .def("GetProjectDefaultIonAccessTokenIdAttr", - &This::GetProjectDefaultIonAccessTokenIdAttr) - .def("CreateProjectDefaultIonAccessTokenIdAttr", - &_CreateProjectDefaultIonAccessTokenIdAttr, - (arg("defaultValue")=object(), - arg("writeSparsely")=false)) - .def("GetDebugDisableMaterialsAttr", &This::GetDebugDisableMaterialsAttr) .def("CreateDebugDisableMaterialsAttr", diff --git a/src/public/CesiumOmniverse.cpp b/src/public/CesiumOmniverse.cpp index 9a7c709e..bff2b1ed 100644 --- a/src/public/CesiumOmniverse.cpp +++ b/src/public/CesiumOmniverse.cpp @@ -41,9 +41,9 @@ class CesiumOmniversePlugin final : public ICesiumOmniverseInterface { } } - void onUpdateFrame(const ViewportApi* viewports, uint64_t count) noexcept override { + void onUpdateFrame(const ViewportApi* viewports, uint64_t count, bool waitForLoadingTiles) noexcept override { const auto span = gsl::span(reinterpret_cast(viewports), count); - _pContext->onUpdateFrame(span); + _pContext->onUpdateFrame(span, waitForLoadingTiles); } void onUsdStageChanged(long stageId) noexcept override {