I was using the latter(nuke.createNode()) ... that is why I was surprised I was getting a value of zero back.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Ivan Busquets Sent: Wednesday, August 03, 2011 1:29 PM To: Nuke Python discussion Subject: Re: [Nuke-python] Question about screenWidth() and screenHeight() How are you creating your nodes? If you're using nuke.nodes.NodeClass(), then those properties won't be available by the time you call screenWidth on it. If you use nuke.createNode(), then the node will be fully constructed before the next command is called. See the difference between: n = nuke.nodes.NoOp() print n.screenWidth() and: n = nuke.createNode('NoOp') print n.screenWidth() On Wed, Aug 3, 2011 at 10:05 AM, Mike Donovan <[email protected]> wrote: > for some reason I am getting a return of 0 in my function. Here is a code > snippet. > > <SNIP> > def align_prevcopy_node(new_copy_node, prev_copy_node): > > width = prev_copy_node.screenWidth() > height = prev_copy_node.screenHeight() > print ("prev copy node height : " + str(height) + " prev copy node width : > " + str(width)) > > <SNIP> > > returns >> >>> prev copy node height : 0 prev copy node width : 0 > > How can a node have a value of zero for either of these properties ?? > > Thanks > > M > > > > ________________________________________________________________________ > This e-mail has been scanned for all viruses by Star. The > service is powered by MessageLabs. For more information on a proactive > anti-virus service working around the clock, around the globe, visit: > http://www.star.net.uk > ________________________________________________________________________ > _______________________________________________ > 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 ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ _______________________________________________ Nuke-python mailing list [email protected], http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
