Jump to content

External Animations


DezOnlyOne
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...