Notifications
Clear all

[Closed] Animation baking script?

I hit a little snag here at work and maybe someone could help. I need to bake and export an animation from 3ds max into the Gamebryo engine. What I have going on is this; I created a spline path and used a path deform to bind a cylinder to the path. I tried both the world space path deform and the path deform modifier and Gamebryo doesn’t recognize either of them. The problem I’m having is how to bake the animation down so I can export it into Gamebryo. It’s not running along any transform controls and it’s not a spine animation, so the scripts I’ve found for animation baking don’t work. How can I get the cylinder on the path deform to bake into a vertices animation?

zac.

8 Replies
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

I might be wrong but as I know the Gamebryo engine supports only Skin and Morph-targets types of vertex animation. So you have to “convert” your path deform animation to one of these types. What type is better to use? It depends on the length of the animation and the complexity of the spline. If the animation is short you can snapshot targets and use morpher. If the path (spline) is pretty simple you can use bone-chain with spline IK and Skin.

exactly what I was looking for.

Thanks a lot, I wasn’t sure what it would be called.

is this script name sensitive in some way? It’s saying there’s an undefined “controller”

Hi Zackleck
I did this little script quickly, i hope it does the work for you.

Select the object constrained to the path and execute this script :

(
 	TempPoint = point()
 	step = 10
 	for i=animationrange.start to i=animationrange.end by step do (
 		with animate on 
 			at time i
 				TempPoint.transform = $.Transform
 	)
 	$.Transform.Controller = TempPoint.Transform.Controller
 	delete TempPoint
 )

What it does :
1-Create a temporary Point helper
2-loop throug all the frames and Allign the temporary Point helper to the selected object.
3-apply the temporary point helper transform controller to the transform controller of the selected object.
4- delete the temporary helper objet.

if you want to put only 1 key every n frames, change the step value.

I hope that its what you were looking for;)

awesome, thanks for writing that up for me. Unfortunately I’m thinking vertex baking isn’t the answer. I set up a simple rig of spline circles with a path constrain to my path and skinned the tube to the circles. I got it to bake out using a bake script but Gamebryo doesn’t seem to recognize vertex baking, only morphs and transform properties.

So now this is off the topic of scripting, but does anyone have experience with the Gamebryo game engine that can help with this one?

Oops in didnt understand you problem the first time;)
You can also do the following :

I assume you want to make a snake animation along a spline. (i hope i am correct this time)

skin your cylinder with 1 point helper per edge.
Path constraint those helpers onto the spline.
Offset each helper’s Path Value by a small value.
Animate the PathValue of all helpers.

To help you should make some setup to ease the animation process.

for long animation this method would be much lighter than the bake vertex method with morphs.

That’s actually how I got the tube to animate, I skinned it to controllers that had look at constraints on them looking at the controller one up in the hierarchy. After about a half day of trial and error and retrial and retrial and forum hunting it finally came down to me learning from one of our tech guys that a skinned object could work in Gamebryo just fine and the baking process wasn’t necessary.

That being said, it still wont make it in the game because it needs to run on low end computers and there’s a concern that a skinned object is too much for it to call on (it’s a real-time music based game). So that was a good 4 hours flushed. At least I got paid for it.

Thanks all who tried to help but this dog let itself out of the house