Hello everyone!
I’m trying to use this example to recreate something. I just need to know if this example used any skeleton information from Blender, or if it was all done with Babylon.js code. Based on the Blender import code found at the bottom, it seems that Blender information is involved, but if you delete it, the example still works exactly the same.
I’m just trying to figure out if I need to focus on Blender, Babylon.js, or a combination of both.
Thanks in advance!
-Dustan
Man, that is weird how you can comment out the modelData and still have it running. Maybe @sebavan would know?
It depends on what part you are trying to create. In this playground, the model is coming from some blender data. If you want to make your own models (meshes and textures etc), I’d consider starting looking into blender. The animation and physics are coming from Babylon.
The blender model is just a cross, it used being used as a “skeleton reference”. Babylon is adding boxes to flesh it out to make the model look like a mincrafty-y human. Then it animates it as if the body was collapsing on the ground.
Actually, it does not work without it ???
https://playground.babylonjs.com/#PM5MFS#15
Could you share a working playground without the data ?
Thanks @belfortk and @sebavan for taking a look at this! I just noticed the import mesh (line 37), so I assume that’s the blender mesh? Being new to this, I thought that mesh was a representation of the physics impostors. I didn’t realize there are Babylon blocks and a Blender mesh linked.
I’ve just been deleting the last lines of code (starting with varModelData). I saved a copy with those lines deleted here and it still seems to work.
So I guess here are some new questions:
-
Why is the Blender varModelData there? Does it need to be?
-
Is the character staying together and following ragdoll physics because of the Blender skeleton, or because of Babylon (blocks attached by joints manually coded into Babylon)?
All the forum responses I researched indicate that all skeleton information should not be coded manually, but is always exported from programs like Blender. But, maybe this is just in the case of animations. I suppose I’m trying to achieve ragdoll physics with meshes that I create in Blender.
My hunch is that Blender skeletons only exist for animations, and do not help meshes with physics when imported. If that’s the case, I suppose I should just import meshes, then connect them with Babylon joints like in the example.
Thanks again for any input or advice!
Update:
It looks like when you save without the Blender data, it stops working. In the original example, when you delete it in Playground and play again (without saving), it works. So that code is important! Question 1 is answered, but Question 2 is still open
Great, thanks! I’ll focus on using the Babylon bone and joint system to make my meshes move then