Hello guys, I am quite new to 3D modelling but I have read carefuly lot of topics here but was unable to find any relevant answer. For this reason I have to create another one - hopefuly it will help another 3D noobs too.
I have started to use Blender as my source of 3D models - I had some success as I was able to rig my model, create animation and texture, export it as GLTF and import it into Babylon. But there are several “details” that are really annoying and I cannot get rid of them on my own.
My ultimate goal is to create “monsters for my game” so each file should ideally be 1 mesh with 1 texture + set of animations which would then be 1 draw call per monster clone at the end of the day with possibility to run animations on each “clone” separately.
What problem then ?
When I connect armatures with model in Blender, then always armatures are “parent” of that mesh. I cannot force Blender to do it otherwise - I want armature to be “child” of the model that is logical right ?
When I import GLTF into Babylon, then I get object structure which I cannot work with (namely clone it and manipulate it effectively). It looks like this (I get two meshes)
Note: I using this for import: BABYLON.SceneLoader.LoadAssetContainer(“models/”, “orc.gltf”, scene, function(object)
And I get following object structure:
Mesh "Root" |_____ Armature (not sure about Babylon class) |______ Bone (probably Bone class from Babylon) |______ Children bones which is probably okay Mesh "Orc Fighter" (this is the mesh I actually want - but it does not work on its own)
This “Orc” mesh does not have any children but it has parent which is something without name so I dont know what it actually is.
When I import objects in this aforementioned structure, that it appears on screen and I can run animation on it. But I cannot move my mesh - to move “Orc Mesh” I have to set position of that “Root” mesh but that “Root” mesh apparently isnt´t parent to the Orc Mesh - but on the other hand when I want to set rotation, then I have to do so on that “Orc Mesh” directly. When I clone “Orc Mesh” then I get new mesh (with corrupted rotation and scale) that I cannot manipulate at all. It seems like that I have to clone and work with the whole bunch of objects and perform some operations on one and another on the others. This is really overwhelming and frustrating
Animations are somehow “outside” of the mesh in “Animation Groups” - I can run them via “object.animationGroups[i].play(true);” but it only apply to the one imported mesh. I cannot run these animations for clone of that mesh.
Long story short - I want to just import 1 mesh that will be root and has everything else as its “children” that will be cloneable and animatable independently. Is it possible from that GLTF file ? I believe that it will help to make armature as a child of mesh (see my first point) but I could not figure it out.
I have tried to use babylon exporter for blender, but it didnt work - it showed some long errors (some long stack trace that didnt tell me anything). I am now to Blender and thus I dont know what is wrong - my scene is really simple and exporter could not export it so I gave up on this (for this moment)
My blender file
orc.zip (217.6 KB) .
My exported GLTF file
orc-gltf.zip (137.4 KB)
Thanx in advance for any thought and insights and tips. Sad part is that I was able to rig, animate and texture my model relatively easily as well as importing it into my application, but further manipulation and real usage is what I am not able to do (which I didnt expect to be the difficult part).