From de2e3bec924b42d4177144d45f2eea01815e213d Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Tue, 13 Feb 2024 14:16:32 -0500 Subject: [PATCH] Remove projectDefaultIonAccessToken and projectDefaultIonAccessToken from CesiumDataPrim --- CHANGES.md | 1 + .../CesiumOmniverseCppTestsPythonBindings.pyi | 4 +- .../CesiumOmniversePythonBindings.pyi | 6 +-- .../cesium/omniverse/extension.py | 7 --- .../usd/plugins/CesiumUsdSchemas/__init__.pyi | 29 +++++------- .../schemas/cesium_schemas.usda | 16 ------- .../CesiumUsdSchemas/generatedSchema.usda.in | 10 +---- .../src/CesiumUsdSchemas/data.cpp | 36 --------------- .../src/CesiumUsdSchemas/data.h | 44 ------------------- .../src/CesiumUsdSchemas/ionRasterOverlay.h | 2 +- .../src/CesiumUsdSchemas/tokens.h | 4 +- .../src/CesiumUsdSchemas/wrapData.cpp | 28 ------------ 12 files changed, 18 insertions(+), 169 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e9019adde..f9d39cac2 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. diff --git a/exts/cesium.omniverse.cpp.tests/cesium/omniverse/cpp/tests/bindings/CesiumOmniverseCppTestsPythonBindings.pyi b/exts/cesium.omniverse.cpp.tests/cesium/omniverse/cpp/tests/bindings/CesiumOmniverseCppTestsPythonBindings.pyi index 8f84e483a..dce8a63b0 100644 --- a/exts/cesium.omniverse.cpp.tests/cesium/omniverse/cpp/tests/bindings/CesiumOmniverseCppTestsPythonBindings.pyi +++ b/exts/cesium.omniverse.cpp.tests/cesium/omniverse/cpp/tests/bindings/CesiumOmniverseCppTestsPythonBindings.pyi @@ -5,7 +5,5 @@ class ICesiumOmniverseCppTestsInterface: def run_all_tests(self) -> None: ... def set_up_tests(self, arg0: int) -> None: ... -def acquire_cesium_omniverse_tests_interface( - plugin_name: str = ..., library_path: str = ... -) -> ICesiumOmniverseCppTestsInterface: ... +def acquire_cesium_omniverse_tests_interface(plugin_name: str = ..., library_path: str = ...) -> ICesiumOmniverseCppTestsInterface: ... def release_cesium_omniverse_tests_interface(arg0: ICesiumOmniverseCppTestsInterface) -> None: ... diff --git a/exts/cesium.omniverse/cesium/omniverse/bindings/CesiumOmniversePythonBindings.pyi b/exts/cesium.omniverse/cesium/omniverse/bindings/CesiumOmniversePythonBindings.pyi index 4385f1fb2..9245409db 100644 --- a/exts/cesium.omniverse/cesium/omniverse/bindings/CesiumOmniversePythonBindings.pyi +++ b/exts/cesium.omniverse/cesium/omniverse/bindings/CesiumOmniversePythonBindings.pyi @@ -71,7 +71,7 @@ class ICesiumOmniverseInterface: def credits_start_next_frame(self) -> None: ... def get_asset_token_troubleshooting_details(self, *args, **kwargs) -> Any: ... def get_asset_troubleshooting_details(self, *args, **kwargs) -> Any: ... - def get_credits(self) -> List[Tuple[str, bool]]: ... + def get_credits(self) -> List[Tuple[str,bool]]: ... def get_default_token_troubleshooting_details(self, *args, **kwargs) -> Any: ... def get_render_statistics(self, *args, **kwargs) -> Any: ... def get_server_path(self) -> str: ... @@ -174,7 +174,5 @@ class Viewport: width: float def __init__(self) -> None: ... -def acquire_cesium_omniverse_interface( - plugin_name: str = ..., library_path: str = ... -) -> ICesiumOmniverseInterface: ... +def acquire_cesium_omniverse_interface(plugin_name: str = ..., library_path: str = ...) -> ICesiumOmniverseInterface: ... def release_cesium_omniverse_interface(arg0: ICesiumOmniverseInterface) -> None: ... diff --git a/exts/cesium.omniverse/cesium/omniverse/extension.py b/exts/cesium.omniverse/cesium/omniverse/extension.py index 79dc7f40a..3db98c592 100644 --- a/exts/cesium.omniverse/cesium/omniverse/extension.py +++ b/exts/cesium.omniverse/cesium/omniverse/extension.py @@ -498,10 +498,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.usd.plugins/cesium/usd/plugins/CesiumUsdSchemas/__init__.pyi b/exts/cesium.usd.plugins/cesium/usd/plugins/CesiumUsdSchemas/__init__.pyi index c519ba082..068c55af2 100644 --- a/exts/cesium.usd.plugins/cesium/usd/plugins/CesiumUsdSchemas/__init__.pyi +++ b/exts/cesium.usd.plugins/cesium/usd/plugins/CesiumUsdSchemas/__init__.pyi @@ -3,7 +3,6 @@ from typing import Any, ClassVar import Boost.Python import pxr.Usd import pxr.UsdGeom - __MFB_FULL_PACKAGE_NAME: str class Data(pxr.Usd.Typed): @@ -31,10 +30,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 +56,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 +462,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 +514,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 +535,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 +551,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 +559,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 98c947cfc..1612f17fe 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/src/plugins/CesiumUsdSchemas/generatedSchema.usda.in b/src/plugins/CesiumUsdSchemas/generatedSchema.usda.in index b102945a2..9cc6a15b6 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 73e7e8fd6..329a9fe64 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 9468d237e..9dbaf143d 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 b6a4f946f..80a590fb4 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 ce48fa09b..fd5f669db 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 711e82765..6bdae671d 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",