fateriddle Posted October 11, 2018 Share Posted October 11, 2018 Here's the demo https://codesandbox.io/s/zl6vxmlw8m I load the gltf file, and then find in a github issue to stop the animation when loaded. But now I want to play the animation, say, when I click a button / at certain time. How do I do that? (couldn't find in documentation the part of how to work with a loaded modal. Don't know how to even get the modal instance) Quote Link to comment Share on other sites More sharing options...
Guest Posted October 11, 2018 Share Posted October 11, 2018 Hello! you should look into our examples: The animation blending demo should be the right one (it is loading a .babylon but code is the same for any file format): https://www.babylonjs-playground.com/#BCU1XR#0 Quote Link to comment Share on other sites More sharing options...
fateriddle Posted October 12, 2018 Author Share Posted October 12, 2018 9 hours ago, Deltakosh said: The animation blending demo should be the right one (it is loading a .babylon but code is the same for any file format): https://www.babylonjs-playground.com/#BCU1XR#0 Do you recommend .babylon over .gltf ? I noticed the callback function in SceneLoader.ImportMesh function (newMeshes, particleSystems, skeletons) {} While in SceneLoader.append function (scene) { } 1. I tried to use Sceneloader.ImportMesh in my codesandbox example, it showed a blank screen. But if I use SceneLoader.append, it is not gonna give me the newMeshes as arguments, so I can't use Scene.beginAnimation because I don't know the target of my animation. 2. Also I imaging the asset I load consists of several meshes, say if I what to do scale animation (of them all of course), what is the target of the animation? Quote Link to comment Share on other sites More sharing options...
Guest Posted October 12, 2018 Share Posted October 12, 2018 1. Both functions should work. But you are right importMesh is better in your case because you get the list of meshes. With Append, you can also uses scene.meshes 2. YOu can create a dummy TransformNode and make all your meshes child of this node Also, I recommend using the playground for easier experiments (and it is easier for us to help). babylon or gltf: Both are fine. glTF is not proprietary but has less features 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.