There's no way to do this without rolling your own input management.
Here's some knobChanged code that would do the job:
defgroupKnobChanged():
ifnuke.thisKnob().name()=='inputChange':
n=nuke.thisNode()
maxIndex=n.maximumInputs()-1
ifn.input(maxIndex)isnotNone:
# Last input is connected to something. Add a new one.
withn:
nuke.nodes.Input()
else:
# Find disconnected inputs at the end to remove
lastIndex=n.inputs()
iflastIndex<maxIndex:
forinputNode innuke.allNodes('Input',group=n):
ifinputNode['number'].value()>lastIndex:
nuke.delete(inputNode)
-Nathan
On 7/28/2016 2:12 AM, Jake Richards wrote:
> I'm pretty sure I know the answer but thought I would ask anyways. Is
> there a way to create a group/gizmo that has an arbitrary number of
> inputs similar to the Switch node?
>
> Or, do I need to write code to maintain and track inputs inside of a
> group?
> Thanks!
> Jake
>
> --
> --
> --------------------------------------------
> [email protected] 203-992-6319
> LTD Blue Sky Studios
> --------------------------------------------
>
>
> _______________________________________________
> 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