x


how to change the AnimationCurve interpolation (Quad VS. Euler) using script???

title says all :)

more ▼

asked Sep 02 '10 at 02:27 AM

vyruz gravatar image

vyruz
28 1 1 6

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

In editor scripts you can save euler angle curves with these names:

Properties saved as localEulerAngles (.x, .y, .z) use Quaternion interpolation.
Properties saved as localEulerAnglesBaked (.x, .y, .z) use Euler interpolation.

These properties need to be saved using AnimationUtility.SetEditorCurve

In either case, Quaternion curves are generated from the Euler curves and the Quaternion curves are then stored alongside the Euler curves. When building a player, only the Quaternion curves are included while the Euler curves are stripped. The runtime engine always uses Quaternion curves for animation playback of rotations.

Alternative the Quaternion curves can be saved directly:

Properties saved as localRotation (.x, .y, .z, .w) are combined and stored directly.

This can be done at runtime using AnimationClip.SetCurve. (However, as usual, quaternion values should only be set directly by people who absolutely know what they're doing. The x, y, z, w values of Quaternions have nothing to do with normal rotation angles but rather are based on an extension of complex numbers.)

Note that the combine step when setting Quaternion curves directly may modify the curves. For example, if one of the curves has a key at a certain time, then all of the four curves will get a key at that time, for optimization reasons. The same combine step also applies for position and scale curves, when set using the SetCurve function.

more ▼

answered Sep 02 '10 at 04:21 PM

runevision gravatar image

runevision ♦♦
8.1k 29 46 112

thx alot for this detailed answer! anyway i switched to the Amazing iTween to add some awesomeness to the animation :) thx again btw i when i sign up in the unity forums the confirmation link is never sent :( i know this is not the place for that but i cant even contact the administrators! if u can give me a mail to contact or other confirmation methodz i would be thankful!

Sep 05 '10 at 01:24 AM vyruz
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5058
x3768
x56

asked: Sep 02 '10 at 02:27 AM

Seen: 1841 times

Last Updated: Sep 02 '10 at 02:27 AM