-
Notifications
You must be signed in to change notification settings - Fork 317
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
[WIP] Export: use nodes for Alpha clipping #2152
Conversation
Hello, |
The failures are just roundtrip tests, which is expected. They will pass when both import and export PRs are merged. I'm not planning on putting everything in one mega-PR. |
Closing, as we created a single PR with all alpha clipping stuff: #2155 |
if info['alphaColorAttrib'] is None: | ||
attr = get_color_attrib(alpha_nav) | ||
if attr is not None: | ||
info['alphaColorAttr'] = attr |
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.
Just found a typo here, should be 'alphaColorAtttrib'
|
||
attr = detect_multiply_by_color_attrib(alpha_nav) | ||
if attr is not None: | ||
info['alphaColorAttr'] = attr |
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.
Just found a typo here, should be 'alphaColorAtttrib'
prev.node.type == 'MIX' and | ||
prev.node.data_type == 'RGBA' and | ||
prev.node.blend_type == 'MULTIPLY' and | ||
prev.get_constant('Fac') == 1 |
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.
Typo here: Should be 'Factor'
Does #2111 for the exporter.
Uses nodes to determine the alpha mode and cutoff.
To export OPAQUE materials, just set Alpha to 1.
To export MASK materials, use either
round(alpha)
or1-(alpha < cutoff)
.(Constant 0 Alpha also exports as MASK.)
Other setups use BLEND.
Implemented by adding a
gather_alpha_info
function that parses all the info from nodes hanging off the Alpha socket except the texture. There are several utility functions to support it.This should also solve #2110 for Alpha color attributes (not RGB colors).
Tested lightly for both Principled and unlit with stuff like