MaterialXLoader: added invert implementation#29433
Merged
Merged
Conversation
- allow invert to be a number, vec 2|3|4, or color, subtracting the value from an optionally inputted amount field (which is defaulted to all parts 1 of the input type)
sunag
reviewed
Sep 19, 2024
Collaborator
|
The implementation of #29440 should be simple, in case you want to implement this PR? const extract_x = ( in1 ) => in1.x;The index parameter seems redundant here based on the function name... |
Contributor
Author
I think it's needed, here the not sure if this works? but this is the route i'll try (should work for colorN & vectorN) const extract = ( in1, index ) => in1[index]; |
- simplified invert function - removed unneeded imports - moved invert to math nodes
Collaborator
|
I think it's better to use element in this case, with const extract = ( in1, index ) => in1.element( index ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue: #29432
Description
Implemented the invert node for the MaterialXLoader
This contribution is funded by Needle