Skip to content

Fix token handling in functional nodegraphs#2363

Merged
jstone-lucasfilm merged 1 commit into
AcademySoftwareFoundation:mainfrom
kwokcb:nodedef_tokens
May 3, 2025
Merged

Fix token handling in functional nodegraphs#2363
jstone-lucasfilm merged 1 commit into
AcademySoftwareFoundation:mainfrom
kwokcb:nodedef_tokens

Conversation

@kwokcb

@kwokcb kwokcb commented May 3, 2025

Copy link
Copy Markdown
Contributor

Issue

Tokens on nodedefs are not checked when resolving inputs on nodes in a functional nodegraph.
Update: #2361

Change

Patch token search to check nodedef tokens when applying token resolution

Test

Modified existing token test and added in nodedef case.
Example below is evaluation of an instance of a definition using tokens to resolve the input file name to an unlit shader. The token is the image name.

<nodedef name="ND_token" node="token_image" >
    <token name="Image_Name" type="string" value="grid" uiname="Image Name" />
    <token name="Image_Extension" type="string" value="png" uiname="Image Extension" />
    <output name="out" type="color3"></output>
  </nodedef>
  <nodegraph name="NG_token" nodedef="ND_token">
    <tiledimage name="tiledimage" type="color3" nodedef="ND_tiledimage_color3">
      <input name="file" type="filename" uniform="true" value="resources/Images/[Image_Name].[Image_Extension]" />
    </tiledimage>
    <output name="out" type="color3" nodename="tiledimage" />
  </nodegraph>
  <nodegraph name="token_nodedef_graph">
    <token_image name="token_image1" type="color3">
    </token_image>
    <output name="out" type="color3" nodename="token_image1"></output>
  </nodegraph>

image

…und during token search.

Add in updated token test.

@jstone-lucasfilm jstone-lucasfilm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a good change to me, thanks @kwokcb!

@jstone-lucasfilm jstone-lucasfilm changed the title Fix: Check definition tokens when resolving functional nodegraph inputs Fix token handling in functional nodegraphs May 3, 2025
@jstone-lucasfilm jstone-lucasfilm merged commit 655bd40 into AcademySoftwareFoundation:main May 3, 2025
32 checks passed
@kwokcb kwokcb deleted the nodedef_tokens branch May 3, 2025 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants