working
This commit is contained in:
parent
5d3b7051a4
commit
b83fed45df
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# $@: list of file basenames for .exr files
|
# $@: 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 ++ $@
|
./pack_res.gd ++ $@
|
||||||
|
|
|
@ -26,7 +26,7 @@ func _init():
|
||||||
var packed = PackedScene.new()
|
var packed = PackedScene.new()
|
||||||
packed.pack(animations)
|
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
|
# Was never added to the scene tree, must manually free
|
||||||
animations.free()
|
animations.free()
|
||||||
|
@ -36,7 +36,8 @@ func _init():
|
||||||
func add_animation(basename: String):
|
func add_animation(basename: String):
|
||||||
var animation_info: Dictionary = JSON.parse_string(FileAccess.open(basename + ".json", FileAccess.READ).get_as_text())
|
var animation_info: Dictionary = JSON.parse_string(FileAccess.open(basename + ".json", FileAccess.READ).get_as_text())
|
||||||
var animation = VertexAnimation.new()
|
var animation = VertexAnimation.new()
|
||||||
animation.name = basename
|
var splitname: String = basename.split("/")[-1]
|
||||||
|
animation.name = splitname
|
||||||
animation.start_frame = animation_info["frame_start"]
|
animation.start_frame = animation_info["frame_start"]
|
||||||
animation.end_frame = animation_info["frame_end"]
|
animation.end_frame = animation_info["frame_end"]
|
||||||
animation.fps = animation_info["fps"]
|
animation.fps = animation_info["fps"]
|
||||||
|
|
Loading…
Reference in New Issue