diff --git a/CHANGES.md b/CHANGES.md index b67e8269..b2b252ea 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/cesium/omniverse/extension.py b/exts/cesium.omniverse/cesium/omniverse/extension.py index 79dc7f40..3db98c59 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 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/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",