Thanks Nathan, this will actually work for me. Indeed, the inputs are just so the user can connect my gizmos together but they are used internally not through a DAG but to extract information from them and do stuff with it from python, that's why I need to know their names. Also, the number of inputs is dynamic and user controlled through a button on the actual gizmo so knowing the actual index is not always known. the number knob will be very useful.

Thanks again!

Daniel.


On 5/17/2012 4:48 PM, Nathan Rusch wrote:
Inputs are indexed in the order in which the internal Input nodes are created, so the first Input node gets index 0, the second gets index 1, etc. Thus, if you need to reorder your inputs, you can simply delete and re-create your input nodes in the desired order.

Every Input node has a hidden 'number' knob that holds its index. You can use this to get from the name to the index if you really want to, but it's a lot easier to just know your input indices and deal only with them (i.e. there are few cases you would actually want/need to know the name of an input, since its only purpose is a user-facing indicator).

Note that if an Input node's name starts with Input, that portion of the node name is omitted from the input pipe label on the parent Group/Gizmo.

Also, this is a handy knob default to add to your init.py:

nuke.knobDefault('Input.label', 'input [value number]')

Hope this helps,

-Nathan

-----Original Message----- From: Daniel Gollás
Sent: Thursday, May 17, 2012 2:39 PM
To: [email protected]
Subject: [Nuke-users] Gizmo/Group input names

Hi,
I am building a gizmo that will have much of it's logic controlled
through python.
I know I can get the nodes that are connected to the gizmo with the
gizmo1.input(i) method from python, but how can I know what "Input"
arrow it is connected to?

For example, if I was creating an Over gizmo, I would have InputA and
InputB Input nodes, how could I know which input(i) corresponds to A and
which to B?

I tried (following the example above ) to get the inputs for the actual
InputA node but it always says there is 0 inputs. Also tried
InputA.dependencies() with an empty list returned.

Thanks.

Daniel.

_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Reply via email to