sCarr25 Posted October 21, 2018 Share Posted October 21, 2018 Hi guys. I'm new to BabylonJS and blender. I was trying out animations exported from Blender to Babylonjs. Everything is working correctly more or less. But when I apply a copyLocation constraint to a cube whose target is a bone, it is not taking effect in the babylon scene in the browser. Please help me to know what I'm missing. Are all the constraints supported in Blender supported in Babylonjs as well? From the docs, I saw only trackTo constraint... I've attached the .blend file. Plz have a look. Any help very much appreciated. Thanks! full-body.ani-boned-posed-rest.animated.constrained.blend Quote Link to comment Share on other sites More sharing options...
Guest Posted October 22, 2018 Share Posted October 22, 2018 Pinging @kcoley and moving this thread to the right subforum Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted October 22, 2018 Share Posted October 22, 2018 BJS does not have constraints. The trackTo has a couple applications with exported cameras, but it is converted not supported as a constraint. Quote Link to comment Share on other sites More sharing options...
sCarr25 Posted October 23, 2018 Author Share Posted October 23, 2018 Hi JCPalmer. Thanks for the quick response. 15 hours ago, JCPalmer said: BJS does not have constraints. The trackTo has a couple applications with exported cameras, but it is converted not supported as a constraint. If constraints are not supported in BJS, how should I implement something like a character holding a sword or gun? I was reading about joints in BJS. Will that be appropriate for weapon system? 16 hours ago, Deltakosh said: Pinging @kcoley and moving this thread to the right subforum Thank you for the correction. And thank you for the great job on the website... Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted October 23, 2018 Share Posted October 23, 2018 Note that I'm not comfortable with animations, so the solution I suggest here could be probably not the perfect workflow... Before exporting, you can use Bake Action (do not save your file after), so basically, with famous Blender keyboard combo: use your bones as you want, constraints, drivers, whatever you want to test and export your scene, so: select your object(s) Ctrl + S (save) Space > "Bake Action" > (F6 to check bake settings if needed) > Enter Space > "Export .babylon/.gltf" > Enter Ctrl + Shift + O > Enter (re-open your file, to avoid saving with all your keys baked...) webdva 1 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted October 23, 2018 Share Posted October 23, 2018 There are multiple ways, I think. The way to do it on the JS side is. A blender way would be to position the sword where it is to be held. Make sure the origin matches the character mesh. Parent sword to armature, or add modifier. Weight paint entire sword to the bone desired. sCarr25 and webdva 2 Quote Link to comment Share on other sites More sharing options...
sCarr25 Posted October 24, 2018 Author Share Posted October 24, 2018 14 hours ago, JCPalmer said: There are multiple ways, I think. The way to do it on the JS side is. A blender way would be to position the sword where it is to be held. Make sure the origin matches the character mesh. Parent sword to armature, or add modifier. Weight paint entire sword to the bone desired. Ok. Will try this out. Hope you guys don't mind, I'll keep this question open for some time. I'll get back after trying out ASAP. Quote Link to comment Share on other sites More sharing options...
sCarr25 Posted October 24, 2018 Author Share Posted October 24, 2018 20 hours ago, V!nc3r said: Note that I'm not comfortable with animations, so the solution I suggest here could be probably not the perfect workflow... Before exporting, you can use Bake Action (do not save your file after), so basically, with famous Blender keyboard combo: use your bones as you want, constraints, drivers, whatever you want to test and export your scene, so: select your object(s) Ctrl + S (save) Space > "Bake Action" > (F6 to check bake settings if needed) > Enter Space > "Export .babylon/.gltf" > Enter Ctrl + Shift + O > Enter (re-open your file, to avoid saving with all your keys baked...) Hi V!nc3r. I'm following the same procedure for animating characters. But got stuck on combining decoupled meshes. Quote Link to comment Share on other sites More sharing options...
sCarr25 Posted October 26, 2018 Author Share Posted October 26, 2018 (edited) On 10/23/2018 at 7:58 PM, JCPalmer said: There are multiple ways, I think. The way to do it on the JS side is. A blender way would be to position the sword where it is to be held. Make sure the origin matches the character mesh. Parent sword to armature, or add modifier. Weight paint entire sword to the bone desired. Tried this out. Somewhat got it to working. I tried with a cube attached to a bone in the leg. While animating in Blender, the cube moves with the leg bone. But after exporting to Babylonjs the moves in place but doesn't have motion along my axis. Anyway, will take sometime to get there, I guess. Thank you for the help. Edit: Going though the link given for handling the decoupled meshes on the JS side. This should be perfect for me. Thanks Edited October 26, 2018 by sCarr25 Additional details. Quote Link to comment Share on other sites More sharing options...
sCarr25 Posted November 1, 2018 Author Share Posted November 1, 2018 Hi all. Not sure how to mark the answer given by JCPalmer as the solution. I thought it would be marked as solved if I gave the answer a trophy. On 10/22/2018 at 10:02 PM, Deltakosh said: Pinging @kcoley Please mark JCPalmer's answer as the solution. Thanks everyone! 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.