wojtekpil / Godot-Octahedral-Impostors

Octahedral Impostors implementation for Godot Game Engine
MIT License
265 stars 30 forks source link

More User friendly Interface #9

Closed SIsilicon closed 4 years ago

SIsilicon commented 4 years ago

In this pull request, the baker is moved into the editor via the creation of an editor plugin. A button will appear in the spatial tool bar whenever a geometry instance is selected (besides CSG nodes, because their bounding boxes can't be computed for some reason). When pressed, the following window will popup. image Each label has a tooltip which will allow users to quickly read what each control does. When the Generate button is pressed, the user can also choose to save the impostor and its associated images anywhere they want. image

wojtekpil commented 4 years ago

Thank you for your massive contribution. I am currently testing the changes. It seems that it mostly works correctly. I have only minor comments:

  1. Baker works only the first time, attempts to bake subsequent models always return the first model. The reason is the conversion of the image to an incompatible type when saving. The solution is to call converter.create_images () in octahedral_impostor_plugin.gd before converter.set_scene_to_bake (selected_object).
  2. The Godot window minimizes and does not return on Elementary OS (Linux). This does not seem harmful, but it also doesn't have the intended effect.
  3. It looks like AABB is incorrectly calculated when the source model is scaled.
  4. The demo scene looks broken again because the shader files have been moved.

Also, if you wish, please add yourself to the authors in LICENSE and plugin.cfg

SIsilicon commented 4 years ago

Okay, I'll do some changes tomorrow.

  1. I'll do that.
  2. There seems to be a function called scan() in the EditorFileSystem class. I'll see if I could use that instead of the current workaround.
  3. I'll look into that.
  4. I honestly forgot how the demo was supposed to look like. 😅 I'll take a look at this upstream branch to change it to match.

Also, it's ok if my name's not in the LICENSE or the plugin.cfg files. I'm just a contributor. 😊

wojtekpil commented 4 years ago

As for the second point, if scan() function doesn't work maybe we can try to workaround it. I was thinking that we could keep a copy of the .import files and put them beside png files before the load() function. It's a little bit dirty, but should be working. Godot will reimport these files later anyway.

SIsilicon commented 4 years ago

Alright, the changes have been added.

wojtekpil commented 4 years ago

I think it's almost ready for release. Method scan() works like a charm, so after re-adding those few lines everything seems to be working as it should.

SIsilicon commented 4 years ago

Is it all good now?

wojtekpil commented 4 years ago

Yes everything seems to be working :D Thank you for your effort!