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

UsdMtlxSplitStringArray Parses Spaces Incorrectly #2268

Closed
feldstj opened this issue Feb 13, 2023 · 1 comment
Closed

UsdMtlxSplitStringArray Parses Spaces Incorrectly #2268

feldstj opened this issue Feb 13, 2023 · 1 comment

Comments

@feldstj
Copy link
Contributor

feldstj commented Feb 13, 2023

Description of Issue

UsdMtlxSplitStringArray splits strings currently based on commas and spaces. Certain enums such as ND_lama_sss's sssMode assume that the spaces in the enum labels will not be used to split the enum labels. The fix is to only split on commas and to remove leading and trailing whitespace from the results.

Steps to Reproduce

from pxr import Sdr
r = Sdr.Registry()
n = r.GetShaderNodeByIdentifier("ND_lama_sss")
t = n.GetShaderInput("sssMode")
print(t.GetOptions())

Result: [('Path-traced', ''), ('Davis', ''), ('Path-traced', ''), ('exponential', ''), ('Diffusion', ''), ('Burley', ''), ('Diffusion', ''), ('Burley', ''), ('(mean', ''), ('free', ''), ('path)', '')]

Expected: [('Path-traced Davis', '0'), ('Path-traced exponential', '1'), ('Diffusion Burley', '2'), ('Diffusion Burley (mean free path)', '3')]

System Information (OS, Hardware)

Package Versions

Build Flags

Enable MaterialX.

@tallytalwar
Copy link
Contributor

Filed as internal issue #USD-8006

This issue was closed.
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

No branches or pull requests

2 participants