AcademySoftwareFoundation / MaterialX

MaterialX is an open standard for the exchange of rich material and look-development content across applications and renderers.
http://www.materialx.org/
Apache License 2.0
1.88k stars 356 forks source link

Add USD mesh loader to MaterialX tools #2012

Open ld-kerley opened 2 months ago

ld-kerley commented 2 months ago

It would be super handy to be able to load in USD Meshes in to MaterialXGraphEditor and MaterialXViewer.

I am imagining this to be an optional build time dependency, as we don't want to require all users of MaterialX to provide OpenUSD.

The OpenUSD file format is complex, and I would propose restricting this to just loading a meshes initially, this could potentially be expanded in the future.

Adding support for loading OpenUSD meshes, would potentially provide a route to loadin ga wide number of file formats, if those are loadable by the OpenUSD.

jstone-lucasfilm commented 2 months ago

This is a great suggestion, @ld-kerley, and for completeness I'll note that there are two potential paths forward:

  1. Adding geometric USD support through an optional dependency on OpenUSD.
  2. Adding geometric USD support through an optional dependency on TinyUSDZ.

The author of TinyUSDZ has already begun an implementation of option (2) in a fork of MaterialX, and we can try out this option here:

https://github.com/lighttransport/materialx

jo-chemla commented 1 month ago

After loading meshes, could these USD loaders also be used to import materials defined within a usd scene file to MaterialXGraphEditor and MaterialXViewer?

To my understanding this is supported via the UsdMtlx plugin/library. Also interesting slides detailing MaterialX support in USD Hydra from the MaterialX Virtual Town Hall at ASWF Open Source Days 2023 listed in the official materialx third-party support section.

Or should these materialx definitions be extracted from the usd file in order to be imported to the materialx tools suite for the moment?