Jump to content

Animation caching


photo

Recommended Posts

Is there any way of getting an ObjectMeshSkinned to clear an animation that has been cached?

 

For example, if I have the following function that loads an animation into a mesh:

ObjectMeshSkinned play_animation(string animation_file_name) {
	ObjectMeshSkinned mesh = node_cast(engine.editor.getNode(123456789));
	mesh.setAnimation(animation_file_name);
	mesh.setTime(0.0f);
	mesh.play();
	return mesh;
}

every time I call this function with a different animation_file_name the animation data gets cached.  This is an issue if I'm loading hundreds of different animation files throughout the lifetime of my application.

 

Any suggestions on how I can prevent my memory footprint from gradually increasing over time?

 

Many thanks,

 

Nik Martin

Link to comment

As you point out it is indeed only a problem when multiple unique animations are loaded.  Is there no other way of getting round the issue other than deleting the node?

Link to comment

OK, that's fine - creating and deleting is a valid solution.

 

We've got around 1300 animations and at 2-3MB each the footprint gets pretty big!

 

Thanks for your advice.

Link to comment
  • 2 weeks later...
×
×
  • Create New...