Skip to content

Conversation

@tellypresence
Copy link
Collaborator

@tellypresence tellypresence commented Jun 18, 2024

Overview

This PR provides limited support for loading USD model files

  • usd
  • usda
  • usdc
  • usdz

by leveraging the external tinyusdz project.

Closes #5547

Details

During build the entire tinyusdz repo is automatically cloned under the contrib/tinyusdz folder at a specific commit hash defined in code/CMakeLists.txt; currently the hash points to the latest commit on the main (dev) branch of the tinyusdz project. The source code is built alongside the rest of the assimp source code and becomes part of the output library file (.a/.so etc)

How to test this PR

  • Enable CMake option ASSIMP_BUILD_USD_IMPORTER*

*the USD import feature has to be explicitly disabled by default. If enabled, assimp's github CI PR automatic checks will

  • clone and build the external 3rd party tinyusdz project code
  • encounter compiler warnings
  • fail the PR since there must be zero compiler warnings

Discussion

#1332 "Support USD," 2 Jul 2017: insightful technical discussion

Appendix

Original PR was #5551 but got destroyed following force push due to confusion between the assimp branch named master and the assimp tag named master

@Christian-Prather
Copy link

Forgive some ignorance here but I was just wondering why the tinyusdz library and not OpenUSD for what I would assume would offer more support as its their format? Love your work by the way its been so useful with O3DE! Thank you.

@tellypresence
Copy link
Collaborator Author

tellypresence commented Jul 1, 2024

@Christian-Prather
Comments in issue #1332 indicate there's a lot of complexity around OpenUSD, to the point where it may not be feasible to integrate into assimp.

On the other hand, the TinyUSDZ project self-advertises as being self-contained and potentially easier to integrate:

TinyUSDZ is ... dependency-free... Other 3rd-party libraries included. Yes, you don't need pxrUSD/OpenUSD...!

@Christian-Prather
Copy link

@tellypresence
Thank you for the response that thread was insightful. I am wondering what support if any you may need to get tinyusdz added. Looks like a lot of good progress has been made already and many of the features are there! Would love to help out.

@tellypresence
Copy link
Collaborator Author

tellypresence commented Jul 9, 2024

@Christian-Prather
Thank you for your kind words, it's good to see that someone is watching this effort closely.

Currently this PR is sort of in limbo pending resumption of work on the rendermesh-refactor branch of tinyusdz; it was proceeding rapidly through April, but hasn't been touched in a couple of months. Turns out I missed that the rendermesh-refactor branch got merged back into dev (the main branch) so this PR has been updated to a recent commit of dev.

P.S. It's nice of you to offer to help, do you happen to have any contacts on the tinyusdz project? 😉

@tellypresence tellypresence changed the title [USD] Integrate "tinyusdz" project branch "rendermesh-refactor" [USD] Integrate "tinyusdz" project Jul 11, 2024
@tellypresence
Copy link
Collaborator Author

tellypresence commented Jul 12, 2024

As noted in the description, had to explicitly disable the USD feature CMake option to avoid the assimp github CI/PR checks rejecting the PR due to compiler warnings encountered in the external 3rd party tinyusdz project code.

If enabled by default, the tinyusdz repo will be automatically cloned, and the source files compiled, during the CI/PR checks. The compiler warnings in the 3rd party code will cause 2 tests to fail

  • C/C++ CI / ubuntu-latest-g++-build-and-test
  • C/C++ CI / windows-latest-cl.exe-build-and-test

C/C++ CI / ubuntu-latest-g++-build-and-test

Offending file is contrib/tinyusdz/autoclone/tinyusdz_repo-src/src/usdc-writer.cc, screenshot attached:
ci_failing_due_to_tinyusdz_code_ubuntu_Screenshot 2024-07-11 213726

C/C++ CI / windows-latest-cl.exe-build-and-test

Offending file is contrib/tinyusdz/autoclone/tinyusdz_repo-src/src/external/stb_image.h, screenshot attached:
ci_failing_due_to_tinyusdz_code_Screenshot 2024-07-11 213016

Steve M added 2 commits July 11, 2024 21:48
assimp github PR auto-CI checks clone/build the tinyusdz code, and reject PR
due to compiler warnings in the 3rd party external tinyusdz project
@kimkulling kimkulling merged commit 0cb1693 into assimp:master Jul 12, 2024
@kimkulling
Copy link
Member

Lets see. Thanks a lot for your great work!!!

@kimkulling kimkulling mentioned this pull request Jul 12, 2024
@dimitre
Copy link

dimitre commented Jul 12, 2024

Thank you for the great work!
Looking forward to a new release
cc: @danoli3

@Christian-Prather
Copy link

@Christian-Prather Thank you for your kind words, it's good to see that someone is watching this effort closely.

Currently this PR is sort of in limbo pending resumption of work on the rendermesh-refactor branch of tinyusdz; it was proceeding rapidly through April, but hasn't been touched in a couple of months. Turns out I missed that the rendermesh-refactor branch got merged back into dev (the main branch) so this PR has been updated to a recent commit of dev.

P.S. It's nice of you to offer to help, do you happen to have any contacts on the tinyusdz project? 😉

Unfortunately I do not :) but if needed happy to help out in any other way, super excited to see this merged!

@AMZN-Gene
Copy link
Contributor

AMZN-Gene commented Jul 23, 2024

Excited to see this! Going to try it out in O3DE.
How are usd references handled? Example, when car.usd references tire.usd, are both file merged and flattened into one mesh?
Also, will the next release contain this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

[USD] Support load .usd/.usda/.usdc/.usdz models via "tinyusdz" project

5 participants