NitroxNova / humanizer

convert MakeHuman to Godot4
The Unlicense
149 stars 15 forks source link

fix crash on exported projects #14

Closed aromancev closed 6 months ago

aromancev commented 6 months ago

This change fixes https://github.com/NitroxNova/Humanizer/issues/13

Context Exported project crashes on start. I did a bit of digging and apparently HumanizerUtils depends on EditorInterface which is fine but probably we don't want this to be "compiled" for the exported project.

I removed this dependency by duplicating the contents of read_json static function. IMO a bit of duplication is better than a bit of dependency :)

Personal opinion: I would probably avoid having a single utils class of any kind to avoid dependency hell in future.

NitroxNova commented 6 months ago

thank you for looking into the issue, this is excellent information, much appreciated! we will likely merge the change, but first need to look into why the humanizerUtils is making it crash since there are other functions we need from there

aromancev commented 6 months ago

thank you for looking into the issue, this is excellent information, much appreciated! we will likely merge the change, but first need to look into why the humanizerUtils is making it crash since there are other functions we need from there

Glad to contribute. Awesome project!

I think it crashes because EditorInterface does not exist in an exported project :)

emberlightstudios commented 6 months ago

I'm okay with the Utils class in general. This is in one place in the file at the bottom. I wrote a show window function which was intended to bring up popup windows in editor. I don't think it's even being used anywhere currently. We should have a separate script for editor only utils. I will fix this when I get a chance, unless Nova wants to do it first.

emberlightstudios commented 6 months ago

Thank you for bringing this to our attention. I prefer to keep the utils class, but I have moved the editor specific code to a separate editor class. Please let us know if your issue persists.