Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2022-04-21 17:11:26 +0300
committerJacques Lucke <jacques@blender.org>2022-04-21 17:11:26 +0300
commitb9799dfb8a78dddbb3591dcb3e0b4de954c80fee (patch)
tree531a96e1ff7774b07ae1c91a4242c86d7d7f156e /source/blender/blenkernel/intern/geometry_component_mesh.cc
parentaca083fbf38246437caa6e50a6feeeb23b64ee18 (diff)
Geometry Nodes: better support for byte color attributes
Since {rBeae36be372a6b16ee3e76eff0485a47da4f3c230} the distinction between float and byte colors is more explicit in the ui. So far, geometry nodes couldn't really deal with byte colors in general. This patch fixes that. There is still only one color socket, which contains float colors. Conversion to and from byte colors is done when read from or writing to attributes. * Support writing to byte color attributes in Store Named Attribute node. * Support converting to/from byte color in attribute conversion operator. * Support propagating byte color attributes. * Add all the implicit conversions from byte colors to the other types. * Display byte colors as integers in spreadsheet. Differential Revision: https://developer.blender.org/D14705
Diffstat (limited to 'source/blender/blenkernel/intern/geometry_component_mesh.cc')
-rw-r--r--source/blender/blenkernel/intern/geometry_component_mesh.cc25
1 files changed, 0 insertions, 25 deletions
diff --git a/source/blender/blenkernel/intern/geometry_component_mesh.cc b/source/blender/blenkernel/intern/geometry_component_mesh.cc
index 597e4efe284..fb39861d3e7 100644
--- a/source/blender/blenkernel/intern/geometry_component_mesh.cc
+++ b/source/blender/blenkernel/intern/geometry_component_mesh.cc
@@ -903,22 +903,6 @@ static void set_loop_uv(MLoopUV &uv, float2 co)
copy_v2_v2(uv.uv, co);
}
-static ColorGeometry4f get_loop_color(const MLoopCol &col)
-{
- ColorGeometry4b encoded_color = ColorGeometry4b(col.r, col.g, col.b, col.a);
- ColorGeometry4f linear_color = encoded_color.decode();
- return linear_color;
-}
-
-static void set_loop_color(MLoopCol &col, ColorGeometry4f linear_color)
-{
- ColorGeometry4b encoded_color = linear_color.encode();
- col.r = encoded_color.r;
- col.g = encoded_color.g;
- col.b = encoded_color.b;
- col.a = encoded_color.a;
-}
-
static float get_crease(const MEdge &edge)
{
return edge.crease / 255.0f;
@@ -1293,14 +1277,6 @@ static ComponentAttributeProviders create_attribute_providers_for_mesh()
make_derived_read_attribute<MLoopUV, float2, get_loop_uv>,
make_derived_write_attribute<MLoopUV, float2, get_loop_uv, set_loop_uv>);
- static NamedLegacyCustomDataProvider vertex_colors(
- ATTR_DOMAIN_CORNER,
- CD_PROP_COLOR,
- CD_PROP_BYTE_COLOR,
- corner_access,
- make_derived_read_attribute<MLoopCol, ColorGeometry4f, get_loop_color>,
- make_derived_write_attribute<MLoopCol, ColorGeometry4f, get_loop_color, set_loop_color>);
-
static VertexGroupsAttributeProvider vertex_groups;
static CustomDataAttributeProvider corner_custom_data(ATTR_DOMAIN_CORNER, corner_access);
static CustomDataAttributeProvider point_custom_data(ATTR_DOMAIN_POINT, point_access);
@@ -1310,7 +1286,6 @@ static ComponentAttributeProviders create_attribute_providers_for_mesh()
return ComponentAttributeProviders(
{&position, &id, &material_index, &shade_smooth, &normal, &crease},
{&uvs,
- &vertex_colors,
&corner_custom_data,
&vertex_groups,
&point_custom_data,