andyp123 / blender_vertex_color_master

Blender addon for working more precisely with vertex colours.
365 stars 40 forks source link

blender 4.0+ support #43

Closed Andrej730 closed 4 months ago

Andrej730 commented 1 year ago

@andyp123

There is an issue with Blender 4.0+ #42 caused by the recent breaking change in Python API:

image

semajavoye commented 9 months ago

+rep

loicbramoulle commented 4 months ago

oddly in 4.1 it doesn't appear in my addons when I install it. (zip from code button, or from release)

Andrej730 commented 4 months ago

@loicbramoulle try this https://github.com/andyp123/blender_vertex_color_master/pull/44/files

loicbramoulle commented 4 months ago

Thanks, I've tried it, the main branch version does appear in addon, and I've replaced the files with this 4.0 branch ones, but I still have the error when trying to enable the addon:

Traceback (most recent call last): File "C:\Program Files\Blender Foundation\Blender 4.1\4.1\scripts\modules\addon_utils.py", line 376, in enable mod = importlib.import_module(module_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Blender Foundation\Blender 4.1\4.1\python\Lib\importlib__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "C:\Users\Admin\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\vertex_color_master__init__.py", line 32, in from . import vcm_ops File "C:\Users\Admin\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\vertex_color_master\vcm_ops.py", line 63, in class VERTEXCOLORMASTER_OT_Gradient(bpy.types.Operator): File "C:\Users\Admin\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\vertex_color_master\vcm_ops.py", line 72, in VERTEXCOLORMASTER_OT_Gradient line_shader = gpu.shader.from_builtin('2D_SMOOTH_COLOR') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: expected a string in ('FLAT_COLOR', 'IMAGE', 'IMAGE_COLOR', 'SMOOTH_COLOR', 'UNIFORM_COLOR', 'POLYLINE_FLAT_COLOR', 'POLYLINE_SMOOTH_COLOR', 'POLYLINE_UNIFORM_COLOR'), got '2D_SMOOTH_COLOR'

Andrej730 commented 4 months ago

@loicbramoulle you're using the version from the main branch, use the version from my fork - https://github.com/Andrej730/blender_vertex_color_master/tree/master

loicbramoulle commented 4 months ago

Hum that's what I pasted in the addon folder to replace the main one, but redid it now and the addon loads without error. Just it doesn't pop in the Npanel. image

I guess it wasn't appearing in my addons as it's stored inside a folder, instead of at the root of the zip, but yea strange, still not appearing after a restart ect.. No worries though.

andyp123 commented 4 months ago

Thanks. Sorry I took so long to merge this. I really haven't used Blender in a while. Just looking into what it will take to upgrade it to work properly with 4.2 and get it on the extensions platform at the moment. I think even with this commit it's still pretty broken, but it would be nice to fix it as there are a few people who use it still.

AlexPushilin commented 4 months ago

Hi! The addon is amazing and a lot of people use it, I think. It's been few years of my daily work to rely on it, to be honest. I think you might also consider to maybe put a new version on blender market or something, I'm confident there would be people willing to support your time and effort spent on the addon.

andyp123 commented 4 months ago

Thanks for the kind words! There will always remain a free release on Github, but I may try putting it on Blender Market if you think it's worth it.

I'm making some progress in fixing the addon now, so I think there should be a new release relatively soon. I realise I've said stuff like this in the past, but I'm rewriting a lot of the code to use mesh attributes, which should fix most of the problems and hopefully keep it working for a few more Blender versions.

Out of curiosity, is it OK if I just support Blender 4.2.0 and up? It's an LTS release and seems like a good place to start, but I don't know if people are stuck using older versions of Blender due to pipelines that require specific software versions. Honestly it shouldn't be that hard to support 4.0+ if it's an issue.

Andrej730 commented 4 months ago

Out of curiosity, is it OK if I just support Blender 4.2.0 and up? It's an LTS release and seems like a good place to start, but I don't know if people are stuck using older versions of Blender due to pipelines that require specific software versions. Honestly it shouldn't be that hard to support 4.0+ if it's an issue.

It's probably is a good idea to stick to 4.2+ at this point, extensions will have autoupdates (goodbye to the need to provide zip releases and distribute them manually) and they are about to become the main way to use addons in Blender.

Legacy addons may soon become completely deprectated and if it's just you maintaing the addon in spare time then it's better to focus on what would work for 99% users. Maintaining only the most recent version would make it easier to fix stuff and build new features without worrying that it might broke something 5 Blender versions ago.