Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/geometry_component_mesh.cc
| Show First 20 Lines • Show All 779 Lines • ▼ Show 20 Lines | static float2 get_loop_uv(const MLoopUV &uv) | ||||
| return float2(uv.uv); | return float2(uv.uv); | ||||
| } | } | ||||
| static void set_loop_uv(MLoopUV &uv, float2 co) | static void set_loop_uv(MLoopUV &uv, float2 co) | ||||
| { | { | ||||
| copy_v2_v2(uv.uv, co); | copy_v2_v2(uv.uv, co); | ||||
| } | } | ||||
| static Color4f get_loop_color(const MLoopCol &col) | static ColorGeometry4f get_loop_color(const MLoopCol &col) | ||||
jbakker: This function needs to be rewritten | |||||
Done Inline ActionsFixme! jbakker: Fixme! | |||||
| { | { | ||||
| Color4f srgb_color; | ColorGeometry4b encoded_color = ColorGeometry4b(col.r, col.g, col.b, col.a); | ||||
| rgba_uchar_to_float(srgb_color, &col.r); | ColorGeometry4f linear_color = encoded_color.to_byte_decoded(); | ||||
Done Inline ActionsSomehow I find the name to_byte_decoded confusing. Maybe it should be decode_bytes or to_float_encoded or something like that? JacquesLucke: Somehow I find the name `to_byte_decoded` confusing. Maybe it should be `decode_bytes` or… | |||||
Done Inline ActionsI change it to encode/decode. jbakker: I change it to `encode`/`decode`. | |||||
| Color4f linear_color; | |||||
| srgb_to_linearrgb_v4(linear_color, srgb_color); | |||||
| return linear_color; | return linear_color; | ||||
| } | } | ||||
| static void set_loop_color(MLoopCol &col, Color4f linear_color) | static void set_loop_color(MLoopCol &col, ColorGeometry4f linear_color) | ||||
| { | { | ||||
| linearrgb_to_srgb_uchar4(&col.r, linear_color); | ColorGeometry4b encoded_color = linear_color.to_byte_encoded(); | ||||
| col.r = encoded_color.r; | |||||
| col.g = encoded_color.g; | |||||
| col.b = encoded_color.b; | |||||
| col.a = encoded_color.a; | |||||
Done Inline ActionsFunction needs to be rewritten. jbakker: Function needs to be rewritten. | |||||
Done Inline ActionsFixme! jbakker: Fixme! | |||||
| } | } | ||||
| static float get_crease(const MEdge &edge) | static float get_crease(const MEdge &edge) | ||||
| { | { | ||||
| return edge.crease / 255.0f; | return edge.crease / 255.0f; | ||||
| } | } | ||||
| static void set_crease(MEdge &edge, float value) | static void set_crease(MEdge &edge, float value) | ||||
| ▲ Show 20 Lines • Show All 320 Lines • ▼ Show 20 Lines | static NamedLegacyCustomDataProvider uvs( | ||||
| make_derived_read_attribute<MLoopUV, float2, get_loop_uv>, | make_derived_read_attribute<MLoopUV, float2, get_loop_uv>, | ||||
| make_derived_write_attribute<MLoopUV, float2, get_loop_uv, set_loop_uv>); | make_derived_write_attribute<MLoopUV, float2, get_loop_uv, set_loop_uv>); | ||||
| static NamedLegacyCustomDataProvider vertex_colors( | static NamedLegacyCustomDataProvider vertex_colors( | ||||
| ATTR_DOMAIN_CORNER, | ATTR_DOMAIN_CORNER, | ||||
| CD_PROP_COLOR, | CD_PROP_COLOR, | ||||
| CD_MLOOPCOL, | CD_MLOOPCOL, | ||||
| corner_access, | corner_access, | ||||
| make_derived_read_attribute<MLoopCol, Color4f, get_loop_color>, | make_derived_read_attribute<MLoopCol, ColorGeometry4f, get_loop_color>, | ||||
| make_derived_write_attribute<MLoopCol, Color4f, get_loop_color, set_loop_color>); | make_derived_write_attribute<MLoopCol, ColorGeometry4f, get_loop_color, set_loop_color>); | ||||
| static VertexGroupsAttributeProvider vertex_groups; | static VertexGroupsAttributeProvider vertex_groups; | ||||
| static CustomDataAttributeProvider corner_custom_data(ATTR_DOMAIN_CORNER, corner_access); | static CustomDataAttributeProvider corner_custom_data(ATTR_DOMAIN_CORNER, corner_access); | ||||
| static CustomDataAttributeProvider point_custom_data(ATTR_DOMAIN_POINT, point_access); | static CustomDataAttributeProvider point_custom_data(ATTR_DOMAIN_POINT, point_access); | ||||
| static CustomDataAttributeProvider edge_custom_data(ATTR_DOMAIN_EDGE, edge_access); | static CustomDataAttributeProvider edge_custom_data(ATTR_DOMAIN_EDGE, edge_access); | ||||
| static CustomDataAttributeProvider face_custom_data(ATTR_DOMAIN_FACE, face_access); | static CustomDataAttributeProvider face_custom_data(ATTR_DOMAIN_FACE, face_access); | ||||
| return ComponentAttributeProviders({&position, &material_index, &shade_smooth, &normal, &crease}, | return ComponentAttributeProviders({&position, &material_index, &shade_smooth, &normal, &crease}, | ||||
| Show All 19 Lines | |||||
This function needs to be rewritten