JulienHeijmans / quicksnap

Blender addon to quickly snap objects/vertices/points to object origins/vertices/points
MIT License
393 stars 18 forks source link

Shader compile error with Blender 3.5 / 3.6 I'll get this message. #50

Closed nurb2kea closed 1 year ago

nurb2kea commented 1 year ago

Hi, when updating to blender 3.5 / 3.6 the addon will still be enabled but not working. When switching it on/off you'll get the below messages.

Screenshot 2023-02-16 at 1 37 05 pm

Screenshot 2023-02-16 at 1 32 11 pm

JulienHeijmans commented 1 year ago

Thank you for reporting the issue! :) Those are not officially supported yet, but I will have a look when I have time and hopefully fix the issue soon.

JulienHeijmans commented 1 year ago

Hey! I just tested the addon with both 3.5 and 3.6 without issue. Could you maybe try to remove the addon from your blender preferences, then download the zip of the last version of the addon (Here), and then in blender>Preferences>Add-ons window, click on Install... and you pick the zip file of the addon you just downloaded.

If it still does not work, could you tell me a bit about your setup, do you use Windows, Mac or Linux? Maybe you could open the console (Menu Window>Toggle system console) and copy/paste here the details of the Shader Compile Error.

Thank you :)

nurb2kea commented 1 year ago

Hi,

I uninstalled it, rebooted blender and tried to install the zip from your last message. I install my plugins via/into the preferences folder.

Started it via Terminal and this is the message from terminal: Screenshot 2023-02-17 at 7 14 09 pm

Screenshot 2023-02-17 at 7 07 26 pm

Screenshot 2023-02-17 at 7 03 24 pm

Screenshot 2023-02-17 at 6 58 57 pm

System

JulienHeijmans commented 1 year ago

Alright, thank you for the very detailed answer! I do not have a mac and cannot repro the issue here, but I will look into the issue and try to figure out what changed in 3.5/3.6.

To make sure, the console does not show any more information than what is displayed in the terminal?

nurb2kea commented 1 year ago

I guess this is a good hint from @PratikPB2123

https://projects.blender.org/blender/blender-addons/commit/5c22e77ea30327173d542b41dc2f7653f2cb1a7a and https://projects.blender.org/mano-wii

nurb2kea commented 1 year ago

@Nurb2Kea it seems like @Julien-Heijmans is the maintainer of the add-on. You have already been in contact with him.

There are two reasons why shaders needs to be ported:

Addon still uses bgl that call OpenGL calls directly. Shader don't use gpu.types.ShaderCreateInfo to support cross platform source generation. These structures have already been in place for some time, and we communicated that addon developers should use this new API. It is sadly common for developers to only port to newer API's when it makes sense for them.

In this case it looks like he hasn't ported his shaders to use gpu.types.ShaderCreateInfo as described on https://docs.blender.org/api/current/gpu.html. If someone requires some help they can get in contact with the Eevee/viewport module at blender.chat or in the python channel. I am happy to help out there.

JulienHeijmans commented 1 year ago

Thank you, I will look at that. Ah yes, that's the answer to the ticket that I created :)

JulienHeijmans commented 1 year ago

Could you try the latest revision on this branch: https://github.com/JulienHeijmans/quicksnap/tree/update-shader-definition-blender3.5 It should, I think, fix the crashes due to shader definition.There might be some other causes for crash. No matter what, if it works you can still expect some warning spam in the console when you use the addon, due to some other deprecated bgl calls. (I will also look at those)

Edit: I have also removed all the bgl calls now, so it should be working all fine now. Please tell me how it goes on your mac!

nurb2kea commented 1 year ago

Hi, so when you rename the zip and the installed addon folder to quicksnap, it is installing and working fine again. Otherwise you get this: Screenshot 2023-02-20 at 8 45 14 pm

Thanks for your help and work. This is one of the important addons I use daily.

JulienHeijmans commented 1 year ago

Otherwise you get this

Ah yes, right, that happens when there is a "." in the name of the zip file, it won't happen when the update is delivered to the users.

so when you rename the zip and the installed addon folder to quicksnap, it is installing and working fine again. Thanks for your help and work. This is one of the important addons I use daily.

Great, happy to have that resolved. To be honest I knew that I used some older APIs, but back then there was very little documentation and I could not update all the code to use the new api. So I am happy that this is fixed once and for all :)

Thank you for reporting and following up with the information, so other people won't face the same issue as you did.

nurb2kea commented 1 year ago

Don't forget to update Blendermarket ... Screenshot 2023-02-21 at 12 07 43 am

JulienHeijmans commented 1 year ago

I am not forgetting it. The current fix makes the addon fail to load on blender 3.3 because it uses shaders that did not exist on older blender versions. I need to add code that makes the addon use different shaders based on the blender version. When it is done I will update the addon everywhere.