godot_parser
godot_parser copied to clipboard
ParseException: Expected end of text, found 'tracks' on tscn file
Hi,
Thank you very much for this project ! I found it very useful.
I've encountered an issue when trying to parse a tscn file. The scene contains an AnimationPlayer which seems to confuse the parser.
I get a ParseException with the following message :
pyparsing.exceptions.ParseException: Expected end of text, found 'tracks' (at char 1796), (line:65, col:1)
I'm using Godot version 4.2.1
Here is the tscn file I'm trying to parse :
player.tscn
[gd_scene load_steps=23 format=3 uid="uid://d4karstyb4ncb"]
[ext_resource type="Script" path="res://scenes/player/player.gd" id="1_oy55l"]
[ext_resource type="Texture2D" uid="uid://kuwx1qhyq2py" path="res://sprites/spaceguy/spaceguy.png" id="2_u40j3"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_olhyg"]
size = Vector2(128, 248)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_qwa4x"]
size = Vector2(192, 192)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_klhvu"]
size = Vector2(176, 192)
[sub_resource type="Animation" id="Animation_5jvi1"]
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [1]
}
[sub_resource type="Animation" id="Animation_mm4ub"]
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [1]
}
[sub_resource type="Animation" id="Animation_2u8pe"]
resource_name = "hammer"
length = 0.3
step = 0.02
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.06, 0.12, 0.18),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 1,
"values": [11, 19, 20, 21]
}
tracks/1/type = "method"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.06, 0.3),
"transitions": PackedFloat32Array(1, 1),
"values": [{
"args": [],
"method": &"hammer_attack"
}, {
"args": [],
"method": &"on_attack_end"
}]
}
[sub_resource type="Animation" id="Animation_ngtps"]
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [11]
}
[sub_resource type="Animation" id="Animation_0kt8b"]
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.1),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [11]
}
[sub_resource type="Animation" id="Animation_uvgue"]
resource_name = "hold_idle"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [8]
}
[sub_resource type="Animation" id="Animation_dmd0o"]
resource_name = "hold_jump"
length = 0.3
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [13, 14, 15]
}
[sub_resource type="Animation" id="Animation_4diky"]
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.2),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [13]
}
[sub_resource type="Animation" id="Animation_kxrlm"]
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.1),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [13]
}
[sub_resource type="Animation" id="Animation_7ghh1"]
resource_name = "hold_run"
length = 0.4
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 1,
"values": [9, 10, 11, 12]
}
[sub_resource type="Animation" id="Animation_0la8n"]
resource_name = "idle"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
"update": 1,
"values": [0, 0, 0, 0, 0]
}
[sub_resource type="Animation" id="Animation_46fb1"]
resource_name = "jump"
length = 0.3
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [5, 6, 7]
}
[sub_resource type="Animation" id="Animation_y38yn"]
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.2),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [5]
}
[sub_resource type="Animation" id="Animation_i1kx2"]
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.3),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [5]
}
[sub_resource type="Animation" id="Animation_qr7es"]
resource_name = "throw"
length = 0.3
step = 0.02
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.06, 0.12),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [16, 17, 18]
}
tracks/1/type = "method"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.3),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"on_throw_end"
}]
}
[sub_resource type="Animation" id="Animation_52hkb"]
resource_name = "run"
length = 0.4
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 1,
"values": [1, 2, 3, 4]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_cv44o"]
_data = {
"die": SubResource("Animation_5jvi1"),
"fall": SubResource("Animation_mm4ub"),
"hammer": SubResource("Animation_2u8pe"),
"hammer_air": SubResource("Animation_ngtps"),
"hold_fall": SubResource("Animation_0kt8b"),
"hold_idle": SubResource("Animation_uvgue"),
"hold_jump": SubResource("Animation_dmd0o"),
"hold_land": SubResource("Animation_4diky"),
"hold_land_walk": SubResource("Animation_kxrlm"),
"hold_walk": SubResource("Animation_7ghh1"),
"idle": SubResource("Animation_0la8n"),
"jump": SubResource("Animation_46fb1"),
"land": SubResource("Animation_y38yn"),
"land_walk": SubResource("Animation_i1kx2"),
"throw": SubResource("Animation_qr7es"),
"walk": SubResource("Animation_52hkb")
}
[node name="PhPlayer" type="CharacterBody2D" groups=["players"]]
collision_mask = 128
script = ExtResource("1_oy55l")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 4)
shape = SubResource("RectangleShape2D_olhyg")
one_way_collision_margin = 16.0
[node name="GrabArea" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 256
[node name="CollisionShape2D" type="CollisionShape2D" parent="GrabArea"]
shape = SubResource("RectangleShape2D_qwa4x")
[node name="LeftFloorRayCast" type="RayCast2D" parent="."]
position = Vector2(-80, 80)
target_position = Vector2(0, 32)
[node name="RightFloorRayCast" type="RayCast2D" parent="."]
position = Vector2(80, 80)
target_position = Vector2(0, 32)
[node name="Sprite" type="Node2D" parent="."]
[node name="HammerArea" type="Area2D" parent="Sprite"]
collision_layer = 2
collision_mask = 256
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sprite/HammerArea"]
position = Vector2(136, 0)
shape = SubResource("RectangleShape2D_klhvu")
disabled = true
[node name="HoldPosition" type="Marker2D" parent="Sprite"]
position = Vector2(88, -72)
[node name="ThrowPosition" type="Marker2D" parent="Sprite"]
position = Vector2(96, 0)
[node name="AnimationPlayer" type="AnimationPlayer" parent="Sprite"]
root_node = NodePath("../..")
libraries = {
"": SubResource("AnimationLibrary_cv44o")
}
autoplay = "idle"
[node name="Sprite2D" type="Sprite2D" parent="Sprite"]
texture = ExtResource("2_u40j3")
hframes = 10
vframes = 10
frame = 1
[connection signal="body_entered" from="Sprite/HammerArea" to="." method="_on_hammer_area_body_entered"]