Page MenuHome

Python API issue: attributes.active_color vs vertex_colors.active
Closed, ResolvedPublic

Description

Blender Version
Broken: version: 3.3.0 Alpha, branch: master, commit date: 2022-05-19 10:04, hash: rB4fc96e5000ce
Worked: n/a

Short description of error
The values I get from vertex_colors.active is different than from attributes.active_color.

Exact steps for others to reproduce the error
Open and run the Python script there (see the results in the console):

Note: This mesh above is part of the cloth brush icon from the icons_geom.blend.

But I can also reproduce it with from scratch by painting a plane with some non-white colors like this:

Event Timeline

Dalai Felinto (dfelinto) changed the task status from Needs Triage to Confirmed.May 19 2022, 7:32 PM
Dalai Felinto (dfelinto) created this task.

Setting status to confirmed, but not setting as a bug yet. Waiting for Hans to confirm it.

This was an intentional design choice. For attributes I wanted to have all color values in the same linear color space in the API and UI, regardless if they are stored as byte or float. That way the values match in color pickers, spreadsheet, shader nodes, geometry nodes.

It's also just the general convention for any colors in scene data to be linear, with the old vertex colors as perhaps the last exception.

I talked to @Brecht Van Lommel (brecht) and it seems that this is intentional. I think we should mention this in the release notes of whenever we introduced this (with an example of how to convert the values from one to the other?). I couldn't find it in any of the 3.x release notes so far.

I've updated the release notes now. In order to conveniently convert to/from sRGB we need some API functions, for which I added a patch.