Skip to content

Conversation

@bolinfest
Copy link

@bolinfest bolinfest commented Mar 6, 2025

I have been using this project to parse my .tscn files on Godot 4, which required some updates here to make things work:

  • Now .tscn files seem to be saved without spaces around args, so ExtResource("7") instead of ExtResource( "7" )
  • My files have properties like polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3), PackedInt32Array(4, 0, 3, 5)]) that did not seem to be accounted for in the existing grammar, so I had to add new rules in values.py and a GDTypedArray class to parse these new types into.
  • Not all objects have arguments (e.g., PackedStringArray()), so made the arg list for obj_type optional

This isn't well-tested, but empirically, it works for my purposes, so feel free to adapt as you see fit! Even if this isn't upstreamed, perhaps it will help someone else.

@stevearc
Copy link
Owner

I'm happy to merge this! Would just require:

  1. A test for the typed arrays in test_parser.py
  2. A simple test for typed arrays in test_objects.py
  3. Fix the failing tests

I think that the CI has rotted a bit in general. I'll see if I can get it back to a green state on master

@bolinfest
Copy link
Author

@stevearc if you can get CI healthy on master, then I'm happy to add tests!

@stevearc
Copy link
Owner

@bolinfest builds are working on master again

theMagicalKarp added a commit to theMagicalKarp/godot_parser that referenced this pull request Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants