For animated knobs you can just do
for i in nuke.FrameRange(...):
nuke.selectedNode()['translate'].getValueAt(i, 0)
The change-frame methods (nuke.frame(1234) and
nuke.root().setFrame(1234)) don't work very reliably - they are fine for
changing frame in the UI, but not for scripting.. If you needed to do
things things way, you need to make a dummy executable node like a
CurveTool, then do nuke.execute(mycurvetool, 1234, 1234) to change the
frame inside your loop
- Ben
On 12/11/14 09:29, José Alejandro Enríquez wrote:
> Hi, I'm new with python for nuke and relative new in python, I want to
> get information every frame from a tracking node. The translate knob.
>
> This is my code:
>
> trans = [ ]
>
>
> range = nuke.FrameRange(nuke.root().firstFrame(),
> nuke.root().lastFrame(), 1)
>
>
> for i in range:
>
> global trans
>
> nuke.Root().setFrame(i)
>
> print i
>
> curframe = nuke.frame()
>
>
> b = nuke.selectedNode()["translate"].value()
>
> trans.append(b)
>
>
>
> print trans
>
>
> But I keep getting the information of the first frame every iteration
> and not the information of the current frame.
>
>
> Any idea? thanks!
>
>
>
>
>
>
>
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
--
ben dickson
2D TD | [email protected]
rising sun pictures | www.rsp.com.au
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python