Well, if you already have keys, you don’t need to bake anything. You just need 
to set keys on the Tracker at each frame.

One possible approach (somewhat crude and completely untested):

fr = nuke.root().frameRange()
dest = tracker['tracks']
for i in range(1, 5):
    baseOffset = 31 * i + 1
    curves = cornerpin['to%d' % i].animations()
    for ci, curve in enumerate(curves):
        curveOffset = baseOffset + ci
        for f in fr:
            dest.setValueAt(curve.evaluate(f), f, curveOffset)

Note that this relies on the corner-pin being animated. If there’s a chance 
they may not be, you should check .isAnimated(index) on each corner and set a 
static value if not.

-Nathan



From: Greg Radcliffe 
Sent: Tuesday, March 05, 2013 7:27 AM
To: Nuke Python discussion 
Subject: Re: [Nuke-python] Python in new tracker node.

Ah, that explains why those methods aren't working.  In order to copy over a 
curve, I have to loop bake the keys then loop copy per frame the key's over to 
the new tracker?


That's seems excessive for a fairly simple task, is there any plans to make the 
new Tracker more programming friendly?



On Mon, Mar 4, 2013 at 1:30 PM, Nathan Rusch <nathan_ru...@hotmail.com> wrote:

  Because the 'tracks' knob isn’t exposed as an Array_Knob (or a subclass 
thereof), it doesn’t have .copyAnimation()/.copyAnimations() methods. And 
because there isn’t another Python interface to the new Tracker, you’ll need to 
loop through your CornerPin keys and manually set keys at the cell indices 
you’re interested in (x pos = index 2, y pos = index 3 for the first track).

  -Nathan



  From: Greg Radcliffe 
  Sent: Monday, March 04, 2013 9:03 AM
  To: nuke-python@support.thefoundry.co.uk 
  Subject: [Nuke-python] Python in new tracker node.

  Hello!  I was am trying to copy over cornerpin data into a new tracker node  
w/ 4 tracks that have the copied animations. I'm running into issues trying to 
python with the new Tracker node.  I finally figured out how to add a track 
with .execute() but now I need to copy over an animation curve into the newly 
created tracks.  

  Here's the code I am working on.  How do I get python to assign the added 
track to a variable? then How do I copy that animation over?  I couldn't fine 
any documentation about working with the new Tracker node. 

  cornerPin = nuke.selectedNode()
  c1 = cornerPin['to1']

  tracker = nuke.createNode('Tracker4') 
  tracker['add_track'].execute()

  t = tracker['tracks']
  c1.copyAnimations(t.animations(t['track_2']))

  Thanks.

  -- 
  Greg Radcliffe 
  Compositor


  www.phosphenefx.com

  www.gregradcliffe.com

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






-- 
Greg Radcliffe 
Compositor


www.phosphenefx.com

www.gregradcliffe.com


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