Hi,
I have run into problems getting nuke.Node.hasError() to work on nodes inside a
group. I have a solution, but it doesn’t seem very elegant and I’m wondering if
there’s a better way…
First, a general description of what I’m doing:
1) Get a list of all the source nodes in a script — Read, ReadGeo, etc. —
including nodes in any Groups…
2) Check the list of nodes for errors using the .hasError() method.
If I run my code in the Script Editor, all works as expected. I get the list of
nodes and can check them all, including those in groups. However, if I run the
code via a menu, the nodes inside the groups are not checked for errors.
To workaround this problem, I am doing this:
nodes_with_errors = []
for node in sourceNodes:
# Check to see if node is actually in a group and run .hasError()
method in that context...
if '.' in node.fullName():
node_group =
nuke.toNode('.'.join(node.fullName().split('.')[:-1]))
with node_group:
if node.hasError() == True:
nodes_with_errors.append(node)
# Node not in a group, so just check it for errors...
else:
if node.hasError() == True:
nodes_with_errors.append(node)
return nodes_with_errors
…Seems kinda ugly. When running code via a menu, is there a better way to take
a list of nodes that are both inside and outside of group nodes and operate on
them all in the same context…?
Thanks for any insights,
Rich
Rich Bobo
Senior VFX Compositor
Armstrong White
Email: [email protected] <mailto:[email protected]>
http://armstrong-white.com/ <http://armstrong-white.com/>
Email: [email protected] <mailto:[email protected]>
Mobile: (248) 840-2665
Web: http://richbobo.com/ <http://richbobo.com/>
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python