Yes I never really paid attention to the fact that the mask input on a
keymix was not coming from the right like regular nodes.
I do have a function that checks if the mask is coming from within the tree.
The tool does it's job on most cases and like Howard says I can't count on
people naming their gizmos a certain way, so I'll just ignore them.
Thanks everyone for the help.
Erwan
On 21 Feb 2014 16:01, "Howard Jones" <[email protected]> wrote:

> As Michael clarified, a mask input is not the same as an input called
> 'mask'.
> If you are able to query the name that still won't help you catch
> everything. On a gizmo you are relying on everyone naming a mask input as
> 'mask' which is certainly not the case.
>
> You are also assuming that an input named 'mask' has the same
> functionality as a mask input.
> Again that's not the case.
>
> So you have to ignore gizmos, and use your tool for a mask input in the
> right hand side input case. Even here would you catch cases where the mask
> is pulled from the incoming alpha?
> It can do the same job but not use the mask input. Pythonically I don't
> know if there's a difference but it can perform the same job.
>
> Howard
>
> On 21 Feb 2014, at 22:55, Erwan Leroy <[email protected]> wrote:
>
> Thanks Mike for the explanation.
> I can see your point, and I'll have to find a workaround for gizmos if I
> want my tool to work 100% of the time.
> It just lets me wish there was a quick way to query the name of an input
> instead of just it's number. I say someone asking for that in another
> thread and that would sure be helpful in some cases.
> Thx.
> Erwan
> On 21 Feb 2014 14:47, "Michael Habenicht" <[email protected]> wrote:
>
>> Technically speaking the keymix has no mask input. It has 3 normal inputs
>> where the third is called mask. That's why the knob is called differently.
>> You also don't know how the function works on gizmos that also have no
>> regular mask input but might have an input called mask which is used for
>> internal masking.
>>
>> Best regards,
>> Michael
>>
>> Am 21.02.2014 23:24, schrieb Erwan Leroy:
>>
>>> Hi Everyone,
>>> Ean, just a quick update on your function. After using a part of it for
>>> about a week, I ran into a small issue today while trying to show the
>>> mask input of a keymix.
>>> For some reason that node uses a knob called maskChannel instead of
>>> maskChannelMask, making your function believe this node had no mask
>>> input.
>>> It was easily fixed by adding a "or" to my if statement.
>>>
>>> I'll let you know if I run into another issue.
>>>
>>> Erwan
>>>
>>> On 12 Feb 2014 00:56, "Erwan Leroy" <[email protected]
>>> <mailto:[email protected]>> wrote:
>>>
>>>     Thanks a lot, that will probably work great.
>>>
>>>     On 12 Feb 2014 00:42, "Ean Carr" <[email protected]
>>>     <mailto:[email protected]>> wrote:
>>>
>>>         Hey Erwan,
>>>
>>>         I wrote these functions a few years ago after I posted that to
>>>         the list:
>>>
>>>         https://gist.github.com/anonymous/a802f51391163a2bf0e3
>>>
>>>         Just call get_mask_input_index(node). I haven't run into any
>>>         node which returns a bad index for the mask, but if you do, let
>>>         me know. Yeah, I wish Nuke would give us something like
>>>         node.maskInput()
>>>
>>>         Cheers
>>>
>>>
>>>         On Wed, Feb 12, 2014 at 3:08 AM, Erwan Leroy
>>>         <[email protected] <mailto:[email protected]>> wrote:
>>>
>>>             Hello everybody,
>>>             I've been playing around with python and nuke for a little
>>>             while now and starting to get more comfortable, but I hit a
>>>             roadblock today.
>>>
>>>             I'm trying to find a way to identify the mask input from
>>>             other inputs.
>>>
>>>             So far I have that very dirty piece of code that works most
>>>             of the time, but not always:
>>>
>>>             node=  nuke.selectedNode()
>>>             if  node.Class()  ==  'Merge2':
>>>                  maskInput=  2
>>>             else:
>>>                  maxInputs=  node.maxInputs()
>>>                  if  maxInputs>  1:
>>>                      maskInput=  maxInputs-1
>>>                  else:
>>>                      maskInput=  None
>>>
>>>
>>>             Is there any function like node.mask() or something similar?
>>>
>>>             The closest I found online was this post from 2011:
>>> https://www.mail-archive.com/nuke-python@support.
>>> thefoundry.co.uk/msg00508.html
>>>
>>>
>>>             thanks
>>>
>>>             Erwan
>>>
>>>
>>>             _______________________________________________
>>>             Nuke-python mailing list
>>>             [email protected]
>>>             <mailto:[email protected]>,
>>>             http://forums.thefoundry.co.uk/
>>>             http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/
>>> nuke-python
>>>
>>>
>>>
>>>
>>>         --
>>>
>>>
>>>         _______________________________________________
>>>         Nuke-python mailing list
>>>         [email protected]
>>>         <mailto:[email protected]>,
>>>         http://forums.thefoundry.co.uk/
>>>         http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/
>>> nuke-python
>>>
>>>
>>>
>>> _______________________________________________
>>> Nuke-python mailing list
>>> [email protected], http://forums.thefoundry.co.uk/
>>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>>>
>>>  _______________________________________________
>> Nuke-python mailing list
>> [email protected], http://forums.thefoundry.co.uk/
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>>
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to