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

Add tilesets/imagery/etc to the stage via the context menu #550

Open lilleyse opened 9 months ago

lilleyse commented 9 months ago

It would be convenient if tilesets, imagery layers, and other cesium prims could be added to the stage via the context menu. Currently if you want to do something simple like adding a second imagery layer to a tileset you need to add it in the .usda first.

For reference, see how globe anchors were added to the 3D viewport context menu.

weegeekps commented 9 months ago

This is a really easy, 30 minute to implement task. We just need to add a menu entry in CesiumAddMenuController which sends a cesium.omniverse.ADD_BLANK_ASSET event with a payload including a name and an ID of 0 (see: https://github.com/CesiumGS/cesium-omniverse/blob/11c2b3c0052c59585f46fcdd08d86f45a6f97887/exts/cesium.omniverse/cesium/omniverse/ui/quick_add_widget.py#L47) and it's done.

lilleyse commented 9 months ago

Possibly tangential to this issue, but it looks like it's possible to filter based on prim type when selecting a target prim for a rel property. This could be useful when selecting a CesiumCartographicPolygon referenced by a CesiumPolygonImagery, or selecting a globe anchor to be attached to a tileset or polygon.

For reference, look at physxPhysics:simulationOwner in kit-sdk which filters everything except UsdPhysics.Scene and PhysxSchema.PhysxParticleSystem.

Also check out mesh_skel_binding_widget.py in kit-sdk which inherits from UsdPropertiesWidget. You can also limit the number of targets:

return None, {"target_picker_filter_type_list": [UsdSkel.Skeleton], "targets_limit": 1}

CC @corybarr

Update: I opened a separate issue for this: https://github.com/CesiumGS/cesium-omniverse/issues/615