Does this still happen if you use a createNode call and set your gizmo input after it has been created?
-Nathan On Mar 13, 2012, at 7:25 AM, "Francois Lord" <li...@francoislord.com> wrote: > Hi. > > I'm having problems with an onKnobChanged event. I'm trying to add a node > under a Read node whenever the user sets the input colorspace to AlexaV3LogC. > The node I'm trying to add is a gizmo, and when the event is fired, the node > appears in the graph but it is unconnected and this error appears: > Traceback (most recent call last): > File "[...]/Nuke/Nuke6.3v5_win64/plugins\nuke\callbacks.py", line 127, in > knobChanged > _doCallbacks(knobChangeds) > File "[...]/Nuke/Nuke6.3v5_win64/plugins\nuke\callbacks.py", line 46, > in _doCallbacks > f[0](*f[1],**f[2]) > File "[...]\nukePlugins\src/init.py", line 199, in > onKnobChanged_Read_Colorspace > oObqAC = nuke.nodes.ObqAlexaCorrect(inputs=[nuke.thisNode()]) > RuntimeError: [...]\nukePlugins\src/ObqAlexaCorrect.gizmo: > Missing end_group command(s) > > It all works well when I add a normal node instead (when I replace > "ObqAlexaCorrect" by "Grade"), but it fails with any gizmo. Is this > something known? > Here is my event code. > > def onKnobChanged_Read_Colorspace(): > if nuke.thisKnob().name() == "colorspace" and nuke.thisKnob().value() > == "AlexaV3LogC": > lDependentNodes = > nuke.overrides.dependentNodes(nodes=[nuke.thisNode()], what=nuke.INPUTS) > > # Find ObqAlexaCorrect node in dependentNodes. > found = False > for node in lDependentNodes: > if node.Class() == "ObqAlexaCorrect": > found = True > break > if not found: > oObqAC = nuke.nodes.ObqAlexaCorrect(inputs=[nuke.thisNode()]) > > # Reconnect dependentNodes to ObqAlexaCorrect. > for node in lDependentNodes: > iNbInputs = node.inputs() > for i in range(0, iNbInputs): > if node.input(i) == nuke.thisNode(): > node.setInput(i, oObqAC) > > _______________________________________________ > Nuke-python mailing list > Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________ Nuke-python mailing list Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python