alexoy Posted March 25, 2018 Share Posted March 25, 2018 Hi, I try for a long time to create animations in Blender. In my case I have multiple meshes in one scene which mush have different independent animations. Bad result I get - both meshes share the same location/rotation/scale of their animations. PG demo: https://playground.babylonjs.com/#1EZI56 You can see that both meshes move and rotate together, like it is one mesh. However in Blender I try to make them independent, and inside Blender they really move like independent meshes - green box only rotates and red torus only moves. But when imported in BJS - they start to share position and rotation. I attach my .blend file here. I tried applying standard animations, tried Dope Sheet -> Action Editor to create different actions, but the same result. Is it possible to create different independent animations for different meshes in one scene? If yes - could you guide me step by step? Thanks! demo.blend Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 26, 2018 Share Posted March 26, 2018 Hi Alexoy! Umm... I have no solutions, but I did some tests (I'm not experienced in Blender or its exporter-to-BJS). https://playground.babylonjs.com/#1EZI56#1 I started by gathering your BabylonJS import data and pasted it to http://jsonviewer.stack.hu/ That allows me to put the JSON data into a drill-able tree, where I can see/tour it better. After I did that, I could easily see that the Torus and the Cube EACH have 3 animations installed... one for position, one for rotation, and one for scale. View the JS console for the above PG. In lines 39-72, I display the .animations array for both items, and then I hack their .animation arrays to remove the unwanted animations. But, mesh.animations array is just a storage tank for animation objects. Just because I removed the unwanted 4 animations (2 from cube animation tank, and 2 from torus anim tank)... that doesn't mean they stop animating. So, it was a worthless attempt. Besides, we don't want to 'delete' the 2 extra animations on each mesh. We want them NOT INCLUDED when the export from Blender happens, right? Ok, that's all the info I have so far. Something in Blender, or something in the exporter... is not doing what you wish. Too many animations are being installed on each mesh. Let's hope others have solutions. @JCPalmer is one of the big dogs of the exporter system, so I'll invite him to comment, if he wishes. Another super-cool forum user and Blender fan is @V!nc3r. He/She is spearheading a "Better Blender Exporting docs" campaign/project: http://www.html5gamedevs.com/topic/36596-blender-exporter-doc-needs-feedback/ Let's hope for more/better comments/ideas. Stay tuned. GameMonetize and V!nc3r 2 Quote Link to comment Share on other sites More sharing options...
babbleon Posted March 26, 2018 Share Posted March 26, 2018 @alexoy : your problem will be solved if you rename the animations in Blender to; Cube-Action & Torus-Action... note the hyphen. JCPalmer, Wingnut, alexoy and 1 other 4 Quote Link to comment Share on other sites More sharing options...
alexoy Posted March 26, 2018 Author Share Posted March 26, 2018 @babbleon, amazing, it works! How did you know? have I missed it somewhere in docs? Is it Blender or BJS-exporter specific? If the second - just to clarify, is it correct, that BJS-exporter takes exactly for an action name, splits it by "-" (lets take we get actionNameArray), searches for a mesh with the name actionNameArray[0] and inserts this animation to the according mesh? Without mesh found animation will be common?! Quote Link to comment Share on other sites More sharing options...
babbleon Posted March 26, 2018 Share Posted March 26, 2018 I am just very, very talented! Nah, I had this problem before and really struggled with it myself. I probably found it here though I think it's mentioned elsewhere: I suspect this is Blender exporter specific, but I don't know this for a fact... so better to ask @JCPalmer. Pleased it helped you, it does need to be in the docs, but I think this has been noted for adding here. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 27, 2018 Share Posted March 27, 2018 This is where it is explained. 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.