hit2501 Posted February 17, 2015 Share Posted February 17, 2015 Hi. I imported a cube with a simple no bones animation (growth) from Blender to Babylon. Looks good with:BABYLON.SceneLoader.ImportMesh("", "babylon/", "cube.babylon", scene, function (newMeshes) { var C1 = newMeshes[0]; scene.beginAnimation(C1, 0, 100, false, 1.0); camera.target = C1; }but when I want the animation start when I click on the cube nothing happens, this is the code I use: BABYLON.SceneLoader.ImportMesh("", "babylon/", "cube.babylon", scene, function (newMeshes) { var C1 = newMeshes[0]; C1.actionManager = new BABYLON.ActionManager(scene); var action = new BABYLON.PlayAnimationAction(BABYLON.ActionManager.OnPickTrigger, C1, 0, 100, 0); C1.actionManager.registerAction(action); camera.target = C1; } Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 17, 2015 Share Posted February 17, 2015 can you check that C1.isPickable === true? Quote Link to comment Share on other sites More sharing options...
hit2501 Posted February 18, 2015 Author Share Posted February 18, 2015 Thanks Deltakosh, but still did not work, I modified my files to use my code in aBABYLON.SceneLoader.Load and it worked. I wonder why it does not work when importing meshes instead of loading. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted February 18, 2015 Share Posted February 18, 2015 FileLoader is organized primarily to load things in batches by type: materials, lights, meshes, animations, etc. ImportMesh also does materials of the mesh, children meshes, particle systems, and skeletons. Maybe it could be made to do animations as well. I touched this file once, but changed were undone due to behavior changes. Reconstituting scenes is very order dependent. I would not mess with this file again. If you have multiple .babylon files, Append instead of Load may get you through. It does the same thing as Load, but instead of passing an engine, you pass a scene you create yourself. You then get your animation, and can still append stuff from another .babylon. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 18, 2015 Share Posted February 18, 2015 Do you have a way to share this somewhere? Quote Link to comment Share on other sites More sharing options...
lemon0721 Posted May 18, 2019 Share Posted May 18, 2019 On 2/19/2015 at 3:08 AM, hit2501 said: Thanks Deltakosh, but still did not work, I modified my files to use my code in a BABYLON.SceneLoader.Load and it worked. I wonder why it does not work when importing meshes instead of loading. On 2/19/2015 at 3:08 AM, hit2501 said: Thanks Deltakosh, but still did not work, I modified my files to use my code in a BABYLON.SceneLoader.Load and it worked. I wonder why it does not work when importing meshes instead of loading. hi,you said use 'SceneLoader.Load',but how can you get the imported mesh? Quote Link to comment Share on other sites More sharing options...
MarianG Posted May 21, 2019 Share Posted May 21, 2019 Hi @lemon0721 If you didn't do it yet, please post your question here https://forum.babylonjs.com 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.