Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/subdiv_converter_mesh.c
| Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | |||||
| static int get_num_uv_layers(const OpenSubdiv_Converter *converter) | static int get_num_uv_layers(const OpenSubdiv_Converter *converter) | ||||
| { | { | ||||
| ConverterStorage *storage = converter->user_data; | ConverterStorage *storage = converter->user_data; | ||||
| const Mesh *mesh = storage->mesh; | const Mesh *mesh = storage->mesh; | ||||
| return CustomData_number_of_layers(&mesh->ldata, CD_MLOOPUV); | return CustomData_number_of_layers(&mesh->ldata, CD_MLOOPUV); | ||||
| } | } | ||||
| static int get_num_extra_vertex_data(const OpenSubdiv_Converter *converter) | |||||
| { | |||||
| ConverterStorage *storage = converter->user_data; | |||||
| const Mesh *mesh = storage->mesh; | |||||
| int num_vertex_data = 0; | |||||
| num_vertex_data += CustomData_has_layer(&mesh->vdata, CD_ORCO) ? 3 : 0; | |||||
| num_vertex_data += CustomData_has_layer(&mesh->vdata, CD_CLOTH_ORCO) ? 3 : 0; | |||||
| return num_vertex_data; | |||||
| } | |||||
| static void precalc_uv_layer(const OpenSubdiv_Converter *converter, const int layer_index) | static void precalc_uv_layer(const OpenSubdiv_Converter *converter, const int layer_index) | ||||
| { | { | ||||
| ConverterStorage *storage = converter->user_data; | ConverterStorage *storage = converter->user_data; | ||||
| const Mesh *mesh = storage->mesh; | const Mesh *mesh = storage->mesh; | ||||
| const MPoly *mpoly = mesh->mpoly; | const MPoly *mpoly = mesh->mpoly; | ||||
| const MLoop *mloop = mesh->mloop; | const MLoop *mloop = mesh->mloop; | ||||
| const MLoopUV *mloopuv = CustomData_get_layer_n(&mesh->ldata, CD_MLOOPUV, layer_index); | const MLoopUV *mloopuv = CustomData_get_layer_n(&mesh->ldata, CD_MLOOPUV, layer_index); | ||||
| const int num_poly = mesh->totpoly; | const int num_poly = mesh->totpoly; | ||||
| ▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | static void init_functions(OpenSubdiv_Converter *converter) | ||||
| converter->isInfiniteSharpVertex = is_infinite_sharp_vertex; | converter->isInfiniteSharpVertex = is_infinite_sharp_vertex; | ||||
| converter->getVertexSharpness = get_vertex_sharpness; | converter->getVertexSharpness = get_vertex_sharpness; | ||||
| converter->getNumUVLayers = get_num_uv_layers; | converter->getNumUVLayers = get_num_uv_layers; | ||||
| converter->precalcUVLayer = precalc_uv_layer; | converter->precalcUVLayer = precalc_uv_layer; | ||||
| converter->finishUVLayer = finish_uv_layer; | converter->finishUVLayer = finish_uv_layer; | ||||
| converter->getNumUVCoordinates = get_num_uvs; | converter->getNumUVCoordinates = get_num_uvs; | ||||
| converter->getFaceCornerUVIndex = get_face_corner_uv_index; | converter->getFaceCornerUVIndex = get_face_corner_uv_index; | ||||
| converter->getNumExtraVertexData = get_num_extra_vertex_data; | |||||
| converter->freeUserData = free_user_data; | converter->freeUserData = free_user_data; | ||||
| } | } | ||||
| static void initialize_manifold_index_array(const BLI_bitmap *used_map, | static void initialize_manifold_index_array(const BLI_bitmap *used_map, | ||||
| const int num_elements, | const int num_elements, | ||||
| int **r_indices, | int **r_indices, | ||||
| int **r_indices_reverse, | int **r_indices_reverse, | ||||
| ▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines | |||||