OpenUSD icon indicating copy to clipboard operation
OpenUSD copied to clipboard

Apple : UsdMtlx MaterialXInfoAPI schema and MaterialX versioning

Open ld-kerley opened this issue 1 year ago • 13 comments

Description of Change(s)

Initial pass at adding MaterialXInfoAPI applied schema, and then using this in UsdMtlx file format reader to append the version to the UsdShadeMaterial prims created.

HdMtlx also updated to explicitly write the MaterialX version in to the document that is reconstructed.

Outstanding: I need some input on the best way to get to the MaterialX version attribute on the UsdShadeMaterial prim from inside HdMtlx. I've left a hardcoded version string in the code so far at the place I think I need it.

Fixes Issue(s)

  • [ ] I have verified that all unit tests pass with the proposed changes
  • [X] I have submitted a signed Contributor License Agreement

ld-kerley avatar Jul 09 '24 01:07 ld-kerley

Filed as internal issue #USD-9835

:heavy_exclamation_mark: Please make sure that a signed CLA has been submitted!

jesschimein avatar Jul 09 '24 17:07 jesschimein

/AzurePipelines run

jesschimein avatar Jul 09 '24 17:07 jesschimein

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Jul 09 '24 17:07 azure-pipelines[bot]

@tcauchois - I took a stab at what you suggested. I think it's functional, but likely there are style things that could be tidied up, but before going too far down that road I wanted to share where I'm at for feedback, and make sure this is along the right lines.

ld-kerley avatar Aug 30 '24 01:08 ld-kerley

/AzurePipelines run

jesschimein avatar Sep 03 '24 15:09 jesschimein

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Sep 03 '24 15:09 azure-pipelines[bot]

Hi @ld-kerley , we've been discussing the latest changes, and realizing that since the new data we're adding will potentially affect the network that gets built, it will, for instanced materials, be "prototype-affecting" data, rather than "per-instance data". With that in mind, we were thinking that the term "Config" captures the "weight" of the data better than "Info", which kind of implies it's just advisory (admitting it's unfortunate "info" is what's used in Shader/NodeDefAPI, a legacy Pixar (or maybe Katana?) thing).

Would you be willing to change the schema name to MaterialXConfigAPI and the new datasource member to config?

spiffmon avatar Sep 03 '24 22:09 spiffmon

I'm personally open to any naming, and can see why "Info" implies advisory. Is there precedent for "Config" elsewhere in USD? I'd like to raise this with the wider MaterialX/USD community and ensure the name change doesn't raise any flags for anyone else. If there's no existing precedent for "Config" then I might open the discussion for alternatives, but if the "Config" suggestion fits in to some already established USD nomenclature, we should certainly stick with that.

ld-kerley avatar Sep 03 '24 22:09 ld-kerley

There is "internal pixar" precedent in the Presto scenegraph that "config attributes" imply structural changes to a prim's definition; while we are continuing discussions on whether that mechanism will need to be reflected in OpenUSD, it's not a sure thing.

So sure, please do verify with the wider group and let us know if there are alt sugs!

spiffmon avatar Sep 03 '24 23:09 spiffmon

Perhaps of note, config is currently a keyword in usda (but I don't think that limits its usage in property names and namespace elements)

https://github.com/PixarAnimationStudios/OpenUSD/blob/dev/pxr/usd/sdf/textFileFormatParser.h#L99

nvmkuruc avatar Sep 04 '24 00:09 nvmkuruc

That's correct, @nvmkuruc . In fact, we've stopped authoring it in Presto/menva, but don't disallow it, for old assets. And yes, it doesn't restrict uses in property names or namespaces.

spiffmon avatar Sep 04 '24 00:09 spiffmon

/AzurePipelines run

jesschimein avatar Sep 05 '24 23:09 jesschimein

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Sep 05 '24 23:09 azure-pipelines[bot]