This is a known bug (logged as bug 15737). If you call .xpos() or .ypos() on 
your node before checking its screenWidth or screenHeight, or (I believe) 
simply use nuke.createNode to create your node (as opposed to 
nuke.nodes.NodeClass), those values will be updated properly.

Feel free to give the ticket a bump as well.

-Nathan



From: dcompz 
Sent: Tuesday, November 06, 2012 10:55 AM
To: [email protected] 
Subject: [Nuke-python] node.screenHeight() not updating

I have a function which adds a label to certain nodes in my script. This 
changes their height and causes them to shift out of position, so I would like 
to automatically reposition them to align with the other nodes.

The problem I'm having is that querying node.screenHeight() before adding the 
label and then again after in the same function, or even calling to a different 
function, returns the same result. 

I'm guessing it may be a case where the values update during 'idle' time so 
they won't update while the function is still processing. This seems to be 
confirmed by the fact that when I manually run the part of the code querying 
the new height after the function has run, it returns the correct updated 
value. 

I have a few hacky ideas to work around it, potentially using a callback to 
call a function after the labels have been added or something. 

I've run into this before and am not sure if it is a bug or working as 
intended. Wondering if anyone has any thoughts on this.


--------------------------------------------------------------------------------
_______________________________________________
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

Reply via email to