This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

I have a custom file that contains multiple skeletons for multiple characters. I'm trying to import each as a skeleton so I can reference it to my meshes in code any time.

Here is my code:

for x in range(numChars):
    var skel =
    var skin =

    for _y in range(numCharBones[x]):
        var bonePIndex = file.get_32()
        var boneIndex  = file.get_32()

        var boneName  = "bone_%d" % boneIndex
        var bonePName = "bone_%d" % bonePIndex if bonePIndex >= 0 else ""

        var m0 = file.get_float()
        var m1 = file.get_float()
        var m2 = file.get_float()
        var m3 = file.get_float()
        var m4 = file.get_float()
        var m5 = file.get_float()
        var m6 = file.get_float()
        var m7 = file.get_float()
        var m8 = file.get_float()
        var m9 = file.get_float()
        var m10 = file.get_float()
        var m11 = file.get_float()
        var m12 = file.get_float()
        var m13 = file.get_float()
        var m14 = file.get_float()
        var m15 = file.get_float()

        var boneId = skel.find_bone(boneName)
        if bonePName != "":
            var bonePId = skel.find_bone(bonePName)
            skel.set_bone_parent(boneId, bonePId)

        skel.set_bone_rest(boneId, Transform(Vector3(m0, m1, m2), Vector3(m4, m5, m6), Vector3(m8, m9, m10), Vector3(m12, m13, m14)))

    var outpath = "res://equips/%d.%s" % [x, get_save_extension()]
    var result =, skel)

    if result != OK:
        return result


Unfortunately, I keep getting the error: Can't save empty resource to path

func get_save_extension():
    return "skel"

func get_resource_type():
    return "Skeleton"

After further investigation, I found out that Skeleton is not a resource which means it cannot be saved. What are my options here? What are my alternatives?

in Engine by (24 points)
edited by

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.