Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/geometry_component_mesh.cc
| Show First 20 Lines • Show All 806 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, const float2 &co) | static void set_loop_uv(MLoopUV &uv, const float2 &co) | ||||
| { | { | ||||
| copy_v2_v2(uv.uv, co); | copy_v2_v2(uv.uv, co); | ||||
| } | } | ||||
| static Color4f get_loop_color(const MLoopCol &col) | static ColorGeometry get_loop_color(const MLoopCol &col) | ||||
jbakker: This function needs to be rewritten | |||||
jbakkerAuthorUnsubmitted Done Inline ActionsFixme! jbakker: Fixme! | |||||
| { | { | ||||
| Color4f srgb_color; | ColorGeometry srgb_color; | ||||
| rgba_uchar_to_float(srgb_color, &col.r); | rgba_uchar_to_float(srgb_color, &col.r); | ||||
| Color4f linear_color; | ColorGeometry linear_color; | ||||
| srgb_to_linearrgb_v4(linear_color, srgb_color); | srgb_to_linearrgb_v4(linear_color, srgb_color); | ||||
| return linear_color; | return linear_color; | ||||
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`. | |||||
| } | } | ||||
| static void set_loop_color(MLoopCol &col, const Color4f &linear_color) | static void set_loop_color(MLoopCol &col, const ColorGeometry &linear_color) | ||||
| { | { | ||||
| linearrgb_to_srgb_uchar4(&col.r, linear_color); | linearrgb_to_srgb_uchar4(&col.r, linear_color); | ||||
jbakkerAuthorUnsubmitted Done Inline ActionsFunction needs to be rewritten. jbakker: Function needs to be rewritten. | |||||
jbakkerAuthorUnsubmitted 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, const float &value) | static void set_crease(MEdge &edge, const float &value) | ||||
| ▲ Show 20 Lines • Show All 335 Lines • ▼ Show 20 Lines | static NamedLegacyCustomDataProvider uvs( | ||||
| make_derived_read_attribute<MLoopUV, float2, get_loop_uv, ATTR_DOMAIN_CORNER>, | make_derived_read_attribute<MLoopUV, float2, get_loop_uv, ATTR_DOMAIN_CORNER>, | ||||
| make_derived_write_attribute<MLoopUV, float2, get_loop_uv, set_loop_uv, ATTR_DOMAIN_CORNER>); | make_derived_write_attribute<MLoopUV, float2, get_loop_uv, set_loop_uv, ATTR_DOMAIN_CORNER>); | ||||
| 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, ATTR_DOMAIN_CORNER>, | make_derived_read_attribute<MLoopCol, ColorGeometry, get_loop_color, ATTR_DOMAIN_CORNER>, | ||||
| make_derived_write_attribute<MLoopCol, | make_derived_write_attribute<MLoopCol, | ||||
| Color4f, | ColorGeometry, | ||||
| get_loop_color, | get_loop_color, | ||||
| set_loop_color, | set_loop_color, | ||||
| ATTR_DOMAIN_CORNER>); | ATTR_DOMAIN_CORNER>); | ||||
| 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); | ||||
| Show All 22 Lines | |||||
This function needs to be rewritten