Just throw a "root." into your file name:
def LoadChannelFileTCL(cameraName, channelFile):
s="in \"root."+cameraName+"\" {import_chan_file \""+channelFile+"\"}"
nuke.tcl(s)
this will of course hard code your script to camera's on root level, but that's
mostly what you want
On Sep 23, 2011, at 8:04 PM, AcidDrippa wrote:
> Hi
>
> I was trying to call a tcl command when I click on a button in a python
> panel. So I have a function like:
>
> def LoadChannelFileTCL(cameraName, channelFile):
> s="in \""+cameraName+"\" {import_chan_file \""+channelFile+"\"}"
> nuke.tcl(s)
>
> The function accepts the camera name and channel file name which are stored
> in variables.
>
> When I call this function directly from the script editor everything works
> fine and the channel file is imported. But when I call it from the button
> event handler:
>
> def knobChanged(self, knob):
> if knob is self.callfunc:
> LoadChannelFileTCL(cameraName, channelFile)
>
> I get the following error:
>
> RuntimeError: Nothing is named "Camera1"
>
> Please can anyone help me with this? Is it a Nuke-python bug?
>
> Thanks
> _______________________________________________
> 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