nik.martin Posted August 28, 2014 Share Posted August 28, 2014 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
silent Posted August 28, 2014 Share Posted August 28, 2014 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: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
nik.martin Posted August 28, 2014 Author Share Posted August 28, 2014 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
silent Posted August 28, 2014 Share Posted August 28, 2014 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: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
nik.martin Posted August 29, 2014 Author Share Posted August 29, 2014 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
silent Posted August 30, 2014 Share Posted August 30, 2014 In the new SDK update removeAnimation(int animation) function will be available. Hope this would help in handling memory issues. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
nik.martin Posted September 8, 2014 Author Share Posted September 8, 2014 Yes, that will definitely help. Many thanks. Link to comment
nik.martin Posted September 9, 2014 Author Share Posted September 9, 2014 Hi, Do you have an idea of when this update will be released? Many thanks, Nik Link to comment
binstream Posted September 9, 2014 Share Posted September 9, 2014 It is planned to release the updated SDK in September. Unfortunately can't give more precise ETA. Link to comment
Recommended Posts