There are a couple things you could do.

1) Call .forceValidate() on your AppendClip node, then grab its lastFrame knob value

2) Call .frameRange() on your AppendClip, then read .first() and .last() from that (I believe this forces a validate call transparently)

Hope this helps,

-Nathan


-----Original Message----- From: Nico Dufort
Sent: Tuesday, April 17, 2012 7:04 PM
To: Nuke Python discussion
Subject: [Nuke-python] AppendClip 'lastFrame' value

Hi everyone,

I am setting up a small script to build a simple movie out of shot
renders to see them in context, and I decided to go with the
AppendClip node.

My only problem is to pass the 'lastFrame' value of the AppendClip
down to my Write node's 'last' knob.  I noticed that the knob is
disabled by default, and it has a value of 0 until I connect a viewer
to it, which will cause the knob to update to the total number of
frames coming into it.

The code will run through a terminal session of Nuke, so the viewer
option is not valid for this case.

At this point, I could track the duration of each Read node and use
the total of all this in the Write's 'last' knob, but I wanted to know
if there were a way to update the AppendClip 'lastFrame' knob through
a script.

Any advice is welcome.

Best,
Nico
--
"Attention, attention. Here and now, boys," the mynah repeated. "Here
and now, boys."
_______________________________________________
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
_______________________________________________
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