suicaokhoailang Posted April 10, 2016 Share Posted April 10, 2016 I have two seperate models in Blender: a guy and a sword. I don't need anything too complicated, just something like attaching the sword to the guy's hand. I tried creating a bone for the sword, made it the hand bone's child so it could animate alongside with the hand, then joined the two meshes together. Now I can export the model just fine, but when I try adding a simple animation, the exporter throws some weird errors. I think I did something wrong, what is the right way to do this task? Exporter version: 4.4.3, Blender version: 2.77 (sub 0) ========= Conversion from Blender to Babylon.js ========= Scene settings used: selected layers only: false flat shading entire scene: false inline textures: false texture directory: C:\Users\Khôi\Desktop\ Python World class constructor completed WARNING: The following armature not visible in scene thus ignored: Armature processing begun of mesh: sword animation processing begun processing begun of baked material: sword ========= An error was encountered ========= File "C:\Users\Khôi\AppData\Roaming\Blender Foundation\Blender\2.77\scripts\addons\io_export_babylon.py", line 329, in execute mesh = Mesh(object, scene, nextStartFace, forcedParent, nameID, self) File "C:\Users\Khôi\AppData\Roaming\Blender Foundation\Blender\2.77\scripts\addons\io_export_babylon.py", line 785, in __init__ bakedMat = BakedMaterial(exporter, object, recipe) File "C:\Users\Khôi\AppData\Roaming\Blender Foundation\Blender\2.77\scripts\addons\io_export_babylon.py", line 2090, in __init__ bpy.ops.object.select_all(action='DESELECT') File "C:\Program Files\Blender Foundation\Blender\2.77\scripts\modules\bpy\ops.py", line 189, in __call__ ret = op_call(self.idname_py(), None, kw) ERROR: Operator bpy.ops.object.select_all.poll() failed, context is incorrect ========= end of processing ========= elapsed time: 0 min, 0.006 secs Quote Link to comment Share on other sites More sharing options...
suicaokhoailang Posted April 10, 2016 Author Share Posted April 10, 2016 Nevermind I figured it out. WARNING: The following armature not visible in scene thus ignored: Armature I hide the Armature to view the animation more clearly, and it f*cked up the exporting process. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
eboo Posted April 10, 2016 Share Posted April 10, 2016 On 11/03/2016 at 11:31 PM, Dad72 said: Yes: sword.attachToBone(skeleton.bones[34], character); I made a small bone search function by name, which can help. var searchBoneByName = function(skeleton, searchBoneName) { var index = ; for (var i = ; i < skeleton.bones.length; i++) { if (searchBoneName = skeleton.bones.name) { index = i; break; } } return index; }; sword.attachToBone(skeleton.bones[searchBoneByName(skeleton, "main_gauche")], character); suicaokhoailang 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted April 10, 2016 Share Posted April 10, 2016 I add the function "getBoneIndexByName" in the engine (v2.4) to do so: var indexBone = skeleton.getBoneIndexByName("hand_left"); sword.attachToBone(skeleton.bones[indexBone], character); suicaokhoailang 1 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted April 10, 2016 Share Posted April 10, 2016 There is a fixed bug in skeleton animation for Blender. Since you are doing that, you should definitely move to version 4.4.4 suicaokhoailang 1 Quote Link to comment Share on other sites More sharing options...
suicaokhoailang Posted April 10, 2016 Author Share Posted April 10, 2016 Thank everyone :D, I swear this stuff's been driving me nuts for hours. 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.