From d917d7cf948579f6aee58863f16225ed6e5ec2a0 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Fri, 29 Jan 2021 14:52:48 +0100 Subject: Fix T85194: Smart UV does not respect "Correct Aspect" correctly This lead to wrong, stretched UVs regardless of the ON/OFF state of "Correct Aspect" option (some code in the operator respected this setting properly, whereas it was hardcoded in another part). Before rB9296ba867462, `uvedit_pack_islands_multi` was always called with `correct_aspect` = false for the UnwrapOptions. After rB9296ba867462, `ED_uvedit_pack_islands_multi` was always called with `correct_aspect` = true for the UVPackIsland_Params. Both seem wrong [in that they do not take the operator setting into account]. Now respect that setting [same as the following `uv_map_clip_correct_multi` does as well btw.] Now results match 2.90 [where this was still python] perfectly. Maniphest Tasks: T85194 Differential Revision: https://developer.blender.org/D10246 --- source/blender/editors/uvedit/uvedit_unwrap_ops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 4bba3ef605e..be54df1ce9e 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -2165,6 +2165,7 @@ static int smart_project_exec(bContext *C, wmOperator *op) scene->toolsettings->uvcalc_margin = island_margin; /* Depsgraph refresh functions are called here. */ + const bool correct_aspect = RNA_boolean_get(op->ptr, "correct_aspect"); ED_uvedit_pack_islands_multi(scene, objects_changed, object_changed_len, @@ -2173,7 +2174,7 @@ static int smart_project_exec(bContext *C, wmOperator *op) /* We could make this optional. */ .rotate_align_axis = 1, .only_selected_faces = true, - .correct_aspect = true, + .correct_aspect = correct_aspect, .use_seams = true, }); -- cgit v1.2.3