Jump to content

Animation caching


photo

Recommended Posts

Posted

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

Posted

Hi,

 

Memory will grow only if you're loading unique animations every time (at least with unique names). In that case you can delete the node itself and create a new one with new animation.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Posted

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?

Posted

Sorry, but at this moment we don't have any other methods to clear the animation cache. Btw, how large is the memory footprint in your case (how much animations do you have and how large are they)?

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Posted

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.

  • 2 weeks later...
Posted

Yes, that will definitely help.  Many thanks.

Posted

Hi,

 

Do you have an idea of when this update will be released?

 

Many thanks,

 

Nik

Posted

It is planned to release the updated SDK in September. Unfortunately can't give more precise ETA.

×
×
  • Create New...