Code Monkey home page Code Monkey logo

godot_parser's Introduction

Hello

On Github, I am primarily known for authoring and maintaining several Neovim plugins.

These days, between work and family I have very little free time available. I can no longer get to every reported issue, so I have implemented a priority queue:

  1. Pull requests - these are the highest priority for me and will be looked at first.
  2. After PRs, I will triage new issues with P0, P1, and P2 labels.
  3. P0 issues will be worked on as soon as possible.
  4. P1 issues may get worked on when I get spare time and feel like it, which is uncommon these days.
  5. P2 issues will not be worked on. Pull requests are the only way to move these forward.

godot_parser's People

Contributors

excaliburzero avatar jjmontesl avatar micimize avatar richard-gebbia avatar stevearc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

godot_parser's Issues

Missing: Does not handle escaped strings in .tscn files

I have a pseudo-language that I use in some props of my scene objects, and godot-parser doesn't like escaped strings.

Example from test_parse_files.py on my project:
condition = "has_ability(\"djump\")" <x> condition = "has_ability("djump")"

Note that I didn't add the escaping. I just typed has_ability("djump") in the editor, and apparently on save it escapes it.

Binary parent scenes cause exception

This one is pretty obvious, but perhaps something to wrap in a friendly "I can't do that Dave" style exception.

I have a .tscn file (text-based) which inherits from a .scn file (binary).

When I open the .tscn file in tree mode, I get an exception.

I suggest that until you start supporting .scn files you catch and re-raise this exception as something akin to "Binary files are not supported yet"

Thanks

c:\users\tom\appdata\local\programs\python\python39\lib\site-packages\godot_parser\tree.py in _load_parent_scene(root, file)
    327 
    328 def _load_parent_scene(root: Node, file: GDFile):
--> 329     parent_file: GDFile = file.load_parent_scene()
    330     parent_tree = Tree.build(parent_file)
    331     # Transfer parent scene's children to this scene

c:\users\tom\appdata\local\programs\python\python39\lib\site-packages\godot_parser\files.py in load_parent_scene(self)
    256                 "Could not find parent scene resource id(%d)" % root.instance
    257             )
--> 258         return GDScene.load(gdpath_to_filepath(self.project_root, parent_res.path))
    259 
    260     @contextmanager

c:\users\tom\appdata\local\programs\python\python39\lib\site-packages\godot_parser\files.py in load(cls, filepath)
    306     def load(cls: Type[GDFileType], filepath: str) -> GDFileType:
    307         with open(filepath, "r") as ifile:
--> 308             file = cls.parse(ifile.read())
    309         file.project_root = find_project_root(filepath)
    310         return file

c:\users\tom\appdata\local\programs\python\python39\lib\encodings\cp1252.py in decode(self, input, final)
     21 class IncrementalDecoder(codecs.IncrementalDecoder):
     22     def decode(self, input, final=False):
---> 23         return codecs.charmap_decode(input,self.errors,decoding_table)[0]
     24 
     25 class StreamWriter(Codec,codecs.StreamWriter):

UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 1848: character maps to <undefined>

Parsing large scene is slow.

Parsing small scenes works really well.

And, I have this 50k lines, 67mb scene file converted from an .escn file imported from blender. I wanted to shrink its size from the source. I wrote some regex-based scripts and it was neither elegant nor convinent, then I found this parser.

However, It took 11 minutes to parse this 67mb scene. RAM usage increased very slowly and the parsing was using only 6% CPU usage of a Ryzen 2700X.

67mb lines is definitely large, but I think 11 minutes is a bit much. Is it a normal speed with pyparsing or does the script need deeper optimization idk.

City.zip

Are there any plans to port it to 4.0?

I was trying to create a tool for helping me in development of my game but realized that this hasn't been updated yet (and trying to parse a 4.0 scene just throws a ParseException), and considering this may be a big rewrite, I just wanted to know if there were any plans for it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.