Individual Origins Broken in UV Editor #63203

Closed
opened 2019-04-02 00:41:03 +02:00 by Jonathan Lampel · 12 comments

System Information
Operating system: Windows-10-10.0.17763 64 Bits
Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 388.13

Blender Version
Broken: version: 2.80 (sub 53), branch: blender2.7, commit date: 2019-03-31 21:52, hash: b936d7b16c

Short description of error
Scaling or rotating faces in the UV Editor does not respect the individual origins pivot point.

Exact steps for others to reproduce the error

  1. Open the attached file or just subdivide a cube and head to the UV Editor.
    individual-origins_bug.blend

  2. Make sure the pivot point is set to individual origins.

  3. Scale or rotate two or more faces that are not touching each other.

**System Information** Operating system: Windows-10-10.0.17763 64 Bits Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 388.13 **Blender Version** Broken: version: 2.80 (sub 53), branch: blender2.7, commit date: 2019-03-31 21:52, hash: `b936d7b16c` **Short description of error** Scaling or rotating faces in the UV Editor does not respect the individual origins pivot point. **Exact steps for others to reproduce the error** 1. Open the attached file or just subdivide a cube and head to the UV Editor. [individual-origins_bug.blend](https://archive.blender.org/developer/F6906063/individual-origins_bug.blend) 2. Make sure the pivot point is set to individual origins. 3. Scale or rotate two or more faces that are not touching each other.

Added subscriber: @JonathanLampel-4

Added subscriber: @JonathanLampel-4
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Odd (but can confirm).
If you move the selected faces just slightly prior to scaling/rotating it works as expected, see
individual-origins_bug_slightly_tweaked.blend

checking...

Odd (but can confirm). If you move the selected faces just slightly prior to scaling/rotating it works as expected, see [individual-origins_bug_slightly_tweaked.blend](https://archive.blender.org/developer/F6906910/individual-origins_bug_slightly_tweaked.blend) checking...
Member

Added subscribers: @ideasman42, @brecht

Added subscribers: @ideasman42, @brecht
Member

Afaics, BM_uv_element_map_create will split these into islands (and the island centers will later be used as pivot for scaling / rotation)
So in the case where uvs touch neighboring uvs these will end up in the same island.
If you move the faces slightly (having them selected with sticky mode disabled), these will end up in separate islands.
(Same is true for 2.79 btw.)

The more I think about it it makes sense, can only think of disabeling the "island-grouping" when sticky selection is disabled?
(This is somewhat abusive -- since sticky is for selection really, not sure if it could/should be used in anything but selection as well?)
So we could do this, see P947: #63203 snippet



diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h
index 9e68c4a03ae..f9353748e04 100644
--- a/source/blender/editors/include/ED_mesh.h
+++ b/source/blender/editors/include/ED_mesh.h
@@ -102,7 +102,7 @@ void EDBM_update_generic(struct BMEditMesh *em, const bool do_tessface, const bo
 
 struct UvElementMap *BM_uv_element_map_create(
         struct BMesh *bm,
-        const bool selected, const bool use_winding, const bool do_islands);
+        const bool selected, const bool use_winding, const bool do_islands, const bool is_sticky_disabled);
 void                 BM_uv_element_map_free(struct UvElementMap *vmap);
 struct UvElement    *BM_uv_element_get(struct UvElementMap *map, struct BMFace *efa, struct BMLoop *l);
 
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c
index 3a4f9d461ec..7a8ee511ccc 100644
--- a/source/blender/editors/mesh/editmesh_utils.c
+++ b/source/blender/editors/mesh/editmesh_utils.c
@@ -645,7 +645,7 @@ UvMapVert *BM_uv_vert_map_at_index(UvVertMap *vmap, unsigned int v)
 /* A specialized vert map used by stitch operator */
 UvElementMap *BM_uv_element_map_create(
         BMesh *bm,
-        const bool selected, const bool use_winding, const bool do_islands)
+        const bool selected, const bool use_winding, const bool do_islands, const bool is_sticky_disabled)
 {
 	BMVert *ev;
 	BMFace *efa;
@@ -753,7 +753,8 @@ UvElementMap *BM_uv_element_map_create(
 				sub_v2_v2v2(uvdiff, uv2, uv);
 
 				if (fabsf(uvdiff- [x]) < STD_UV_CONNECT_LIMIT && fabsf(uvdiff- [x]) < STD_UV_CONNECT_LIMIT &&
-				    (!use_winding || winding[BM_elem_index_get(iterv->l->f)] == winding[BM_elem_index_get(v->l->f)]))
+				    (!use_winding || winding[BM_elem_index_get(iterv->l->f)] == winding[BM_elem_index_get(v->l->f)]) &&
+				    (!is_sticky_disabled))
 				{
 					if (lastv) lastv->next = next;
 					else vlist = next;
diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c
index dde09bb0f45..be8685681cf 100644
--- a/source/blender/editors/sculpt_paint/sculpt_uv.c
+++ b/source/blender/editors/sculpt_paint/sculpt_uv.c
@@ -619,18 +619,18 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wm
 		if (do_island_optimization) {
 			/* We will need island information */
 			if (ts->uv_flag & UV_SYNC_SELECTION) {
-				data->elementMap = BM_uv_element_map_create(bm, false, true, true);
+				data->elementMap = BM_uv_element_map_create(bm, false, true, true, false);
 			}
 			else {
-				data->elementMap = BM_uv_element_map_create(bm, true, true, true);
+				data->elementMap = BM_uv_element_map_create(bm, true, true, true, false);
 			}
 		}
 		else {
 			if (ts->uv_flag & UV_SYNC_SELECTION) {
-				data->elementMap = BM_uv_element_map_create(bm, false, true, false);
+				data->elementMap = BM_uv_element_map_create(bm, false, true, false, false);
 			}
 			else {
-				data->elementMap = BM_uv_element_map_create(bm, true, true, false);
+				data->elementMap = BM_uv_element_map_create(bm, true, true, false, false);
 			}
 		}
 
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 0fc36858e13..d466137159d 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -3178,6 +3178,7 @@ static void createTransUVs(bContext *C, TransInfo *t)
 	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_island_center = (t->around == V3D_AROUND_LOCAL_ORIGINS);
+	const bool is_sticky_disabled = (sima) ? (sima->sticky == SI_STICKY_DISABLE) : false;
 
 	FOREACH_TRANS_DATA_CONTAINER (t, tc) {
 
@@ -3200,7 +3201,8 @@ static void createTransUVs(bContext *C, TransInfo *t)
 		if (is_prop_connected || is_island_center) {
 			/* create element map with island information */
 			const bool use_facesel = (ts->uv_flag & UV_SYNC_SELECTION) == 0;
-			elementmap = BM_uv_element_map_create(em->bm, use_facesel, false, true);
+			elementmap = BM_uv_element_map_create(em->bm, use_facesel, false, true, is_sticky_disabled);
+
 			if (elementmap == NULL) {
 				return;
 			}
diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c
index 91167e247f4..b951812d7f2 100644
--- a/source/blender/editors/uvedit/uvedit_smart_stitch.c
+++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c
@@ -1879,10 +1879,10 @@ static StitchState *stitch_init(
 
 	/* in uv synch selection, all uv's are visible */
 	if (ts->uv_flag & UV_SYNC_SELECTION) {
-		state->element_map = BM_uv_element_map_create(state->em->bm, false, true, true);
+		state->element_map = BM_uv_element_map_create(state->em->bm, false, true, true, false);
 	}
 	else {
-		state->element_map = BM_uv_element_map_create(state->em->bm, true, true, true);
+		state->element_map = BM_uv_element_map_create(state->em->bm, true, true, true, false);
 	}
 	if (!state->element_map) {
 		state_delete(state);

Or we would have to alter the way BM_uv_element_map_create makes/detects islands for transform [maybe based on selected parts? -- not sure...]

I guess we need input from @ideasman42 or @brecht here?
(in the end this might not be considered a bug after all...)

Afaics, `BM_uv_element_map_create` will split these into islands (and the island centers will later be used as pivot for scaling / rotation) So in the case where uvs touch neighboring uvs these will end up in the same island. If you move the faces slightly (having them selected with sticky mode disabled), these will end up in separate islands. (Same is true for 2.79 btw.) The more I think about it it makes sense, can only think of disabeling the "island-grouping" when sticky selection is disabled? (This is somewhat abusive -- since sticky is for selection really, not sure if it could/should be used in anything but selection as well?) So we could do this, see [P947: #63203 snippet](https://archive.blender.org/developer/P947.txt) ``` diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index 9e68c4a03ae..f9353748e04 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -102,7 +102,7 @@ void EDBM_update_generic(struct BMEditMesh *em, const bool do_tessface, const bo struct UvElementMap *BM_uv_element_map_create( struct BMesh *bm, - const bool selected, const bool use_winding, const bool do_islands); + const bool selected, const bool use_winding, const bool do_islands, const bool is_sticky_disabled); void BM_uv_element_map_free(struct UvElementMap *vmap); struct UvElement *BM_uv_element_get(struct UvElementMap *map, struct BMFace *efa, struct BMLoop *l); diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 3a4f9d461ec..7a8ee511ccc 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -645,7 +645,7 @@ UvMapVert *BM_uv_vert_map_at_index(UvVertMap *vmap, unsigned int v) /* A specialized vert map used by stitch operator */ UvElementMap *BM_uv_element_map_create( BMesh *bm, - const bool selected, const bool use_winding, const bool do_islands) + const bool selected, const bool use_winding, const bool do_islands, const bool is_sticky_disabled) { BMVert *ev; BMFace *efa; @@ -753,7 +753,8 @@ UvElementMap *BM_uv_element_map_create( sub_v2_v2v2(uvdiff, uv2, uv); if (fabsf(uvdiff- [x]) < STD_UV_CONNECT_LIMIT && fabsf(uvdiff- [x]) < STD_UV_CONNECT_LIMIT && - (!use_winding || winding[BM_elem_index_get(iterv->l->f)] == winding[BM_elem_index_get(v->l->f)])) + (!use_winding || winding[BM_elem_index_get(iterv->l->f)] == winding[BM_elem_index_get(v->l->f)]) && + (!is_sticky_disabled)) { if (lastv) lastv->next = next; else vlist = next; diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c index dde09bb0f45..be8685681cf 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.c +++ b/source/blender/editors/sculpt_paint/sculpt_uv.c @@ -619,18 +619,18 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wm if (do_island_optimization) { /* We will need island information */ if (ts->uv_flag & UV_SYNC_SELECTION) { - data->elementMap = BM_uv_element_map_create(bm, false, true, true); + data->elementMap = BM_uv_element_map_create(bm, false, true, true, false); } else { - data->elementMap = BM_uv_element_map_create(bm, true, true, true); + data->elementMap = BM_uv_element_map_create(bm, true, true, true, false); } } else { if (ts->uv_flag & UV_SYNC_SELECTION) { - data->elementMap = BM_uv_element_map_create(bm, false, true, false); + data->elementMap = BM_uv_element_map_create(bm, false, true, false, false); } else { - data->elementMap = BM_uv_element_map_create(bm, true, true, false); + data->elementMap = BM_uv_element_map_create(bm, true, true, false, false); } } diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 0fc36858e13..d466137159d 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -3178,6 +3178,7 @@ static void createTransUVs(bContext *C, TransInfo *t) 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_island_center = (t->around == V3D_AROUND_LOCAL_ORIGINS); + const bool is_sticky_disabled = (sima) ? (sima->sticky == SI_STICKY_DISABLE) : false; FOREACH_TRANS_DATA_CONTAINER (t, tc) { @@ -3200,7 +3201,8 @@ static void createTransUVs(bContext *C, TransInfo *t) if (is_prop_connected || is_island_center) { /* create element map with island information */ const bool use_facesel = (ts->uv_flag & UV_SYNC_SELECTION) == 0; - elementmap = BM_uv_element_map_create(em->bm, use_facesel, false, true); + elementmap = BM_uv_element_map_create(em->bm, use_facesel, false, true, is_sticky_disabled); + if (elementmap == NULL) { return; } diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index 91167e247f4..b951812d7f2 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -1879,10 +1879,10 @@ static StitchState *stitch_init( /* in uv synch selection, all uv's are visible */ if (ts->uv_flag & UV_SYNC_SELECTION) { - state->element_map = BM_uv_element_map_create(state->em->bm, false, true, true); + state->element_map = BM_uv_element_map_create(state->em->bm, false, true, true, false); } else { - state->element_map = BM_uv_element_map_create(state->em->bm, true, true, true); + state->element_map = BM_uv_element_map_create(state->em->bm, true, true, true, false); } if (!state->element_map) { state_delete(state); ``` Or we would have to alter the way `BM_uv_element_map_create` makes/detects islands for transform [maybe based on selected parts? -- not sure...] I guess we need input from @ideasman42 or @brecht here? (in the end this might not be considered a bug after all...)

Or we would have to alter the way BM_uv_element_map_create makes/detects islands for transform [maybe based on selected parts? -- not sure...]

That seems the correct solution to me, to only build islands based on selected elements.

I don't think sticky selection should have an influence on this.

> Or we would have to alter the way BM_uv_element_map_create makes/detects islands for transform [maybe based on selected parts? -- not sure...] That seems the correct solution to me, to only build islands based on selected elements. I don't think sticky selection should have an influence on this.
Member

Added subscriber: @Mets

Added subscriber: @Mets

Added subscriber: @Likkez-2

Added subscriber: @Likkez-2

Can this get fixed please? It has been broken for a while now. I cannot UV my anime breasts.2019-06-27 16-25-08.mp4

Can this get fixed please? It has been broken for a while now. I cannot UV my anime breasts.[2019-06-27 16-25-08.mp4](https://archive.blender.org/developer/F7551803/2019-06-27_16-25-08.mp4)

Added subscriber: @mano-wii

Added subscriber: @mano-wii

This has already been resolved in 86a2ffc3ab

This has already been resolved in 86a2ffc3ab

Closed as duplicate of #72325

Closed as duplicate of #72325
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#63203
No description provided.