|
Blender V4.5
|
#include "DNA_customdata_types.h"#include "BLI_math_vector_types.hh"#include "BLI_offset_indices.hh"#include "BLI_sys_types.h"Go to the source code of this file.
Macros | |
| #define | DM_TANGENT_MASK_ORCO (1 << 9) |
Functions | |
| void | BKE_mesh_calc_loop_tangent_single_ex (const float(*vert_positions)[3], int numVerts, const int *corner_verts, float(*r_looptangent)[4], const float(*corner_normals)[3], const float(*loop_uvs)[2], int numLoops, blender::OffsetIndices< int > faces, ReportList *reports) |
| void | BKE_mesh_calc_loop_tangent_single (Mesh *mesh, const char *uvmap, float(*r_looptangents)[4], ReportList *reports) |
| void | BKE_mesh_calc_loop_tangent_ex (blender::Span< blender::float3 > vert_positions, blender::OffsetIndices< int > faces, blender::Span< int > corner_verts, blender::Span< blender::int3 > corner_tris, blender::Span< int > corner_tri_faces, blender::Span< bool > sharp_faces, const CustomData *loopdata, bool calc_active_tangent, const char(*tangent_names)[MAX_CUSTOMDATA_LAYER_NAME], int tangent_names_len, blender::Span< blender::float3 > vert_normals, blender::Span< blender::float3 > face_normals, blender::Span< blender::float3 > corner_normals, blender::Span< blender::float3 > vert_orco, CustomData *loopdata_out, uint loopdata_out_len, short *tangent_mask_curr_p) |
| void | BKE_mesh_calc_loop_tangents (Mesh *mesh_eval, bool calc_active_tangent, const char(*tangent_names)[MAX_CUSTOMDATA_LAYER_NAME], int tangent_names_len) |
| void | BKE_mesh_add_loop_tangent_named_layer_for_uv (const CustomData *uv_data, CustomData *tan_data, int numLoopData, const char *layer_name) |
| void | BKE_mesh_calc_loop_tangent_step_0 (const CustomData *loopData, bool calc_active_tangent, const char(*tangent_names)[MAX_CUSTOMDATA_LAYER_NAME], int tangent_names_count, bool *rcalc_act, bool *rcalc_ren, int *ract_uv_n, int *rren_uv_n, char *ract_uv_name, char *rren_uv_name, short *rtangent_mask) |
| #define DM_TANGENT_MASK_ORCO (1 << 9) |
Definition at line 80 of file BKE_mesh_tangent.hh.
Referenced by BKE_editmesh_loop_tangent_calc(), BKE_mesh_calc_loop_tangent_ex(), and BKE_mesh_calc_loop_tangent_step_0().
| void BKE_mesh_add_loop_tangent_named_layer_for_uv | ( | const CustomData * | uv_data, |
| CustomData * | tan_data, | ||
| int | numLoopData, | ||
| const char * | layer_name ) |
Definition at line 314 of file mesh_tangent.cc.
References CD_PROP_FLOAT2, CD_SET_DEFAULT, CD_TANGENT, CustomData_add_layer_named(), and CustomData_get_named_layer_index().
Referenced by BKE_editmesh_loop_tangent_calc(), and BKE_mesh_calc_loop_tangent_ex().
| void BKE_mesh_calc_loop_tangent_ex | ( | blender::Span< blender::float3 > | vert_positions, |
| blender::OffsetIndices< int > | faces, | ||
| blender::Span< int > | corner_verts, | ||
| blender::Span< blender::int3 > | corner_tris, | ||
| blender::Span< int > | corner_tri_faces, | ||
| blender::Span< bool > | sharp_faces, | ||
| const CustomData * | loopdata, | ||
| bool | calc_active_tangent, | ||
| const char(*) | tangent_names[MAX_CUSTOMDATA_LAYER_NAME], | ||
| int | tangent_names_len, | ||
| blender::Span< blender::float3 > | vert_normals, | ||
| blender::Span< blender::float3 > | face_normals, | ||
| blender::Span< blender::float3 > | corner_normals, | ||
| blender::Span< blender::float3 > | vert_orco, | ||
| CustomData * | loopdata_out, | ||
| uint | loopdata_out_len, | ||
| short * | tangent_mask_curr_p ) |
See: BKE_editmesh_loop_tangent_calc (matching logic).
References faces, and MAX_CUSTOMDATA_LAYER_NAME.
Referenced by do_multires_bake(), and blender::draw::extract_tan_init_common().
| void BKE_mesh_calc_loop_tangent_single | ( | Mesh * | mesh, |
| const char * | uvmap, | ||
| float(*) | r_looptangents[4], | ||
| ReportList * | reports ) |
Wrapper around BKE_mesh_calc_loop_tangent_single_ex, which takes care of most boilerplate code.
Definition at line 116 of file mesh_tangent.cc.
References BKE_mesh_calc_loop_tangent_single_ex(), BKE_reportf(), CD_PROP_FLOAT2, blender::bke::Corner, CustomData_get_active_layer_name(), blender::Span< T >::data(), blender::Span< T >::is_empty(), blender::bke::AttributeAccessor::lookup(), reports, and RPT_ERROR.
| void BKE_mesh_calc_loop_tangent_single_ex | ( | const float(*) | vert_positions[3], |
| int | numVerts, | ||
| const int * | corner_verts, | ||
| float(*) | r_looptangent[4], | ||
| const float(*) | corner_normals[3], | ||
| const float(*) | loop_uvs[2], | ||
| int | numLoops, | ||
| blender::OffsetIndices< int > | faces, | ||
| ReportList * | reports ) |
| void BKE_mesh_calc_loop_tangent_step_0 | ( | const CustomData * | loopData, |
| bool | calc_active_tangent, | ||
| const char(*) | tangent_names[MAX_CUSTOMDATA_LAYER_NAME], | ||
| int | tangent_names_count, | ||
| bool * | rcalc_act, | ||
| bool * | rcalc_ren, | ||
| int * | ract_uv_n, | ||
| int * | rren_uv_n, | ||
| char * | ract_uv_name, | ||
| char * | rren_uv_name, | ||
| short * | rtangent_mask ) |
Here we get some useful information such as active uv layer name and search if it is already in tangent_names. Also, we calculate tangent_mask that works as a descriptor of tangents state. If tangent_mask has changed, then recalculate tangents.
Definition at line 326 of file mesh_tangent.cc.
References add(), BLI_strncpy(), CD_PROP_FLOAT2, CustomData_get_active_layer(), CustomData_get_layer_index(), CustomData_get_layer_name(), CustomData_get_render_layer(), CustomData_number_of_layers(), DM_TANGENT_MASK_ORCO, i, CustomData::layers, MAX_CUSTOMDATA_LAYER_NAME, CustomDataLayer::name, and STREQ.
Referenced by BKE_editmesh_loop_tangent_calc(), and BKE_mesh_calc_loop_tangent_ex().
| void BKE_mesh_calc_loop_tangents | ( | Mesh * | mesh_eval, |
| bool | calc_active_tangent, | ||
| const char(*) | tangent_names[MAX_CUSTOMDATA_LAYER_NAME], | ||
| int | tangent_names_len ) |
Definition at line 580 of file mesh_tangent.cc.
References Geometry::attributes, BKE_mesh_calc_loop_tangent_ex(), CD_ORCO, Mesh::corner_data, Mesh::corners_num, CustomData_get_layer(), blender::bke::Face, blender::bke::AttributeAccessor::lookup(), MAX_CUSTOMDATA_LAYER_NAME, Mesh::vert_data, and Mesh::verts_num.
Referenced by mesh_calc_tri_tessface().