You probably want to run the code every time the gizmo's panel is opened, so look into the knobChanged knob. I'd write the python code in an external file and import then execute it inside the knobChanged knob.

This might get you started:
http://pastebin.com/Ca9eMNUQ


On 11/05/13 06:36, thinkinmonkey wrote:
Hello everyone,
I wrote a very simple gizmo in Nuke and I'd love to refine it with your help. The gizmo simply reads an xml file where I stored some data, the user can select a scene/shot from a pulldown choice and he will have the images sequence of that scene/shot.
Everything works, but I'd want to know:

a) When the user create the gizmo from menu, he's forced to click a button on gizmo in order to load the xml file, otherwise the gizmo is not able to load the image sequence. I want the gizmo load the xml file automatically, I tried the callbacks, the "on Create" function, but with no success. Could you tell me how to do that?

b) Just to be sure, I put all python code in a python script button knob: is that right to program? I mean, if I want to write python functions or callbacks that control the entire gizmo, the only solution I have is to write then in a button, but they are executed only when user clicks on it, isn't? There's another way to create a new node/plugin?

Thanks in advance.


_______________________________________________
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

Reply via email to