-
Notifications
You must be signed in to change notification settings - Fork 233
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
Added "BW" Grayscale and "A" Alpha channel support #2314
Conversation
Updating Fork
nodes/analyzer/evaluate_image.py
Outdated
else: | ||
red[0].append(0) | ||
green[0].append(0) | ||
blue[0].append(0) | ||
alpha[0].append(0) | ||
if outputs['BW'].is_linked: | ||
bw[0] = [(r+g+b)/3 for r,g,b in zip(red[0], green[0], blue[0])] |
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.
(r+g+b)/3
?
not to be picky but...
https://en.wikipedia.org/wiki/Grayscale
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.
You are not picky, it's my bad. I was to hurried :P, I'll fix that ;)
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.
: ]
adding sockets at the top of the socket list (either inputs or outputs) will break layouts that contain versions of the node before the update, best practice is to add sockets to the end of the socket lists. UI coding is the painful part of nodes :) |
Thanks for pointing out, I didn't know that. |
green = [[]] | ||
blue = [[]] | ||
|
||
if outputs['R'].is_linked or outputs['G'].is_linked or outputs['B'].is_linked: | ||
if outputs['R'].is_linked or outputs['G'].is_linked or outputs['B'].is_linked or outputs['A'].is_linked or outputs['BW'].is_linked: |
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.
if any(socket.is_linked for socket in self.outputs):
...
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.
That's magic :D
Unfortunately I'll be on vacation for two weeks (Mexico with no PC). I will be able to handle that only at beginning of December. If you want to fix that in the meanwhile, fell free to modify it. Otherwise I'll take care of it when I'll be back.
ok. i'll leave it for now. merged anyway. |
done. |
Addressed problem description
Based on the suggestion of @enzyme69 I added two more output sockets for grayscale and alpha channel
Preflight checklist
Put an x letter in each brackets when you're done this item: