- Edited
Hello,
I am trying to make a 3D character that can have parts added or removed from it at runtime. Those parts are rigged with the same skeleton in blender and exported in a gltf format. There seems to be a few issues when trying to do that, either that or I am doing something wrong.
On the blender side of things, it seems I have to export the armature to get the skinning data, otherwise it won't, so fine I export it parented to the armature. When imported in Godot I get something like this:
- Root3D
- Amature(Skeleton3D)
- Hat(MeshInstance3D)
- Amature(Skeleton3D)
From what I gathered this following code seems to be the way to add the mesh to the skeleton.
var hat_blueprint = preload("res://meshes/hat.tscn")
var hat = hat_blueprint.instantiate()
var skeleton = $Character/Armature/Skeleton3D
skeleton.add_child( hat )
And it works when I can get just "Hat" as the scene root, a MeshInstance3D, but to get that, I must jump through a few hoops to make a scene where I can have "Hat" as the root of the scene and the only node. The only issue with that is that it's not simple and breaks the chain to the gltf, which means any changes to it won't apply to my "Hat" scene.
I tried adding an import script to reparent everything as I want it, but that funcitonality seems to be broken. The "scene" object you get in _post_import is totally empty when I hit "Reimport" on the gltf to which I attached the script.
If anyone has a clean way to get from blender to a simple and valid scene that can be parented to the armature, please tell!
Thanks