diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-12-21 13:43:28 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-12-21 18:34:08 +0300 |
commit | e56aa4ff0c6b2a1746d5c39e297c9f6f56c4b492 (patch) | |
tree | 2dfe9e2dd8de893bf3988abe213db1041822e1fe /source/blender/editors/sculpt_paint/paint_image_proj.c | |
parent | bf168a05cd388c02359e52e4ae674c89f13c96a6 (diff) |
Fix T59668: UV unwrap pinning bugs.
With multi object editing it creates the charts twice, which broke some
logic in the unwrapper.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_proj.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 5275d899a56..e366246efbc 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -5937,33 +5937,8 @@ static int add_simple_uvs_exec(bContext *C, wmOperator *UNUSED(op)) Main *bmain = CTX_data_main(C); Object *ob = CTX_data_active_object(C); Scene *scene = CTX_data_scene(C); - Mesh *me = ob->data; - bool synch_selection = (scene->toolsettings->uv_flag & UV_SYNC_SELECTION) != 0; - - BMesh *bm = BM_mesh_create( - &bm_mesh_allocsize_default, - &((struct BMeshCreateParams){.use_toolflags = false,})); - - /* turn synch selection off, since we are not in edit mode we need to ensure only the uv flags are tested */ - scene->toolsettings->uv_flag &= ~UV_SYNC_SELECTION; - - ED_mesh_uv_texture_ensure(me, NULL); - - BM_mesh_bm_from_me( - bm, me, (&(struct BMeshFromMeshParams){ - .calc_face_normal = true, - })); - /* select all uv loops first - pack parameters needs this to make sure charts are registered */ - ED_uvedit_select_all(bm); - ED_uvedit_unwrap_cube_project(bm, 1.0, false, NULL); - /* set the margin really quickly before the packing operation*/ - scene->toolsettings->uvcalc_margin = 0.001f; - ED_uvedit_pack_islands(scene, ob, bm, false, false, true); - BM_mesh_bm_to_me(bmain, bm, me, (&(struct BMeshToMeshParams){0})); - BM_mesh_free(bm); - - if (synch_selection) - scene->toolsettings->uv_flag |= UV_SYNC_SELECTION; + + ED_uvedit_add_simple_uvs(bmain, scene, ob); BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); |