Hi Olivier,

Nuke doesn't like that because you're wrapping something inside a python
function that's not python at all, so it won't understand its syntax, or
what to do with it.

You have a couple of options for what you want to do, IMO. You could save
your script somewhere and then just call
nuke.nodePaste('/path/to/your/script.nk'), or you could build all the nodes
dynamically. In that case, you may want to use nuke.createNode() instead of
nuke.nodes.Class() if you're giving each node a name and you want unique
naming to be enforced, so Nuke will add a number to it.

Alternatively, you could just wrap all of it into a gizmo, but if you want
to keep it open, any of the 2 approaches above should work.

Hope that helps.

Cheers,
Ivan

On Thu, Jun 30, 2011 at 8:21 AM, Olivier Jezequel <
[email protected]> wrote:

> Hiya,
> I know this will look dodgy and strange but i have my reasons :
> I have 3 nodes, two with a custom name 1 with an expression linked to them.
> As it is to be released for people that are not compositors i want a script
> that create that for them, but i don't want spending time to figure out how
> query if the names already exist an update the whole expression/names in
> fonction.
> A simple copy paste is working nicely so i tried to put that into a script
> that will force nuke to paste, but so far i failed miserably.
>
> here is what i came about :
> ------------------------------**------------------------------
> def autoReformat():
>
>  set cut_paste_input [stack 0]
>  version 6.2 v4
>  push $cut_paste_input
>  NoOp {
>   name In_ToBeScaled
>   selected true
>   xpos -348
>   ypos -256
>  }
>  Reformat {
>   type scale
>   scale {{howBigAmI.width/In_**ToBeScaled.width}}
>   name autoReformat
>   selected true
>   xpos -348
>   ypos -158
>  }
>  push 0
>  NoOp {
>   name howBigAmI
>   selected true
>   xpos -636
>   ypos -154
>  }
>
> node_Copy("autoReformat()")
> node_Paste("autoReformat()")
> ------------------------------**----------------------------
>
> but nuke doesn't like that :)
> Any idea ?
> cheers
> O
> ______________________________**_________________
> Nuke-python mailing list
> Nuke-python@support.**thefoundry.co.uk<[email protected]>,
> http://forums.thefoundry.co.**uk/ <http://forums.thefoundry.co.uk/>
> http://support.thefoundry.co.**uk/cgi-bin/mailman/listinfo/**nuke-python<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

Reply via email to