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

Added "BW" Grayscale and "A" Alpha channel support #2314

Merged
merged 15 commits into from
Nov 18, 2018

Conversation

alessandro-zomparelli
Copy link
Collaborator

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:

  • [x ] Code changes complete.
  • Code documentation complete.
  • Documentation for users complete (or not required, if user never sees these changes).
  • [ x] Manual testing done.
  • Unit-tests implemented.
  • [ x] Ready for merge.

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])]
Copy link
Collaborator

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...
image
https://en.wikipedia.org/wiki/Grayscale

Copy link
Collaborator Author

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 ;)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

: ]

@zeffii
Copy link
Collaborator

zeffii commented Nov 17, 2018

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 :)

@alessandro-zomparelli
Copy link
Collaborator Author

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:
Copy link
Collaborator

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):
    ...

Copy link
Collaborator Author

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.

@zeffii zeffii merged commit ab50e95 into nortikin:master Nov 18, 2018
@zeffii
Copy link
Collaborator

zeffii commented Nov 18, 2018

ok. i'll leave it for now. merged anyway.

@zeffii
Copy link
Collaborator

zeffii commented Nov 18, 2018

done.

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

Successfully merging this pull request may close these issues.

2 participants