Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/subdiv_mesh.c
| Show All 26 Lines | |||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_meshdata_types.h" | #include "DNA_meshdata_types.h" | ||||
| #include "DNA_key_types.h" | #include "DNA_key_types.h" | ||||
| #include "BLI_alloca.h" | #include "BLI_alloca.h" | ||||
| #include "BLI_math_vector.h" | #include "BLI_math_vector.h" | ||||
| #include "BKE_customdata.h" | |||||
| #include "BKE_mesh.h" | #include "BKE_mesh.h" | ||||
| #include "BKE_key.h" | #include "BKE_key.h" | ||||
| #include "BKE_subdiv.h" | #include "BKE_subdiv.h" | ||||
| #include "BKE_subdiv_eval.h" | #include "BKE_subdiv_eval.h" | ||||
| #include "BKE_subdiv_foreach.h" | #include "BKE_subdiv_foreach.h" | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| ▲ Show 20 Lines • Show All 176 Lines • ▼ Show 20 Lines | if (coarse_poly->totloop == 4) { | ||||
| vertex_interpolation->vertex_data_storage_allocated = false; | vertex_interpolation->vertex_data_storage_allocated = false; | ||||
| } | } | ||||
| else { | else { | ||||
| vertex_interpolation->vertex_data = | vertex_interpolation->vertex_data = | ||||
| &vertex_interpolation->vertex_data_storage; | &vertex_interpolation->vertex_data_storage; | ||||
| /* Allocate storage for loops corresponding to ptex corners. */ | /* Allocate storage for loops corresponding to ptex corners. */ | ||||
| CustomData_copy(&ctx->coarse_mesh->vdata, | CustomData_copy(&ctx->coarse_mesh->vdata, | ||||
| &vertex_interpolation->vertex_data_storage, | &vertex_interpolation->vertex_data_storage, | ||||
| CD_MASK_EVERYTHING, | CD_MASK_EVERYTHING.vmask, | ||||
| CD_CALLOC, | CD_CALLOC, | ||||
| 4); | 4); | ||||
| /* Initialize indices. */ | /* Initialize indices. */ | ||||
| vertex_interpolation->vertex_indices[0] = 0; | vertex_interpolation->vertex_indices[0] = 0; | ||||
| vertex_interpolation->vertex_indices[1] = 1; | vertex_interpolation->vertex_indices[1] = 1; | ||||
| vertex_interpolation->vertex_indices[2] = 2; | vertex_interpolation->vertex_indices[2] = 2; | ||||
| vertex_interpolation->vertex_indices[3] = 3; | vertex_interpolation->vertex_indices[3] = 3; | ||||
| vertex_interpolation->vertex_data_storage_allocated = true; | vertex_interpolation->vertex_data_storage_allocated = true; | ||||
| ▲ Show 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | if (coarse_poly->totloop == 4) { | ||||
| loop_interpolation->loop_indices[3] = coarse_poly->loopstart + 3; | loop_interpolation->loop_indices[3] = coarse_poly->loopstart + 3; | ||||
| loop_interpolation->loop_data_storage_allocated = false; | loop_interpolation->loop_data_storage_allocated = false; | ||||
| } | } | ||||
| else { | else { | ||||
| loop_interpolation->loop_data = &loop_interpolation->loop_data_storage; | loop_interpolation->loop_data = &loop_interpolation->loop_data_storage; | ||||
| /* Allocate storage for loops corresponding to ptex corners. */ | /* Allocate storage for loops corresponding to ptex corners. */ | ||||
| CustomData_copy(&ctx->coarse_mesh->ldata, | CustomData_copy(&ctx->coarse_mesh->ldata, | ||||
| &loop_interpolation->loop_data_storage, | &loop_interpolation->loop_data_storage, | ||||
| CD_MASK_EVERYTHING, | CD_MASK_EVERYTHING.lmask, | ||||
| CD_CALLOC, | CD_CALLOC, | ||||
| 4); | 4); | ||||
| /* Initialize indices. */ | /* Initialize indices. */ | ||||
| loop_interpolation->loop_indices[0] = 0; | loop_interpolation->loop_indices[0] = 0; | ||||
| loop_interpolation->loop_indices[1] = 1; | loop_interpolation->loop_indices[1] = 1; | ||||
| loop_interpolation->loop_indices[2] = 2; | loop_interpolation->loop_indices[2] = 2; | ||||
| loop_interpolation->loop_indices[3] = 3; | loop_interpolation->loop_indices[3] = 3; | ||||
| loop_interpolation->loop_data_storage_allocated = true; | loop_interpolation->loop_data_storage_allocated = true; | ||||
| ▲ Show 20 Lines • Show All 894 Lines • Show Last 20 Lines | |||||