hen Posted October 5, 2016 Share Posted October 5, 2016 Hi, i am actually thinking about how to load animations at runtime. Reason is that our project includes almost 3000 unique animation takes (7 years of hard work ). That includes overrides of walk/run/idle/jump animations, actions (dance, etc) and gestures such as sit or laydown wich we need to bound to mesh objects. The overall file size is of course far too large to preload and must be somehow loaded and triggered at runtime on demand. I couldnt find anything about this in the docs. Maybe someone could give me a hint? Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted October 5, 2016 Share Posted October 5, 2016 @hen You can make a global assets object; e.g; var assets = {}; assets.characters = []; assets.animations = []; assets.buildings = []; assets.etc.. pre-load what you need at start up and then you can load the on-the-go stuff as needed via the sceneloader.importMesh or obj loader extension (whatever file extension you use). the following example uses a id of 50, folder structure "assets/animations/", (animation id).babylon file structure and assumes that the animation is applied to a skeleton found in the .babylon file. so basic use; var id = 50; if(!assets.animations[id]){ BABYLON.SceneLoader.ImportMesh("", "assets/animations/", id+".babylon", scene, function (newMeshes, particles, skeletons) { assets.animations[id] = skeletons; //loaded }); } else //already loaded Disclaimer: i have never tried only loading a single skeleton or animation from a babylon file. Side-Note: this may cause temporary performance issues for the client while the animation is loading. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
hen Posted October 5, 2016 Author Share Posted October 5, 2016 @aWeirdo Thanks for the reply! The problem is actually how to apply those animations to a previously loaded character. Do i need to replace the whole skeleton? Or is it somehow possible to push them in to some kind of list of takes? Quote Link to comment Share on other sites More sharing options...
gryff Posted October 5, 2016 Share Posted October 5, 2016 Hi @hen : You might want to take a look at this thread Unfortunately the playgrounds don't work anymore as I think @ozRocker has deleted the character and animations from his server. But if you look at the code you will see character mesh/rig and the animations are derived from different .babylon files. I think Blender was used to create the files - not sure how you would di it in 3DMax. cheers, gryff Quote Link to comment Share on other sites More sharing options...
hen Posted October 5, 2016 Author Share Posted October 5, 2016 @gryff Thanks! I can see how that works. Just this will not work with our project where i need to switch fast and smoothly from one take to the other and interpolate between the takes by weight. With this project i am really struggling with everything that is related to bones Having bones and animations linked together in Babylon is really a big problem when it comes to character customizing. Like i am not able to scale bones for shape editing and there is no property for animation takes. Babylon is great and its opensource so i really dont want to complain. But i think i must roll back now to the previous lib i used to get things back to work. Quote Link to comment Share on other sites More sharing options...
ozRocker Posted October 8, 2016 Share Posted October 8, 2016 On 06/10/2016 at 8:04 AM, hen said: @gryff Thanks! I can see how that works. Just this will not work with our project where i need to switch fast and smoothly from one take to the other and interpolate between the takes by weight. With this project i am really struggling with everything that is related to bones Having bones and animations linked together in Babylon is really a big problem when it comes to character customizing. Like i am not able to scale bones for shape editing and there is no property for animation takes. Babylon is great and its opensource so i really dont want to complain. But i think i must roll back now to the previous lib i used to get things back to work. The Babylon.js community can solve your problems related to bones. Right now they would be working on the 1,000 other improvements and extra features people have been asking for. The whole framework is a group effort and a constant work-in-progress so if you need something specific to your needs, be prepared to put some time into it to help them get it done. You don't have to be a top developer, just contribute by analysing the problems and experimenting with the solutions that people provide. GameMonetize and MarianG 2 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 10, 2016 Share Posted October 10, 2016 Couldn't have say that in a better way Quote Link to comment Share on other sites More sharing options...
hen Posted October 11, 2016 Author Share Posted October 11, 2016 On 8.10.2016 at 8:54 AM, ozRocker said: The Babylon.js community can solve your problems related to bones. Right now they would be working on the 1,000 other improvements and extra features people have been asking for. The whole framework is a group effort and a constant work-in-progress so if you need something specific to your needs, be prepared to put some time into it to help them get it done. You don't have to be a top developer, just contribute by analysing the problems and experimenting with the solutions that people provide. Dont get me wrong, i am not asking for someone to solve my problem Question was more about if the problem can be solved with how the skeleton works right now. At the end it wasnt a big deal to find a solution for the problem i originally asked for in this thread, after deltakosh pointed me to some functionality that i did not find in the docs. You know, the babylon skeleton is in fact kind of different to skeletons in most other engines. It is extemly tricky for us to write up custom conversion tools, or to solve the still open bone scaling/morph problem. However, we can close this thread, since the original topic is solved. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.