Notifications
Clear all

[Closed] fbx graph editor interpolation bezier

Hello. I have question.
If I am exporting animation using fbx format all data are saved to every frame.
Could someone knows if it is possible to use any script to delete unnesesery frame keys.

What I mean. I am exporting for example animation. frame 0 position z =0, frame 100 position z =100.
If I am importing it I have got key in duration 0-100.
It is not good if I Would like edit animation.
I can’t delete keys by my hand because it doesn’t look good.

I think it is possible to delete this frame keys 1-99 and edit handle in 0 and 100.

We have got interpolation and we can know function. Lagrande method etc. Sp we should have got possibility to edit that in good ways.
But how to link that to bezier. I do not know how it works. Enyone Can help me?
Thanks for any help:)

11 Replies

reducekeys might be what you are after

Thanks for reply. Maybe it is some kind of solution.
Firstly I wrote function to save frame index in array( frame of local max and min value) it is working on array now.

example T#(2, 3, 5, 6, 2, 1, 7, 8) //simple value in array
gives me #(1, 4, 6, 8) // it gives value 2, 6,1,8 local max and min
why 1 and 8 is quite obvious (first and last one frame)

I would like to get acces to info in graph editor and reduce keys which is not in array.
Any Ide how I can do that?
I am quite new in maxscript and I do not know how to search it exactly.
I am trying

$Cube.rotation.controller.X_Rotation.controller

does it mean that you want to delete all controller keys excluding some predefined indexes?

if so, there is a way:


fn deleteControllerKeys c exclude:#() = if iscontroller c and c.keys.count > 0 do
(
	selectkeys c 
	for k in exclude where k <= c.keys.count do deselectkey c k 
	deleteKeys c #selection
)
/*
-- sample:
-- deleteControllerKeys $.pos.controller exclude:#(2,3,5)
*/


Thanks:)
Anyway my post doesn’t have any sense.
I thought that I must select by my hand any frame key I want delete.

I tried reduce keys one more time.
I don’t need do select anything. If I have got selected keys reduce work only on this keys.
If I don’t have selection reduce keys is “global” for curve.
So I need to select only one reduce keys:)
futhermore, if I have selected all imported object and I open graph editor, all curve are selected. I need only one click to reduce all curve in all object, magic:)
I don’t need any scripts. I am new in Max so it wasn’t so obvious to me:)
Anyway thanks for all help:)

I’ve been thinking of writing a reduce keys function that deletes more keys near a place of flatter curvature on the curve editor, and fewer keys on places of higher curvature.
has anyone written such a script, or must i do it myself?

I would say it is working very good.But if you would like I can send you my small code.

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

if the code is small could you post it here? personally i would like to see it.

no problem:) I didn’t finish it so it is not even function. furthermore, I am not as good programmer as you so code is long.

T=#(2,1, 3,0,5,7, 8)--array to check

eks=#()--extra array 
append eks 1 --first frame
if(T[1]>T[2]) do(
global to_down=true
to_down_actual=true)

if(T[1]<T[2]) do(
global to_down=false
to_down_actual=false)

N=2
while N < (T.count) do (
	if(T[N] >T[N+1]) do (
	print "go_down"
	to_down_actual=true)
	
	if(T[N] <T[N+1]) do(
	print "go_up"
	to_down_actual=false)
	
	format "T[i]: % T[i+1]: %
"  T[N]  T[N+1]
	
	if(to_down!=to_down_actual) do(
	format "change i=: % T[i]: %
"  N  T[N]
	append eks (N))
	
	to_down=to_down_actual
	N=N+1
)
append eks (T.count)--last frame

As I said I didn’t finished it. When 2 value are the same it would probably crash I didn’t checked it. So there should be extra “else”.
)

what does it has to do?

Page 1 / 2