MaterialX icon indicating copy to clipboard operation
MaterialX copied to clipboard

Specification Query: Can top level outputs be connected to upstream nodegraph?

Open kwokcb opened this issue 2 months ago • 0 comments

Background

According to the spec, only a upstream node nodename can be specified on an <output> node. This precludes the possibility of have nested nodegraphs or having a <output> at the document level from being connected to a `.

This is codified in PortElement validation here

Situation

When adding in nodegraph-to-nodegraph a test file was added which has top level outputs but it currently passes validation since it "cheats" and puts a "nodename" reference instead of a "nodegraph".

Issue / Query

Is the issue that

  1. the spec and implementation needs to allow this type of connection; or
  2. that validation for outputs does not catch an invalid case and hence needs addressing (and also hence the test file should be modified to remove the invalid connection.

Note that the code "(un)luckily" works since it can jump to the nodegraph even though the connects indicates it's a node.

It would be nice to move "forward" and allow for "nodegraph->output" connections but this may be premature as nested nodegraphs are not supported and AFAIK top level outputs are not used much ?

kwokcb avatar Apr 22 '24 14:04 kwokcb