kaosat-dev / Blenvy

Bevy Code & Blender addon for a simple workflow to add & edit Bevy components in Blender
Other
580 stars 51 forks source link

Corruption of entire .blend file if Save is done when cursor is on top of Object Panel #103

Closed franklinblanco closed 8 months ago

franklinblanco commented 9 months ago

DETAILS: OS: MAC OSX SONOMA 14.2.1 Blender: Blender 4.0 Hardware: M1 Mac Pro 32GB Ram 1TB Storage (2021) Base config

Hello. Just wanted to thank you all for the great work. This library is amazing.

Currently, I'm having a big issue, I setup the GLTF_AUTO_EXPORT plugin in blender and it works great. But whenever I place my cursor anywhere near the Custom Properties Option in the Object Panel I get an error and the whole .blend file gets corrupted.

Normal Blender file with gltf_auto_export_setup Screenshot 2024-01-22 at 2 28 16 PM

GLTF_AUTO_EXPORT configuration Screenshot 2024-01-22 at 2 22 02 PM

This is what happens when you hit save with your cursor on top of the panel Screenshot 2024-01-22 at 2 28 45 PM

In green is where having your cursor is safe to save, in red is where it corrupts everything Screenshot 2024-01-22 at 2 22 27 PM

czettnersandor commented 9 months ago

Ah, I could not find the exact cause of this error, for me, it seemed completely random, but I can confirm it's when the mouse is over the object panel. BTW the file is not corrupted, you can delete the temp_scene (X icon on the top right near the scene name) and get back your objects on screen.

franklinblanco commented 9 months ago

@czettnersandor I tried doing that but look at the custom properties (they get blanked) and names of things like the collection: Screenshot 2024-01-22 at 2 47 55 PM

kaosat-dev commented 9 months ago

Wow @franklinblanco , good catch, thanks for the bug report ! I will investigate why / how having the cursor over the object panel causes that issue , very weird o_O Btw, your mileage may vary, but in theory you should be able to undo the changes/corruption (by using the usual "undo"). If not very sorry about that ! I have a few ideas/ existing code that should enable me to add a "clean" rollback in case the export fails , I'll try to add a patch asap. Also, thanks for the kind words :) Glad it is mostly a good experience!

@czettnersandor thank you for confirming the issue on your end !

franklinblanco commented 9 months ago

@kaosat-dev So, as for Undo, it doesn't do anything for me. It's like the whole Undo Tree gets deleted. For some reason after it happened a few times it just started happening everywhere in some blender files. Didn't really spend time replicating it but I found that switching to v0.9 of the plugin didn't have any of these issues. So for now I'm sticking to that version. Wish I had an interest in python so I could help out. But all python just gives me a fat headache.

kaosat-dev commented 9 months ago

@kaosat-dev So, as for Undo, it doesn't do anything for me. It's like the whole Undo Tree gets deleted. For some reason after it happened a few times it just started happening everywhere in some blender files. Didn't really spend time replicating it but I found that switching to v0.9 of the plugin didn't have any of these issues. So for now I'm sticking to that version. Wish I had an interest in python so I could help out. But all python just gives me a fat headache.

Thanks for the report about it working in v0.9 ! I have a few ideas about the regression. Also precious information about undo. No worries, my brain seems about to explode switching between python and Rust so I can understand 😅 I will tackle these issues once I am done with the UI tool PR (giant PR !), hope that is ok.

kaosat-dev commented 8 months ago

Hi @franklinblanco & @czettnersandor I just spent quite a bit of time trying to solve this issue (decided to get it fixed before the big new release). And I am baffled, some Blender things that are supposed to be reliable seem to break just based on the cursor position, some data structures that are normally present and filled get empty , just because of the placement of the cursor o_O, quite maddening. I am still investigating, but I am leaning more and more towards an issue with Blender itself.

@franklinblanco are you 100% sure that the issue was not present in v0.9 ? because the impacted parts, as far as I can tell where already present in that version (though the actual error would be different in that version, but still fail)

franklinblanco commented 8 months ago

@kaosat-dev Hello! Once again thank you for taking precious time out for this. So I used the 0.9 version for quite a while now and at the start it was not happening based on cursor position, but the days have passed and now I've found that yes it still happend in 0.9. Looks to me like a blender thing yes.

By the way, just wanted to say, after using this plugin for a while... It's helped me incredibly through the development of my game. I'm always very wary of using things I didn't write myself, at the start I completely avoided the auto save plugin and the blueprints part of your plugin, and I got to say boy was I wrong for doing that, now It just works smooth and perfectly. I'll be making some devlogs soon and I'll make sure to shout out this plugin every chance I get. Thank you. Anything else you need let me know.

kaosat-dev commented 8 months ago

Hi again @franklinblanco ! Thanks for confirming that it was also present in v0.9. I ended up rewriting a significant portion of the exporter to try and get around the problem (I created a PR on the Blender Gltf exporter repo as well, hope it can get merged for Blender 4.1), so hopefully that issue (and many others) should be fixed in v0.11 (preparing the release right now).

And thank your for the very kind words ! Very happy that the tooling has helped you so far :) Looking forward to reading your devlogs ! The more feedback , the more I can fine tune things and make the tooling better ;)