Hallo,

I want to rotate bones from a blender model. Years ago I wrote a small games with blender game engine which worked well but now bge is removed so I want to migrate to godot.

My first exercise is to rotate objects that a parented with a bone. I created the object and bones in blender and exported them as glTF. I used https://docs.godotengine.org/en/3.0/tutorials/3d/working_with_3d_skeletons.html as reference but I can not load the project in godot3, the files can not be read.

My nodes are:

Node Armature is of type Skeleton. But when I want to create a script an inherit from Skeleton I get an error Script inherits from native type 'Skeleton', so it can't be instanced in object of type: 'Spatial'.

My code is:

extends Skeleton # typ is skeleton, so should work but gives error

var skel

# Called when the node enters the scene tree for the first time.
func _ready():
	skel = get_node("BoneUnten")
	print("skel id: ", skel)
	var count = skel.get_bone_count()
	print("bone count:", count)
	pass # Replace with function body.

Whats wrong?

From another discussion a while ago, the best export to keep your settings is gltf separate textures. Then in Godot double click on it in the left corner of the project and click on "new inherited".

gltf seperate textures did not change anything. But I got one step further. I had to set typ of boneBlender to Skeleton, than my script does not complain about extends Skeleton any more. I don't really understand why as the script is on node Armature.

But, it does not finde BoneUnten and get_bone_count returns 0. ??

I had set all bones to typ "Bone attachment", which was probably wrong. Setting to "physical bone" also gives bone_cnt = 0.

extends Skeleton


# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var boneId


# Called when the node enters the scene tree for the first time.
func _ready():
	boneId = get_node(".")
	boneId = find_bone("BoneUnten")
	print("bone unten: ", boneId)
	print("bone name: ", get_name ( ))
	print("bone cnt: ", get_bone_count())
	pass # Replace with function body.

Result: --- Debugging process started --- Godot Engine v3.2.3.stable.custom_build - https://godotengine.org OpenGL ES 3.0 Renderer: Mesa Intel(R) HD Graphics 530 (SKL GT2)


bone unten: -1
bone name: Armature
bone cnt: 0
skel id: [Skeleton:1199]
BoneUnten id: [Object:null]

There is something going on with the import because the Skeleton node is added by Godot on import. I found this IK project which might be interesting to you: https://godotengine.org/asset-library/asset/523 I imported the project into godot and it plainly shows the Skeleton node with a little picture of a skull in the tree below the armature which, I think, is how it is supposed to import. Apparently it needs an addon which I didn't have so it complained when I loaded it. It might be that it needs an animation or something before it adds the node. I also checked on an old project of mine and it added the Skeleton node with the picture of a skull.

a year later