I see. So if I understand your situation correctly, you're calling nodePaste to add a single group node from a file, then wanting to nodePaste something else inside that.

If that's correct, here's a callback-free alternative:

x = nuke.nodePaste('path/to/nuke/script.nk')
x.begin()
y = nuke.nodePaste('path/to/other/nuke/script.nk')
y.setName("my_new_node_name")

Stick that in a function that you call via your menu item.

-Nathan

-----Original Message----- From: Blamsammich
Sent: Wednesday, February 23, 2011 10:43 PM
To: Nuke Python discussion
Cc: Nuke Python discussion
Subject: Re: [Nuke-python] onCreate when using nuke.nodePaste()

nuke.nodePaste() is the initial call from the menu, but here I am just calling it
from the script editor for
testing



On Feb 23, 2011, at 10:36 PM, Nathan Rusch <[email protected]> wrote:

I'm using it in onCreate as well.

One thing I should probably ask is, how are you creating the top-level group? Remember that callbacks can't fire callbacks...

-Nathan

-----Original Message----- From: Blamsammich
Sent: Wednesday, February 23, 2011 10:31 PM
To: Nuke Python discussion
Cc: Nuke Python discussion
Subject: Re: [Nuke-python] onCreate when using nuke.nodePaste()

I thought about building it all out, but wanted to avoid since it is a 5 line script.

That code works fine in the ui, but when I stuff into the onCreate it fails. I tried using the with_statement too.
says the bode is not subscriptable.  and looking at the script
editor output, all of it has been called before the call to create the first group.

I am on 6.2v1 too



On Feb 23, 2011, at 10:23 PM, Nathan Rusch <[email protected]> wrote:

Why not just build the group(s) via Python from scratch every time you call whatever script you're already calling?

FWIW, I just tried similar code to what you're doing here, and it works fine, including the nodePaste call (this is on 6.2v1).

-Nathan


-----Original Message----- From: Blamsammich
Sent: Wednesday, February 23, 2011 8:55 PM
To: Nuke Python discussion
Subject: [Nuke-python] onCreate when using nuke.nodePaste()

I have a group node that I am loading into nuke via the nuke.nodePaste() command. I want that first group node to use the onCreate function to load another group node inside the first group node also using the nuke.nodePaste() command

The code I have works fine for when the node has been created, but fails when executed for real. I think the onCreate might be calling the other code too early. So what would be another option for loading that second group into the first on creation?

This is a generic version of all I am doing.

import os
n = nuke.thisNode()
n.begin()
nuke.nodePaste('path/to/second/groupNode.nk')
t = nuke.selectedNode()
t['name'].setValue('what I want it called to link up with master group')
n.end()


Any help on what I am missing would be greatly appreciated.

Thanks!

Justin_______________________________________________
Nuke-python mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________
Nuke-python mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________
Nuke-python mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________
Nuke-python mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________
Nuke-python mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________
Nuke-python mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to