-
Notifications
You must be signed in to change notification settings - Fork 124
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
USDScene : Fix writing of UsdLux lights #1376
Conversation
This still needs a review before I can make a Cortex release @danieldresser-ie. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies this took me a while to get to - all looks good except for one comment that seems to have been pasted in the wrong place.
// | ||
// - The output shader is written as a UsdLight-derived prim rather than a UsdShadeShader. | ||
// - The other shaders are parented inside the light. | ||
// - We don't need to create a UsdShadeOutput to return. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment seems to belong with writeLight, not readShaderNetwork?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for spotting that - fixed in f174f8d.
We were writing them as regular material assignments before, which might have round-tripped back into Gaffer OK, but which were not what other USD clients needed. We need to make sure that the primary shader is written as a `UsdLux*Light` prim, and that any input shaders are stored as children of that prim. We still share most of the implementation with the generic material-writing code, but with differences in orchestration. It would have been possible to continue to do this with one `writeShaderNetwork()` uber-function internally with a bunch of conditionals depending on whether or not we were writing lights. But I felt that it was clearer and more maintainable to have two small top-level functions that each made appropriate calls to a set of shared utility functions.
These cases occur when writing to UsdLuxLight types where the inputs already exist, and don't need to be defined by us.
LGTM |
Companion to GafferHQ/gaffer#5400, allowing Gaffer to author and export UsdLux lights.