godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.83k stars 21.14k forks source link

AnimationLibrary should use property list #62959

Open lyuma opened 2 years ago

lyuma commented 2 years ago

Godot version

4.0.alpha11

System information

Windows 10

Issue description

AnimationLibrary currently writes its embedded animations as a raw dictionary. For example:

[sub_resource type="AnimationLibrary" id="AnimationLibrary_b837x"]
_data = {
"FirstPerson": SubResource("Animation_i6vx5"),
"LOOKDOWN": SubResource("Animation_imeok"),
"LOOKLEFT": SubResource("Animation_q2ljn"),
"LOOKRIGHT": SubResource("Animation_h5rxe"),
"LOOKUP": SubResource("Animation_jlvfe"),
"ThirdPerson": SubResource("Animation_2n88e")
}

This could cause some issues, for example, invalid dictionary members could be added.

Steps to reproduce

  1. Create a new AnimationLibrary.
  2. Add animations to it.
  3. Save as text resource

Minimal reproduction project

No response

KoBeWi commented 2 years ago

invalid dictionary members could be added.

But the same can happen with properties. Not sure what is the problem?