Good call but it didn't work for me.
I guess what we need is a method to identify user knobs from default
knobs. That way you could easily loop through all user knobs in python
and copy them to other nodes (or build a panel to let the use chose
which knobs to copy etc).
As a workaround you could try to create a dummy node of the same class
of the source node that holds the user knobs you want to copy. Make sure
to use nuke.nodes rather then nuke.createNode() for this so any user
knobs that are added through callbacks are not created either.
Then compare the knobs of both nodes to find the user ones and take it
from there.
On 13/08/12 6:14 AM, Nathan Rusch wrote:
Away from my machine right now, but I think you should be able to do
what you're after to any node by preceding your current TCL calls with
a 'push <nodename>' (you should be able to run it all through a single
call to nuke.tcl). Also, <nodename> may need to be Nuke's internal
name for the target node.
-Nathan
On Aug 12, 2012, at 3:18 AM, "andi"
<[email protected]
<mailto:[email protected]>> wrote:
Hi Frank,
yes, that's unusual Smile ... unusual way for unusual case. Here's
the reason ... hope this makes sense :
let say i grab a gizmo from somewhere and there are knobs i'd like to
copy/use for my own node. So rather than do coding from scratch,
it'll be easier for me just to copy the gizmo to clipboard , open in
text edit and copy that tcl part of the wanted knobs. So now i got
the tcl code, that's why i want to use tcl. Actually i can hack it by
editing my nodes using text editor, insert the tcl there, then paste
the text/script back to nuke. But if i can do python nuke.tcl() then
this will be cool, for example i can apply to multiple nodes.
So the goal is to 'copy/paste' custom knobs from one node to other
node where i don't have its python code. All i have is just the tcl.
Btw thanx a lot for the code, i didn't know i can do that using
group/gizmo. Cool Smile
Thanx
*Frank Rueter wrote:*
That's an unusual way of doing this, may I ask why you're using tcl
syntax oi this case?
If the selected node is a group or a gizmo you can do this:
with nuke.selectedNode():
nuke.tcl(mytclscript)
Not sure if there is a simple way for other nodes.
[/quote]
_______________________________________________
Nuke-python mailing list
[email protected]
<mailto:[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
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python