diff --git a/tools/pack.bash b/tools/pack.bash index f7f6b2c..1598de2 100755 --- a/tools/pack.bash +++ b/tools/pack.bash @@ -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 ++ $@ diff --git a/tools/pack_res.gd b/tools/pack_res.gd index 7ba40b4..258707b 100755 --- a/tools/pack_res.gd +++ b/tools/pack_res.gd @@ -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"]