You need bit change in your code

   key.la = inWeight[i]
   key.ra = outWeight[i]
   rad_la = math.degrees(key.la)
   rad_ra = math.degrees(key.ra)
   key.lslope = math.tan(rad_la)
   key.rslope = math.tan(rad_ra)

Hope this helps .

On Thu, Oct 27, 2011 at 2:21 AM, iaiotom <[email protected]
> wrote:

> **
> Hi,
> I'm writing a python script that export the anim curves from a camera in
> maya and import it in nuke and I have a lot of problems when I try to set
> the tangents of the keys of the animcurves in nuke.
> This is a snipset of my code:
>
> *Code:*
> trKnob = nukeCam.knob("translate")
> trKnob.setAnimated(idx)
> curve = trKnob.animation(idx)
>
> keys = objDict[traslAttr[idx]]["keys"]
> values = objDict[traslAttr[idx]]["values"]
> inAngle = objDict[traslAttr[idx]]["inAngle"]
> outAngle = objDict[traslAttr[idx]]["outAngle"]
>
> nukeKeys = []
> for i in range(0,len(keys)):
>    key = nuke.AnimationKey(keys[i],values[i])
>    key.la = inWeight[i]
>    key.ra = outWeight[i]
>    key.lslope = inAngle[i]
>    key.rslope = outAngle[i]
>    nukeKeys.append(key)
> curve.addKey(nukeKeys)
>
>
> The problem it's that all the tangents have a 0 slope and can't find what
> is wrong in my code.
>
> Thank you
> Alan
>
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>


-- 
--:: Kurian ::--
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to