andyp123 / blender_vertex_color_master

Blender addon for working more precisely with vertex colours.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update to meet latest Blender Python API standards

andyp123 opened this issue · comments

Since the last version of the addon was released (Oct 2019, when Blender 2.80 was the current Blender version!), there have been a lot of API changes. Not all affect the addon, but several do, so it needs to be updated to meet all the latest standards and ensure that there is less chance of a bug occurring due to outdated API usage.

Here is a rundown of changes that potentially need accounting for:
2.81 - Tooltips can be dynamic. This may be useful for multi-function operators.
2.83 - Versioning in bl_info has changed.
2.90 - Operators NEED to be exposed through menus to appear in the regular search. I have the developer search enabled, so it hasn't affected me, but operator search is a very useful way of finding operators. There are also some UI additions that may be useful.
2.91 - New geometry attributes API, which may be useful for interacting with data
2.93 - GPU module used instead of bgl. Not sure if I'm still using bgl to draw lines etc. but it will need replacing if I am. There's also something about annotations that I'm not sure is relevant or not.
3.0 - Depends on cursor operator option. Probably required if operators need exposing in a menu. UI Data probably not needed, but worth looking at.
3.1 - Slight modification to mesh normal access. Look into how mesh vertex data is stored in general, as it may have had an overhaul.
3.2 - Mesh vertex colours is deprecated. This is huge and the addon will need significant changes to adapt to this (well, unless the data can be accessed in almost the same way). Mesh.attributes seems to be the new place to access the data, with multiple layer types: BYTE_COLOR, FLOAT_COLOR. Also significant is that the colour space of vertex colours has changed from sRGB to scene linear. Not sure what needs to be done regarding the colour space change. More information about the new colour layers/attributes can be found here.

In addition to all these changes, geometry nodes were added around version 3.0, and may enable some other workflows that could be beneficial to users of the addon. Investigate whether or not it is worth adding some built in nodetrees to give users another way to work with channel data.

Hello andyp123!

First of all let me thank you for this addon! Since the vertex color is essential part of my workflow as a game developer, I couldn't work properly without your addon.
Do you have any estimation when can you update the VCM for it could work with the latest Blender version (3,3)? I understand it's a lot of work for you, and thank you again your effort!

Hi, thanks for your comments. I'm always happy to hear from people who are finding a use for the addon.

I was looking at the main issue with isolate mode (#39) last night and am not sure exactly how I can fix. The problem seems like it might be a bug in Blender itself, so I'm going to compare against a previous Blender version and report the issue to Blender if it is. If there is something I can do to resolve the issue in the addon, I will try to do it.

I'm not sure exactly how long it will take to fix the problem. It seems like it should be easy to fix, but if it's something in Blender, there might not be an easy workaround. I'll update the issue (#39) if I find a solution.

Long term, I need to make many updates to the addon to ensure it remains compatible with future releases of Blender, since parts of the API it depends upon have been deprecated and will be removed in favour of a new system in a future release of Blender. From looking last night, it seems that this may not be a major change in terms of how I interact with the data, so it might not be a large problem.

Finally, since the addon is free, I intend at some point to release it on the recently announced Blender Extensions Platform, but this will not be for a while yet.

Looks like I have until Blender 4.0 to switch from vertex_colors to color_attributes
https://developer.blender.org/T100153

it would be great if they could decide finally how they want to handle this whole vertex color thing. It's very hard to planning the workflow for a 3-4 years project if they changing such an important game-dev related attribute in every bigger release. :(
Thank you for the update!

The new system is actually already in Blender 3.2+, but don't worry, as it's compatible with what was there before. However, it does seem that some bugs got introduced. I think they were basically changing how all vertex data is dealt with in Blender in order to make it more generic, which will allow cool things to be done to that data with geometry nodes etc.

commented

Any progress on this?

@andyp123 let me know if u need help with some of these. If you made new branch if could probably create some PR for it. I think moving to support new color attribs should be easy enough. There should not be much of blg code to move to gpu (only line and circle gradient are using some openGl 3d view drawing - right/)

Sorry for being so shit with support on this addon. I keep thinking about coming back and fixing it and just never getting around to it.
@JoseConseco Thanks for the offer. I'd like to attempt to rewrite the addon to work with 3.6 and 4.0 in the near future. I'll let you know if I need help.

Thank you for this addon, we use it nearly every day at my work <3