ClarkThyLord / Voxel-Core

Voxel plugin for the Godot game engine!
https://godotengine.org/asset-library/asset/465
MIT License
453 stars 28 forks source link

VoxelObject Editor closes when selecting "Edit" #52

Closed ottovw closed 2 years ago

ottovw commented 2 years ago

Creating a VoxelObject and drawing works,

After that I can't edit a VoxelObject see here:

https://user-images.githubusercontent.com/1045946/147395282-15d9951b-6b35-40dd-b04f-f92833a8f186.mp4

Using Godot 3.4.2

auralluring commented 2 years ago

I'm also experiencing this bug. I'm trying to get a hang of the plugin and this bug is making it very difficult. Occasionally, pressing edit will actually enter edit mode, but I can't figure out how to make that happen more often.

ClarkThyLord commented 2 years ago

Sorry for the inconvenience, yes this bug is already known it occurs when trying to edit a VoxelObject with a sub resource selected, which you appear to be doing as I can see the VoxelSet Editor at the bottom panel. You can "fix" this by unselecting the sub resource, but this isn't really a permanent fix 😕

As mentioned in #48 I've tried to debug this issue multiple times before, but it's hard due to the way Godot handles its internal editor events. However, I haven't taken a look recently so maybe something has changed, I'll take a look again and see if I can come up with a fix 👍

ottovw commented 2 years ago

Thanks for the quick response.

How do I "unselect the subresource" ?

@ClarkThyLord have you tried asking some of the godot contributors in https://chat.godotengine.org/home or in the discord channel? I'm sure they're willing to help.

ClarkThyLord commented 2 years ago

To unselect sub resources, simply select any resources that are highlighted in-editor, such as a VoxelSet or Mesh.

Also I took a look, and was able to figure out a patch 🙌

I've now merged the patch, so no need to unselect sub resources now! If you can, please update your project with the latest changes and try it out again, let me know if that resolved the encountered issue, thanks.

auralluring commented 2 years ago

ok, so now I can select "Editing", but the voxel cursor doesn't appear and Output gets flooded with errors.

I did a bit of debugging and the source of the errors is the update_selections function, looks like an issue with SelectionMode. The function seems to run fine once (prev is 0), then the errors come.

I also learned today that breakpoints don't work in tool scripts, which I suppose makes a lot of sense.

ClarkThyLord commented 2 years ago

@HorseLuvver That's odd, I did some testing with a new cloned repo and on two different computers but haven't gotten any error outputs when editing VoxelObjects in-engine. Mind giving me more details, what version of Godot are you running? Have you modified the plugin yourself? Did you update all the plugin files with the latest? If so how? Also, have you tried closing and opening the project again? That always seems to help me 😂

And yes, not being able to use breakpoints makes debugging plugins and tool scripts tricky at time 😅 But you can always rely on print statements 🙌

auralluring commented 2 years ago

Sure, I'm on Godot 3.4.2. I'm not 100% sure how (or if, I guess) the plugin was updated, just went to update it and noticed the edit button was working, and figured it already had. Though it would have been through the editor somehow, there's an update button in the plugin screen that I might have pressed and not remember. I have made VoxelObject a global class so the class list is more consistent, but that wouldn't really mess with anything I don't think. I did also play around with VoxelWorldSize a bit, along with the distance of the camera to the voxel in the voxel viewer, but both of those are back to their defaults now. I don't think there is anything else besides debugging. And reloading the project was the only way I could get the update_selections function to run at all, so I did that many times.

ClarkThyLord commented 2 years ago

@HorseLuvver I see, I don't believe Godot updates addons files by itself, you're probably running an old old version of the plugin. If that's the case, try downloading the files directly from GitHub and replacing them within your project, that should fix it up 🤔

Other than that, I don't believe the changes you mentioned could cause these type of errors.

ottovw commented 2 years ago

@ClarkThyLord so i removed the addon and reinstalled and it didn't work.

Then i downloaded the files from github and it DID work! Thanks!

Probably you have to create a new release.

ClarkThyLord commented 2 years ago

Great, I'll go ahead and close this issue for now then, any future problems can be reported via a new issue, thanks.

And yes, I've yet to update the version on the Godot Asset Library, will do in the future 👍