Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_convert_mesh_uv.c
| Show First 20 Lines • Show All 228 Lines • ▼ Show 20 Lines | |||||
| #endif | #endif | ||||
| BLI_LINKSTACK_FREE(queue); | BLI_LINKSTACK_FREE(queue); | ||||
| BLI_LINKSTACK_FREE(queue_next); | BLI_LINKSTACK_FREE(queue_next); | ||||
| MEM_freeN(dists_prev); | MEM_freeN(dists_prev); | ||||
| } | } | ||||
| void createTransUVs(bContext *C, TransInfo *t) | static void createTransUVs(bContext *C, TransInfo *t) | ||||
| { | { | ||||
| SpaceImage *sima = CTX_wm_space_image(C); | SpaceImage *sima = CTX_wm_space_image(C); | ||||
| Scene *scene = t->scene; | Scene *scene = t->scene; | ||||
| const bool is_prop_edit = (t->flag & T_PROP_EDIT) != 0; | const bool is_prop_edit = (t->flag & T_PROP_EDIT) != 0; | ||||
| const bool is_prop_connected = (t->flag & T_PROP_CONNECTED) != 0; | const bool is_prop_connected = (t->flag & T_PROP_CONNECTED) != 0; | ||||
| const bool is_island_center = (t->around == V3D_AROUND_LOCAL_ORIGINS); | const bool is_island_center = (t->around == V3D_AROUND_LOCAL_ORIGINS); | ||||
| ▲ Show 20 Lines • Show All 195 Lines • ▼ Show 20 Lines | for (a = 0, td = tc->data_2d; a < tc->data_len; a++, td++) { | ||||
| td->loc2d[0] /= size[0]; | td->loc2d[0] /= size[0]; | ||||
| td->loc2d[1] /= size[1]; | td->loc2d[1] /= size[1]; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void recalcData_uv(TransInfo *t) | static void recalcData_uv(TransInfo *t) | ||||
| { | { | ||||
| SpaceImage *sima = t->area->spacedata.first; | SpaceImage *sima = t->area->spacedata.first; | ||||
| flushTransUVs(t); | flushTransUVs(t); | ||||
| if (sima->flag & SI_LIVE_UNWRAP) { | if (sima->flag & SI_LIVE_UNWRAP) { | ||||
| ED_uvedit_live_unwrap_re_solve(); | ED_uvedit_live_unwrap_re_solve(); | ||||
| } | } | ||||
| FOREACH_TRANS_DATA_CONTAINER (t, tc) { | FOREACH_TRANS_DATA_CONTAINER (t, tc) { | ||||
| if (tc->data_len) { | if (tc->data_len) { | ||||
| DEG_id_tag_update(tc->obedit->data, ID_RECALC_GEOMETRY); | DEG_id_tag_update(tc->obedit->data, ID_RECALC_GEOMETRY); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| TransConvertTypeInfo TransConvertType_MeshUV = { | |||||
| /* flags */ (T_EDIT | T_POINTS | T_2D_EDIT), | |||||
| /* createTransData */ createTransUVs, | |||||
| /* recalcData */ recalcData_uv, | |||||
| /* special_aftertrans_update */ NULL, | |||||
| }; | |||||