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.78k stars 324 forks source link

Query: What is supposed to happen with multiple <materialx> tags in a document ? #1835

Open kwokcb opened 1 month ago

kwokcb commented 1 month ago

Query

I just accidently came across this. But if you have multiple <materialx></materialx> blocks what is supposed to occur ?

Currently it will just read the first block and discards subsequent blocks without any error / warning. A trivial thing, (and assume it's just how the parser works?) but users may become confused if some content does not read in.

jstone-lucasfilm commented 5 days ago

This is a good question, @kwokcb, and my initial thought is that documents with multiple materialx elements should be considered invalid, and should generate a warning in Document::validate. That would allow the current parser behavior to remain unchanged, but would provide guidance for exporters that unintentionally create this category of invalid documents.