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

USDShader fixes/improvements #6076

Open
wants to merge 2 commits into
base: 1.4_maintenance
Choose a base branch
from

Conversation

boberfly
Copy link
Collaborator

@boberfly boberfly commented Oct 9, 2024

Generally describe what this PR will do, and why it is needed

  • USDShader : Fixed default preset values on IntPlugs that are intended to be enum indexes instead of string values.

These are the small things I noticed when I added Material X nodes as USDShader nodes, the enumerator presets were a string list in the UI when they should be integer indexes.

  • USDLight : Append the (Renderman) suffix to any USD Lux plugs with ri:light: prefix.

I have a build with the Prman USD plugin compiled in, and these extra parameters are on USDLight nodes. This just puts a suffix on the end like the Arnold parameters on Lux lights.

Related issues

  • NA

Dependencies

  • NA

Breaking changes

  • NA

Checklist

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have tested my change(s) in the test suite, and added new test cases where necessary.
  • My code follows the Gaffer project's prevailing coding style and conventions.

Comment on lines +205 to +208
if allowedTokens and isinstance( plug, Gaffer.IntPlug ) :
return IECore.IntVectorData( [ i for i in range( len( allowedTokens ) ) ] )
else :
return IECore.StringVectorData( allowedTokens ) if allowedTokens else None
Copy link
Member

Choose a reason for hiding this comment

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

Could you give me an example of a shader where this is necessary? I want to refresh my memory and check that this isn't a symptom of a problem elsewhere.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That one I didn't hit in my testing of MaterialX nodes but the check after it is the one which works for me, so this one might be redundant - the IntPlug check should keep it harmless to leave in though...

Copy link
Member

Choose a reason for hiding this comment

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

Yep, but what shader can I use to see the problem? I want to check that the problem isn't in the way we're loading the shader rather than in the UI...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I was checking with gltf_surface with the alpha mode plug but there were other shaders I was coming across that needed it, I'll get back to you on a few more tomorrow. I did see from the mtlx schema that they register as integer and not token so I think the loading part was correct (I think token/string is a better approach if that enum list changes though).

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