Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/uvedit/uvedit_unwrap_ops.c
| Show First 20 Lines • Show All 2,159 Lines • ▼ Show 20 Lines | static int smart_project_exec(bContext *C, wmOperator *op) | ||||
| MEM_freeN(objects); | MEM_freeN(objects); | ||||
| /* Pack islands & Stretch to UV bounds */ | /* Pack islands & Stretch to UV bounds */ | ||||
| if (object_changed_len > 0) { | if (object_changed_len > 0) { | ||||
| scene->toolsettings->uvcalc_margin = island_margin; | scene->toolsettings->uvcalc_margin = island_margin; | ||||
| /* Depsgraph refresh functions are called here. */ | /* Depsgraph refresh functions are called here. */ | ||||
| const bool correct_aspect = RNA_float_get(op->ptr, "correct_aspect"); | |||||
| ED_uvedit_pack_islands_multi(scene, | ED_uvedit_pack_islands_multi(scene, | ||||
| objects_changed, | objects_changed, | ||||
| object_changed_len, | object_changed_len, | ||||
| &(struct UVPackIsland_Params){ | &(struct UVPackIsland_Params){ | ||||
| .rotate = true, | .rotate = true, | ||||
| /* We could make this optional. */ | /* We could make this optional. */ | ||||
| .rotate_align_axis = 1, | .rotate_align_axis = 1, | ||||
| .only_selected_faces = true, | .only_selected_faces = true, | ||||
| .correct_aspect = true, | .correct_aspect = correct_aspect, | ||||
| .use_seams = true, | .use_seams = true, | ||||
| }); | }); | ||||
| uv_map_clip_correct_multi(objects_changed, object_changed_len, op); | uv_map_clip_correct_multi(objects_changed, object_changed_len, op); | ||||
| } | } | ||||
| MEM_freeN(objects_changed); | MEM_freeN(objects_changed); | ||||
| ▲ Show 20 Lines • Show All 697 Lines • Show Last 20 Lines | |||||