Hi,

Simple question. Is there a way to query the width and height of a node at
different times?

Here's the context.
I'm working with data sets that include image sequences that vary
resolution from frame to frame. I'd like to find the max width and height
for a given image in a given frame range. I wrote the following code to
test things out.

nukeNode = nuke.selectedNode()


firstFrame = int(nuke.Root()['first_frame'].getValue())

lastFrame = int(nuke.Root()['last_frame'].getValue())

print( firstFrame, lastFrame )


maxWidth = 0

maxHeight = 0

for frame in range(firstFrame, lastFrame):

    nuke.frame( frame )

    width = nukeNode.width()

    height = nukeNode.height()

    print( frame, width, height )

    if width > maxWidth:

        maxWidth = width

    if height > maxHeight:

        maxHeight = height


print( maxWidth, maxHeight )


The width and height values don't update to reflect the value for the
current frame. This seems to parallel the functionality of the Knob
getValue vs. getValueAt functions. Since width and height aren't knobs,
those functions don't help though.


Is there a way to query the width and height of a node at different times,
like the Knob getValueAt method?


HP
_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to