Skip to content

Commit

Permalink
Merge branch 'main' into movie-capture-load-tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse authored Feb 14, 2024
2 parents 1a3b800 + 2945933 commit 91f487a
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 171 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 0 additions & 7 deletions exts/cesium.omniverse/cesium/omniverse/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,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)
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand All @@ -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: ...
Expand Down Expand Up @@ -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: ...
Expand Down Expand Up @@ -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
Expand All @@ -544,24 +536,22 @@ 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
def Get(cls, *args, **kwargs) -> Any: ...
@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: ...
Expand All @@ -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
Expand Down
16 changes: 0 additions & 16 deletions exts/cesium.usd.plugins/schemas/cesium_schemas.usda
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions genStubs.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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%
Expand Down
10 changes: 5 additions & 5 deletions genStubs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
10 changes: 1 addition & 9 deletions src/plugins/CesiumUsdSchemas/generatedSchema.usda.in
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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 (
Expand Down
36 changes: 0 additions & 36 deletions src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -314,8 +280,6 @@ const TfTokenVector&
CesiumData::GetSchemaAttributeNames(bool includeInherited)
{
static TfTokenVector localNames = {
CesiumTokens->cesiumProjectDefaultIonAccessToken,
CesiumTokens->cesiumProjectDefaultIonAccessTokenId,
CesiumTokens->cesiumDebugDisableMaterials,
CesiumTokens->cesiumDebugDisableTextures,
CesiumTokens->cesiumDebugDisableGeometryPool,
Expand Down
44 changes: 0 additions & 44 deletions src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/tokens.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
///
Expand Down
28 changes: 0 additions & 28 deletions src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/wrapData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 91f487a

Please sign in to comment.