DezOnlyOne Posted February 11, 2016 Share Posted February 11, 2016 I was talking to a 3d artist about the size of babylon files with animations. This has caused us some issue with loading but we worked around that by breaking up our files into smaller, more "digestable" pieces. We were wondering if anyone had thought about, or if there were any plans to create a way to apply animations to a mesh from an external file? I was thinking that separate animation files with just the animation data could be used to create and then play an animation. So I would load one mesh, and then just apply an animation to it rather than loading a mesh and all its associated animations with it. What are the implications of this? Maybe this is a terrible idea? Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 11, 2016 Share Posted February 11, 2016 Oh, this is a wonderful idea. But why can't you do it with the current architecture? Loading a json file is easy. a simple XHR request (even using jQuery) will get you the file from the server. One you have the file, you can use the newly introduced Parse functions in each Babylon class to deserialize the animations from the JSON file (if you need help with the actual format, let us know). Animations has Parse as well - https://github.com/BabylonJS/Babylon.js/blob/master/src/Animations/babylon.animation.ts#L575 So, use ImportMesh, and after importing the mesh, at the success callback, load the animation file and apply it to the mesh. Am I making sense? Quote Link to comment Share on other sites More sharing options...
Temechon Posted February 11, 2016 Share Posted February 11, 2016 So much possibilities for a custom exporter... Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 11, 2016 Share Posted February 11, 2016 And don't forget that .babylon files work REALLY well with gzip that most of the web server support nowadays 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.