CesiumGS / cesium-omniverse

Bringing the 3D geospatial ecosystem to Omniverse
https://cesium.com/platform/cesium-for-omniverse/
Apache License 2.0
55 stars 7 forks source link

Fix globe anchors on prims that don't have all xform ops set #643

Closed lilleyse closed 7 months ago

lilleyse commented 7 months ago

Globe anchors were only working on prims that had either all xform ops set or no xform ops set.

The code below where only the translation is set now works:

from cesium.usd.plugins.CesiumUsdSchemas import CartographicPolygon
from asyncio import ensure_future
from pxr import UsdGeom

polygon_path = "/polygon"
ctx = omni.usd.get_context()
stage = ctx.get_stage()
polygon = CartographicPolygon.Define(stage, polygon_path)
polygon_prim = polygon.GetPrim()
xformCommonApi = UsdGeom.XformCommonAPI(polygon_prim)
xformCommonApi.SetTranslate((10, 0, 0))