Looking for a max-script guru for PAID project

For a fairly large mobil 3D project we have need to export thousands of frames or character studio rigged animation to unity.

We need some scripting solution to create a workaround for the issue that fbx bakes character studio animation creating keys on every frame

One method we tried is to export to fbx then import back to max (now we keys on every frame)
then use this script http://www.scriptspot.com/3ds-max/scripts/reduce-transform-keys
to reduce number of keys - but this script is very slow as it redraws the screen to show progress bar
also it leaks memory so when tried on our volume of eys it eventually crashes.
Anyone better (automated) way to reduce keys on large number of frames/objects.
so essentially we need better version of such script + some aded features specific to our workflow.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

You can try the same script, but with one modification - the status panel will be hidden, so you will not see the progoressbar.
Also, increase the MaxScript HEAP memory in Customize - Preferences - Maxscript tab - Initial Heap alocation. Set the valuw to 150 MB or grater.

the script:

macroScript ReduceYourTransformKeys category:"Craig's Tools"
(
	rollout RLT_ReduceKeys "Reduce Transform Keys"
	(
		group "Reduce Your Transform Keys"	
		(
			label lab1 "For the currently selected objects..." align:#left
 
			spinner SP_Threshold "Threshold of Change" range: [0.0,10.0,0.1] align:#left fieldwidth:25 type:#float
			spinner SP_Duration "Time Step Samples - frames" range: [0.0,2.0,1.0] align:#left fieldwidth:25 type:#float
			spinner SP_Range_STRT "Start Frame" range:[-1000,1000,animationrange.start] type:#integer align:#left fieldwidth:25
			spinner SP_Range_End "End Frame" range:[-1000,1000,animationrange.end]  type:#integer align:#left fieldwidth:25
 
			radiobuttons RB_KeyAtZero "Keep a key at frame 0?" labels:#("No, thanks","Yes, please" ) default:1
			radiobuttons RB_KeyAtEnd "Keep a key at End Frame?" labels:#("No, thanks","Yes, please") default:1
 
		)
 
		button BTN_ReduceKeys "Reduce Your Keys"
 
		group "Credits"
		(
			label lab2 "Written by Craig P Miller" align:#left
			hyperlink H_link1 "Contact" address:"mailto:craig@whimsy.co.nz" align:#left
			hyperlink H_link2 "Home Page" address:"http://www.whimsy.co.nz" align:#left
			label lab3 "Thanks to all who contribute at" align:#left
			hyperlink H_link3 "Scriptspot" address:"http://www.scriptspot.com" align:#left
		)
 
		on BTN_ReduceKeys pressed do
		(
			statusPanel.visible = off
			disableSceneRedraw()
 
			CurrAnimRange = animationrange -- holds the current animation range value
			animationrange = interval SP_Range_STRT.value SP_Range_End.value -- sets the animationrange to user selected values
 
			newpoint = point size:0.001 -- Evades the need to have a special single selection case
			selectmore newpoint -- ditto
 
			for i in 1 to $.count do -- for-loop reduceKey start
			(
				reduceKeys $[i].controller SP_Threshold.value SP_Duration.value animationrange
			)--end for-loop reduceKey	
 
			if RB_KeyAtZero.state == 2 do
			(		
				for i in 1 to $.count do -- for-loop AddZeroKey start
				(
					addnewkey $[i].controller 0 -- just in case it runs away and deletes the key at frame 0
				)--end for-loop AddZeroKey
			)
 
			if RB_KeyAtEnd.state == 2 do
			(
				for i in 1 to $.count do -- for-loop AddEndFrameKey start
				(
					addnewkey $[i].controller SP_Range_End.value -- just to be tidy	
				)--end for-loop AddEndFrameKey
			)
 
 
			delete newpoint -- tidy up
 
			animationrange = CurrAnimRange --resets the animation range
 
			enableSceneRedraw()
			statusPanel.visible = on
		) -- end button
 
	) -- end rollout
 
	createDialog RLT_ReduceKeys width:200 height:350 --pos:[25, 25]
)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.