Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit Inputs for NodeGraph instances #849

Open
bernardkwok opened this issue Apr 16, 2020 — with MURAL · 1 comment
Open

Explicit Inputs for NodeGraph instances #849

bernardkwok opened this issue Apr 16, 2020 — with MURAL · 1 comment
Assignees
Labels
Core Core change required Enhancement New feature or request ShaderGen Shader Generation change required
Milestone

Comments

Copy link

bernardkwok commented Apr 16, 2020

Proposal

Allow for inputs to be explicitly listed "published" for nodegraphs.

  • This makes the interface consistent with that used for nodes.
  • This makes the interface consistent for inputs and outputs within a nodegraph:
    Most notably, this allows for connections from nodes which are not within the NodeGraph to inputs in the NodeGraph. Currently only outputs within a NodeGraph can be connected to non-NodeGraph inputs.

Upgrade Path:

  • Internal inputs can connect to explicit inputs using the existing interfacename attribute for now to maintain syntax compatibility.
  • This means that "interfacename" can be allowed without the nodegraph being a node definition (nodedef), and validation logic would change to reflect this.

Examples

<nodegraph name="graph1">
   <input name="input1" type="float" />
   <input name="input2" type="float/>
   <output name="out1" type="float" nodename="addnode" />
   <add name="addnode" type="float">
      <input name="in1" type="float" value="1.0" interfacename="input1/>
      <input name="in2" type="float" value="0.0" interfacename="input2" />
    </add>
</nodegraph>

Here 2 inputs are defined input1 and input2 which route data to the add node.

Example 2:

<constant name="foo1" type="float" value="2.3">

<nodegraph name="graph1">
   <input name="input1" type="float" nodename="foo1"/>
   <input name="input2" type="float/>
   <output name="out1" type="float" nodename="addnode" />
   <add name="addnode" type="float">
      <input name="in1" type="float" value="1.0" interfacename="input1/>
      <input name="in2" type="float" value="0.0" interfacename="input2" />
    </add>
</nodegraph>

Here is the same example but connected to a non-nodegrah node foo1 via input `input1.

@bernardkwok bernardkwok added Core Core change required Enhancement New feature or request ShaderGen Shader Generation change required labels Apr 16, 2020 — with MURAL
@bernardkwok bernardkwok changed the title Explicit Inputs for nodegaphs Explicit Inputs for NodeGraph instances Apr 16, 2020
@bernardkwok bernardkwok added this to the 1.38 milestone Apr 17, 2020
@bernardkwok bernardkwok self-assigned this Dec 9, 2020
@bernardkwok
Copy link
Author

Note that a graph like this will be handled after looking at #1062 which would encapsulate the nodegraph properly to avoid conflicts.

<?xml version="1.0"?>
<materialx version="1.37">
   <!-- Check for inputs with same nodenames at different levels -->
   <constant name="foo1" type="color3">
      <parameter name="value" type="color3" value="1, 0, 0"/>
   </constant>
   <nodegraph name="nodename_check" >
      <input name="in1" type="color3" nodename="foo1" />
      <input name="in2" type="color3" value="0, 1, 0" />
      <constant name="foo1" type="float">
         <parameter name="value" type="float" value="0.5"/>
      </constant>
      <mix name="mix1" type="color3">
         <input name="bg" type="color3" interfacename="in1" />
         <input name="fg" type="color3" interfacename="in1" />
         <input name="mix" type="float" nodename="foo1" />
      </mix>
      <output name="out_nodename_check" type="color3" nodename="mix1" />
   </nodegraph>
</materialx>

@bernardkwok bernardkwok modified the milestones: 1.38, 1.39 Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Core change required Enhancement New feature or request ShaderGen Shader Generation change required
Projects
None yet
Development

No branches or pull requests

2 participants