LoganFairbairn/MatLayer

Switching materials in Material Properties crashes Blender

Closed this issue · 6 comments

I get a crash when clicking a second material on a selected object in Properties/ Material Properties. When I remove MatLayer, latest version 2.0.2, the crash dissapears. (Mac M1 Pro, B3d v 4.0.2)

In the release section I had said the add-on was compatible with Blender 4.0+, when the add-on should really be used only when the specific version of Blender it was made for. I've reworded the releases to specify a single version they release was created for.

MatLayer 2.0.2 is made for Blender 4.0 and hasn't been tested on newer versions so there could be errors. That being said, MatLayer should still be compatible with the newer versions of Blender 4.0.

When I looked up Blender 4.0.2, it's listed as a release candidate and not an officially released version yet, which suggests the build is still prone to crashes. This suggests it could be an error caused in that version of Blender, specifically some changes related to how python API calls are handled, and not directly related to MatLayer. For the time being if you'd like to use MatLayer, you could try using Blender 4.0.

I'll download Blender 4.0.2 and see if I can replicate the error.

I downloaded Blender version 4.0.2 and was unable to reproduce the error.

I tried adding multiple MatLayer materials to an object in different slots and swapping between them in both the add-on window and the Properties -> Material Properties pannel.

I tried the same steps again, but with non-MatLayer materials which didn't result in a crash either.

There's a chance that Blender 4.0.2 release candidate was updated between when you and I had downloaded it, and a fix was implemented for the error you were having. Alternatively it could be related to using a Mac, but I think that's less likely.

Re-downloading Blender 4.0.2 might fix your errors. If you crash again with the same reproduce steps, I'll need additional information to be able to address this error.

On the off chance you happen to be a Python developer, MatLayer uses the Blender's message bus to refresh properties automatically when users swap selected / active material slots in this file - https://github.com/LoganFairbairn/matlayer/blob/main/core/subscription_update_handler.py

I'll be leaving this ticket open for the next week to continue to track this issue, but I'll close it if I'm not able to reproduce the error after that time.

I am sorry, not a developer and I don't know how to check console. Tried MatLayer 2.0.2 in Blender 3.66 also and I get the same crash on switching the second material added in MatLayer panel. The same as adding a new second material in the properties panel, (not using Mat Layer but B3d default material properties on the Properties panel on the right) Here's a video capture below and the blend file file I'm having trouble with. So after I create a second material the crash only happens when switching to the other material. Both in MatLayers panels and default b3d Material properties. I get the same crash with the file below (zip archive) in Blender 3.6.6 and 4.02.
Uploaded the zip blend and the capture below:

videocapture.mov

b3d-366.blend.zip

After some extensive research, I'm not able to find a concrete cause for this issue. I currently believe the issue may be with using MatLayer on a Mac. I'm not able to support Mac at the moment because I don't have access to a Mac for testing purposes. If possible, swap to using Linux, or Windows when using MatLayer for the time being. I may be able to fix this issue in the far future.

Thank you, Logan.

Hi again, I had another user check if this issue persists on the latest version of Blender and it does not. I believe this may have been solved on Blender's side in Blender 4.1.0.

Since I can't reproduce this issue on Windows, and neither can Mac users using the most recent version of Blender, I'll close this issue for now.