I've seen some inconsistencies with the defined constants/flags used
with animations() before.

This seems to be another example, I think. nuke.LINEAR is defined in
the nuke module as 3, whereas the "linear" mode seems to correspond to
the "2" flag.
So, try this instead:

nuke.selectedNode().knobs()['offset'].animations()[0].changeInterpolation(
nuke.selectedNode().knobs()['offset'].animations()[0].keys() , 2)

However, the docstring does say

 |      @param type: Interpolation type. One of nuke.HORIZONTAL,
nuke.BREAK, nuke.BEFORE_CONST, nuke.BEFORE_LINEAR, nuke.AFTER_CONST or
nuke.AFTER_LINEAR.

So I suppose we can't assume that nuke.LINEAR (or nuke.CONSTANT)
should do the right thing :S

Anyway, try with different indices/flags to match the mode you want,
and make sure you add a note to your code to know what's what :)

Cheers,
Ivan

On Tue, Jul 12, 2011 at 5:45 PM, Colin Jenken <[email protected]> wrote:
> I've been testing with this little python snipet and I can't seem to
> get it to work:
>
> nuke.selectedNode().knobs()['offset'].animations()[0].changeInterpolation(
> nuke.selectedNode().knobs()['offset'].animations()[0].keys() ,
> nuke.LINEAR)
>
> This will not change my keyframes to linear but if I do this:
>
> nuke.selectedNode().knobs()['offset'].animations()[0].changeInterpolation(
> nuke.selectedNode().knobs()['offset'].animations()[0].keys() ,
> nuke.CONSTANT)
>
> it will change them to constant.  If it works changing it to constant
> why not linear?
> Is there something I'm missing here?
>
> Cheers,
> Colin
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
_______________________________________________
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