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

Large refactor of the C++ code #626

Closed lilleyse closed 7 months ago

lilleyse commented 7 months ago

Fixes https://github.com/CesiumGS/cesium-omniverse/issues/539 Fixes https://github.com/CesiumGS/cesium-omniverse/issues/584 Fixes https://github.com/CesiumGS/cesium-omniverse/issues/600 Fixes https://github.com/CesiumGS/cesium-omniverse/issues/588 Fixes https://github.com/CesiumGS/cesium-omniverse/issues/616

This is a wide reaching cleanup PR that has both functional changes and C++ style changes. Ideally this would have been spit into multiple PRs, but here we are 🤕

Globe Anchors

Asset Registry

Context

File changes

Style changes

Other changes

timoore commented 7 months ago

When I write a mega-change like this, I try to break it up after the fact into commits that could at least compile and might even work. I'm a fan of the workflow described in https://git-scm.com/docs/git-stash#Documentation/git-stash.txt-Testingpartialcommits for going about this. I do this for the obvious reasons of:

I have no idea if it is practical to do this for this commit, or even a good use of time, so this is just a noob suggestion!

lilleyse commented 7 months ago

Thanks for the suggestion @timoore. It could be tricky to detangle things at this point, but I agree with everything you said. I haven't tried that specific workflow but I'll give it a shot the next time this happens (which hopefully won't be very often).

corybarr commented 7 months ago

This isn't related to this PR, but it is making me ask the question of if there's a better approach than having a CesiumCartographicPolygon contain one BasisCurves and one GlobeAnchor. I'm wondering if we want to have CesiumCartographicPolygon prims potentially share a GlobeAnchor. If we ever wanted to shift all CartographicPolygons' GlobeAnchors, we'd need to do each individually. Maybe that's rare in workflows, or could be something in PowerTools.

corybarr commented 7 months ago

There's an issue in this branch that doesn't reproduce in main. If you de-parent a CesiumPolygonImageryPrim from a CesiumTilesetPrim by dragging it in the Stage Window, then when you re-parent the CesiumPolygonImageryPrim its polygon won't clip. To reproduce:

  1. Open the USDA file. You'll see two clipped polygons:

image

  1. Create a Scope
  2. Drag a CesiumPolygonImageryPrim to the scope :

image

  1. Drag the CesiumPolygonImageryPrim back to the CesiumTilesetPrim
  2. Refresh the tileset: image

clippingTest.twoPolygonLayers.cleanupBranch.usda.zip

lilleyse commented 7 months ago

@corybarr that was fixed in https://github.com/CesiumGS/cesium-omniverse/pull/626/commits/be1024cac2de62f0a5e770136eab40530804dc0a. We must have both independently discovered the issue around the same time.

corybarr commented 7 months ago

@corybarr that was fixed in be1024c. We must have both independently discovered the issue around the same time.

Already fixed. Awesome.

lilleyse commented 7 months ago

I disabled building tests on CI - I was seeing linker errors that I couldn't reproduce locally and don't really have the energy to figure out. The test infrastructure needs to be rethought in order to be CI compatible.

[100%] Linking CXX shared module ../../lib/CesiumOmniverseCppTestsPythonBindings.cpython-310-x86_64-linux-gnu.so
lto-wrapper: warning: using serial compilation of 2 LTRANS jobs
/usr/bin/ld: ../../lib/libCesiumOmniverseCore.a(UsdTokens.cpp.o): in function `carb::cpp::atomic<carb::detail::CachedInterface<omni::fabric::IToken, (char const*)0>::RequestState>::wait(carb::detail::CachedInterface<omni::fabric::IToken, (char const*)0>::RequestState, std::memory_order) const':
UsdTokens.cpp:(.text._ZNK4carb3cpp6atomicINS_6detail15CachedInterfaceIN4omni6fabric6ITokenELPKc0EE12RequestStateEE4waitESA_St12memory_order[_ZNK4carb3cpp6atomicINS_6detail15CachedInterfaceIN4omni6fabric6ITokenELPKc0EE12RequestStateEE4waitESA_St12memory_order]+0xbd): undefined reference to `carb::thread::detail::ParkingLot::WaitBucket::bucket(void const*)::waitBuckets'
/usr/bin/ld: ../../lib/libCesiumOmniverseCore.a(UsdTokens.cpp.o): relocation R_X86_64_PC32 against undefined hidden symbol `_ZZN4carb6thread6detail10ParkingLot10WaitBucket6bucketEPKvE11waitBuckets' can not be used when making a shared object
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
gmake[2]: *** [tests/bindings/CMakeFiles/CesiumOmniverseCppTestsPythonBindings.dir/build.make:159: lib/CesiumOmniverseCppTestsPythonBindings.cpython-310-x86_64-linux-gnu.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:678: tests/bindings/CMakeFiles/CesiumOmniverseCppTestsPythonBindings.dir/all] Error 2
gmake: *** [Makefile:166: all] Error 2
lilleyse commented 7 months ago

@corybarr I don't think I can get to the sign out issue in this PR, though I would like to address it before the release.

I'm marking the PR as non-draft now. I think I've tested as much as I can and it would be good to get this finally merged.