An error is reported for the example animation
Godot version:4.4
anima/core/keyframes-engine.gd
Error animation:2DGrid
Error line:56
Error code:
if frame_keys[0] != 0:
Error:Out of bounds get index '0' (on base: 'Array')
Resolution:
Line 29
if percentage is StringName: #if percentage is String:
Could you provide an example code that I can use to reproduce this issue?
@ceceppa This is an example that comes with the project, and the godot version is 4.4 https://github.com/user-attachments/assets/3c3be12b-a7fd-42f2-bca6-d8bf574c4a9f
@ceceppa hi, I had the same error and it seems to be fixable by adding a StringName check, In keyframeEngine, line 29:
static func flatten_keyframes_data(data: Dictionary) -> Array:
var result := {}
for key in data:
var is_dictionary = data.has(key) and data[key] is Dictionary
var value: Dictionary = data[key].duplicate() if is_dictionary else {}
if not key is Array:
key = [key]
for percentage in key:
if percentage is String:
if percentage == "from":
percentage = 0
elif percentage == "to":
percentage = 100
to
var result := {}
for key in data:
var is_dictionary = data.has(key) and data[key] is Dictionary
var value: Dictionary = data[key].duplicate() if is_dictionary else {}
if not key is Array:
key = [key]
for percentage in key:
if percentage is String or percentage is StringName:
if percentage == "from":
percentage = 0
elif percentage == "to":
percentage = 100
there are some other bugs as well. Some of the declarative construction of animation is not working, but all the dictionary construction seems to be working well.