This commit is contained in:
Spencer Killen 2024-01-05 18:06:39 -07:00
parent 5d3b7051a4
commit b83fed45df
Signed by: sjkillen
GPG Key ID: 3AF3117BA6FBB75B
2 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,6 @@
#!/usr/bin/env bash
# $@: list of file basenames for .exr files
# Note: due to how Godot finds paths, this works best if cwd is this directory
mkdir -p bundle
./pack_res.gd ++ $@

View File

@ -26,7 +26,7 @@ func _init():
var packed = PackedScene.new()
packed.pack(animations)
ResourceSaver.save(packed, "res://" + bundle_name, ResourceSaver.FLAG_CHANGE_PATH)
ResourceSaver.save(packed, "res://" + bundle_name, ResourceSaver.FLAG_CHANGE_PATH | ResourceSaver.FLAG_RELATIVE_PATHS)
# Was never added to the scene tree, must manually free
animations.free()
@ -36,7 +36,8 @@ func _init():
func add_animation(basename: String):
var animation_info: Dictionary = JSON.parse_string(FileAccess.open(basename + ".json", FileAccess.READ).get_as_text())
var animation = VertexAnimation.new()
animation.name = basename
var splitname: String = basename.split("/")[-1]
animation.name = splitname
animation.start_frame = animation_info["frame_start"]
animation.end_frame = animation_info["frame_end"]
animation.fps = animation_info["fps"]