Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/uvedit/uvedit_smart_stitch.c
| Show First 20 Lines • Show All 1,922 Lines • ▼ Show 20 Lines | static StitchState *stitch_init(bContext *C, | ||||
| const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV); | const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV); | ||||
| state = MEM_callocN(sizeof(StitchState), "stitch state obj"); | state = MEM_callocN(sizeof(StitchState), "stitch state obj"); | ||||
| /* initialize state */ | /* initialize state */ | ||||
| state->obedit = obedit; | state->obedit = obedit; | ||||
| state->em = em; | state->em = em; | ||||
| /* Workaround for sync-select & face-select mode which implies all selected faces are detached, | |||||
| * for stitch this isn't useful behavior, see T86924. */ | |||||
| const int selectmode_orig = scene->toolsettings->selectmode; | |||||
| scene->toolsettings->selectmode = SCE_SELECT_VERTEX; | |||||
| /* in uv synch selection, all uv's are visible */ | /* in uv synch selection, all uv's are visible */ | ||||
| if (ts->uv_flag & UV_SYNC_SELECTION) { | if (ts->uv_flag & UV_SYNC_SELECTION) { | ||||
| state->element_map = BM_uv_element_map_create(state->em->bm, scene, false, false, true, true); | state->element_map = BM_uv_element_map_create(state->em->bm, scene, false, false, true, true); | ||||
| } | } | ||||
| else { | else { | ||||
| state->element_map = BM_uv_element_map_create(state->em->bm, scene, true, false, true, true); | state->element_map = BM_uv_element_map_create(state->em->bm, scene, true, false, true, true); | ||||
| } | } | ||||
| scene->toolsettings->selectmode = selectmode_orig; | |||||
| if (!state->element_map) { | if (!state->element_map) { | ||||
| state_delete(state); | state_delete(state); | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| ED_uvedit_get_aspect(obedit, &aspx, &aspy); | ED_uvedit_get_aspect(obedit, &aspx, &aspy); | ||||
| state->aspect = aspx / aspy; | state->aspect = aspx / aspy; | ||||
| ▲ Show 20 Lines • Show All 902 Lines • Show Last 20 Lines | |||||