AS-file change interpolation? [solved]

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

AS-file change interpolation? [solved]

Post by rylleman »

I need to change all Point motion keys in an anme-file from smooth to linear.
I've poked around the file but couldn't find out what to do.

So, what should I look for and what should I change to change the interpolation? (There's a lot of layers so doing this manually is not an option.)

I need to change the smooth keys only, I've got cycle keys in the file as well and don't want to change those.
Last edited by rylleman on Fri Jun 05, 2009 3:32 pm, edited 1 time in total.
User avatar
slowtiger
Posts: 6256
Joined: Thu Feb 16, 2006 6:53 pm
Location: Berlin, Germany
Contact:

Post by slowtiger »

Tricky one. Just created a file and then looked inside (put in some more blanks for readability):

Code: Select all

	### transforms
	translation
	[
		keys 9
			 0 1 0.1 0.5   0 0 0
			 1 1 0.1 0.5   0 0 0
			 6 0  -1  -1   0 0 0
			12 3  -1  -1   0 0 0
			18 1 0.1 0.5   0 0 0
			24 1 0.1 0.5   0.496348 -0.161689 0
			30 0  -1  -1   0.639236 -0.669318 0
			36 3  -1  -1   0.150408 -0.70692  0
			42 1 0.1 0.5  -0.454986 -0.251934 0
			48 4 0.1 0.5  -0.454986 -0.251934 0
			54 1 0.1 0.5  -0.454986 -0.251934 0
			60 4 0.5 0.25 -0.454986 -0.251934 0
			66 1 0.1 0.5  -0.454986 -0.251934 0
Comparing this with the open file in AS, I find that the second value in a row seems to be the interpolation method.
1 = smooth
0 = linear
3 = step
4 = noisy

So a keyframe parses like this:
1. = frame number
2. = interpolation method
3. = value for interpolation
4. = value for interpolation
5. = x position
6. = y
7. = z

I'm afraid you'd need to use RegExps to automatically find and replace all.
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Post by rylleman »

Thank you!

I figured it was the second number that needed a change. Didn't realise it was 3 and 4 as well.

Now I did the change in seconds using a search and replace in gedit.
Post Reply