Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/subdiv_converter_mesh.c
| Show First 20 Lines • Show All 187 Lines • ▼ Show 20 Lines | static float get_vertex_sharpness(const OpenSubdiv_Converter *converter, int manifold_vertex_index) | ||||
| const int vertex_index = storage->manifold_vertex_index_reverse[manifold_vertex_index]; | const int vertex_index = storage->manifold_vertex_index_reverse[manifold_vertex_index]; | ||||
| return BKE_subdiv_crease_to_sharpness_f(storage->cd_vertex_crease[vertex_index]); | return BKE_subdiv_crease_to_sharpness_f(storage->cd_vertex_crease[vertex_index]); | ||||
| } | } | ||||
| 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_PROP_FLOAT2); | ||||
| } | } | ||||
| 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 MLoopUV *mloopuv = CustomData_get_layer_n(&mesh->ldata, CD_MLOOPUV, layer_index); | const float(*mloopuv)[2] = CustomData_get_layer_n(&mesh->ldata, CD_PROP_FLOAT2, layer_index); | ||||
| const int num_poly = mesh->totpoly; | const int num_poly = mesh->totpoly; | ||||
| const int num_vert = mesh->totvert; | const int num_vert = mesh->totvert; | ||||
| const float limit[2] = {STD_UV_CONNECT_LIMIT, STD_UV_CONNECT_LIMIT}; | const float limit[2] = {STD_UV_CONNECT_LIMIT, STD_UV_CONNECT_LIMIT}; | ||||
| /* Initialize memory required for the operations. */ | /* Initialize memory required for the operations. */ | ||||
| if (storage->loop_uv_indices == NULL) { | if (storage->loop_uv_indices == NULL) { | ||||
| storage->loop_uv_indices = MEM_malloc_arrayN( | storage->loop_uv_indices = MEM_malloc_arrayN( | ||||
| mesh->totloop, sizeof(int), "loop uv vertex index"); | mesh->totloop, sizeof(int), "loop uv vertex index"); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 204 Lines • Show Last 20 Lines | |||||