I find it easier to edit the code in a dedicated editor. And the gizmo
will update live when you save your code while developing. Much faster
then copy/pasting the code everytime in the Nuke script editor to set
the value again and again...

On Thu, May 16, 2013, at 3:18, Howard Jones wrote:

Is that the best way then? I always write into the knobChanged direct
in the node. Though via

s=''' script stuff '''

...['knobChanged'].setValue(s)



What's the advantage of keeping it external?

Howard

On 16 May 2013, at 02:03, Frank Rueter <[1]fr...@beingfrank.info>
wrote:


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:
[2]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
[3]Nuke-python@support.thefoundry.co.uk, [4]http://forums.thefoundry.co.uk/
[5]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

_______________________________________________
Nuke-python mailing list
[6]Nuke-python@support.thefoundry.co.uk,
[7]http://forums.thefoundry.co.uk/
[8]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

_______________________________________________

Nuke-python mailing list

[9]Nuke-python@support.thefoundry.co.uk,
[10]http://forums.thefoundry.co.uk/

[11]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-pytho
n

References

1. mailto:fr...@beingfrank.info
2. http://pastebin.com/Ca9eMNUQ
3. mailto:Nuke-python@support.thefoundry.co.uk
4. http://forums.thefoundry.co.uk/
5. http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
6. mailto:Nuke-python@support.thefoundry.co.uk
7. http://forums.thefoundry.co.uk/
8. http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
9. mailto:Nuke-python@support.thefoundry.co.uk
  10. http://forums.thefoundry.co.uk/
  11. http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python


-- 
  Hugo Léveillé
  TD Compositing, Vision Globale
  hu...@fastmail.net

_______________________________________________
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