Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/uvedit/uvedit_unwrap_ops.c
| Show First 20 Lines • Show All 2,011 Lines • ▼ Show 20 Lines | static int smart_project_exec(bContext *C, wmOperator *op) | ||||
| const float project_angle_limit_cos = cosf(project_angle_limit); | const float project_angle_limit_cos = cosf(project_angle_limit); | ||||
| const float project_angle_limit_half_cos = cosf(project_angle_limit / 2); | const float project_angle_limit_half_cos = cosf(project_angle_limit / 2); | ||||
| /* Memory arena for list links (cleared for each object). */ | /* Memory arena for list links (cleared for each object). */ | ||||
| MemArena *arena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, __func__); | MemArena *arena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, __func__); | ||||
| uint objects_len = 0; | uint objects_len = 0; | ||||
| Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs( | Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data( | ||||
| view_layer, v3d, &objects_len); | view_layer, v3d, &objects_len); | ||||
| Object **objects_changed = MEM_mallocN(sizeof(*objects_changed) * objects_len, __func__); | Object **objects_changed = MEM_mallocN(sizeof(*objects_changed) * objects_len, __func__); | ||||
| uint object_changed_len = 0; | uint object_changed_len = 0; | ||||
| BMFace *efa; | BMFace *efa; | ||||
| BMIter iter; | BMIter iter; | ||||
| uint ob_index; | uint ob_index; | ||||
| for (ob_index = 0; ob_index < objects_len; ob_index++) { | for (ob_index = 0; ob_index < objects_len; ob_index++) { | ||||
| Object *obedit = objects[ob_index]; | Object *obedit = objects[ob_index]; | ||||
| BMEditMesh *em = BKE_editmesh_from_object(obedit); | BMEditMesh *em = BKE_editmesh_from_object(obedit); | ||||
| bool changed = false; | bool changed = false; | ||||
| if (!ED_uvedit_ensure_uvs(obedit)) { | |||||
| continue; | |||||
| } | |||||
| const uint cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV); | const uint cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV); | ||||
| ThickFace *thick_faces = MEM_mallocN(sizeof(*thick_faces) * em->bm->totface, __func__); | ThickFace *thick_faces = MEM_mallocN(sizeof(*thick_faces) * em->bm->totface, __func__); | ||||
| uint thick_faces_len = 0; | uint thick_faces_len = 0; | ||||
| BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { | BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { | ||||
| if (!BM_elem_flag_test(efa, BM_ELEM_SELECT)) { | if (!BM_elem_flag_test(efa, BM_ELEM_SELECT)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 815 Lines • Show Last 20 Lines | |||||