AcademySoftwareFoundation / AcademySoftwareFoundation/MaterialX

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

Open
#1,785 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.3k
Forks
451
Avg merge
4d 11h
Merged PRs (30d)
8

Description

## Background

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

This is codified in `PortElement` validation [here](https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/source/MaterialXCore/Interface.cpp#L164-L171)

### Situation

When adding in nodegraph-to-nodegraph a[ test file ](https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/resources/Materials/TestSuite/stdlib/nodegraph_inputs/cascade_nodegraphs.mtlx#L29-L30 ) 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 ?

Contributor guide

Open the contributing guide

Research direction

Start by reading the PortElement validation in source/MaterialXCore/Interface.cpp and the nodegraph-to-nodegraph example in resources/Materials/TestSuite/stdlib/nodegraph_inputs/cascade_nodegraphs.mtlx. Determine whether top-level output connections to nodegraphs are valid under the specification; done means the specification, validation behavior, and test file consistently reflect the resolved decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.