Skin Modifier - topology changes randomly when entering and exiting edit mode #42893

Closed
opened 2014-12-14 10:11:40 +01:00 by Matt Heimlich · 25 comments

System Information
Win7 x64

Blender Version
Broken: c51ca1b

Short description of error
Generated mesh topology changes randomly when changing modes

Exact steps for others to reproduce the error
Open file, hit Tab a bunch of times

skinBug.blend

**System Information** Win7 x64 **Blender Version** Broken: c51ca1b **Short description of error** Generated mesh topology changes randomly when changing modes **Exact steps for others to reproduce the error** Open file, hit Tab a bunch of times [skinBug.blend](https://archive.blender.org/developer/F131374/skinBug.blend)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @MatthewHeimlich

Added subscriber: @MatthewHeimlich
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Member

This seems to be a gooseberry only bug. We currently don't have a project dedicated to that, but I don't like having gooseberry branch bugs set to #bf_blender. Will check with others if it's worth adding a "BF Blender: Gooseberry" project.

This seems to be a gooseberry only bug. We currently don't have a project dedicated to that, but I don't like having gooseberry branch bugs set to #bf_blender. Will check with others if it's worth adding a "BF Blender: Gooseberry" project.
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Julian Eisel self-assigned this 2014-12-14 16:48:00 +01:00
Member

Okay, so in todays meeting we decided to not allow gooseberry branch bugs. I'd recommend to get in contact with the gooseberry developers in those cases.

But as always: thanks for the report @MatthewHeimlich :)

Okay, so in todays meeting we decided to not allow gooseberry branch bugs. I'd recommend to get in contact with the gooseberry developers in those cases. But as always: thanks for the report @MatthewHeimlich :)
Member

@MatthewHeimlich asked for reopening on IRC, since the bug seems to appear on master too.
I still cann't confirm here, but he said some people on #blender did.

@MatthewHeimlich asked for reopening on IRC, since the bug seems to appear on master too. I still cann't confirm here, but he said some people on #blender did.
Member

Changed status from 'Archived' to: 'Open'

Changed status from 'Archived' to: 'Open'
Julian Eisel removed their assignment 2015-01-20 18:36:57 +01:00

Added subscriber: @karja

Added subscriber: @karja

Hey,
can confirm this - Skin is working continously and not consistent on branched edges.

Want to add that this topology changes occur for nearly every action that can change position or geometry of the skin object (except G/R/S in object mode).
Objects that are related somehow to the skin object (= modifier target, constraints, linked mesh) also cause this problem.

Further examples:

  • Give Skin mesh a Copy Location Constraint (no target needed), turn it on and off.
  • Edit-Objectmode switch on another linked mesh.
  • Moving a mirror-object (mirror modifier target) around.

Use point 3 for the file and you should spot the flickering better while moving the target.

Hey, can confirm this - Skin is working continously and not consistent __on branched edges__. Want to add that this topology changes occur for nearly every action that can change position or geometry of the skin object (except G/R/S in object mode). Objects that are related somehow to the skin object (= modifier target, constraints, linked mesh) also cause this problem. Further examples: - Give Skin mesh a Copy Location Constraint (no target needed), turn it on and off. - Edit-Objectmode switch on another linked mesh. - Moving a mirror-object (mirror modifier target) around. >Use point 3 for the file and you should spot the flickering better while moving the target.

Added subscribers: @NicholasBishop, @kevindietrich

Added subscribers: @NicholasBishop, @kevindietrich

Some steps to easily reproduce using @MatthewHeimlich file:

  • get rid of the mirror and subsurf modifiers,
  • ensure you are in edit mode,
  • select all vertices
  • move the mesh around

To quote some comments in MOD_skin.c :

Concave surfaces around branch nodes. The paper does not discuss
how to handle non-convex regions; this code adds a number of
cleanup operations to handle many (though not all) of these
cases.

As the glitch actually appears in one of those concave regions, it might be that this case is not handled properly. @NicholasBishop care to have a quick glance here?

Some steps to easily reproduce using @MatthewHeimlich file: - get rid of the mirror and subsurf modifiers, - ensure you are in edit mode, - select all vertices - move the mesh around To quote some [comments in MOD_skin.c ](https://developer.blender.org/diffusion/B/browse/master/source/blender/modifiers/intern/MOD_skin.c;dda355442dc7ba4f83f65cb792be3f27be8c9fee$54): > Concave surfaces around branch nodes. The paper does not discuss > how to handle non-convex regions; this code adds a number of > cleanup operations to handle many (though not all) of these > cases. As the glitch actually appears in one of those concave regions, it might be that this case is not handled properly. @NicholasBishop care to have a quick glance here?

Hmm, I've found another comment that could lead us in the right direction:

A frame could be merged diagonally across
another, would generate a weird (bad) T
junction

And that's exactly what appears to be going on:

skinBug.blend.png

skinBug.blend1.png

Hmm, I've found another [comment ](https://developer.blender.org/diffusion/B/browse/master/source/blender/modifiers/intern/MOD_skin.c;dda355442dc7ba4f83f65cb792be3f27be8c9fee$375) that could lead us in the right direction: >A frame could be merged diagonally across >another, would generate a weird (bad) T >junction And that's exactly what appears to be going on: ![skinBug.blend.png](https://archive.blender.org/developer/F138642/skinBug.blend.png) ![skinBug.blend1.png](https://archive.blender.org/developer/F138644/skinBug.blend1.png)
Nicholas Bishop was assigned by Julian Eisel 2015-02-02 00:51:19 +01:00
Member

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Member

Assigning to Nicholas to increase pressure a bit ;) Also @ideasman42 might have some input.

Assigning to Nicholas to increase pressure a bit ;) Also @ideasman42 might have some input.

Added subscriber: @numarul7

Added subscriber: @numarul7

I can`t reproduce on standard 2.71 build from blender.org install (I know I know ...i wait for the OpenGL :D refactor ) :)

I can`t reproduce on standard 2.71 build from blender.org install (I know I know ...i wait for the OpenGL :D refactor ) :)

Added subscriber: @MarcClintDion

Added subscriber: @MarcClintDion

For the following .gif, I removed the mirror and moved the model in Object mode then applied the Object's Location using Ctrl+a.

I then used Undo and Redo repeatedly to see if this was possibly due to the GPU doing internal triangulation differently based on how Object Mode vs. Edit Mode are passing info to OpenGL .

That is a known nuisance but apparently not the issue here because it's only a slight shading issue that presents itself when that is happening.


For this Skin Modifier problem, the geometry is actually being visually moved to different places in 3D space and the results are often very different just by Undoing and Redoing. After doing that about 20 times, I ended up seeing about 5-6 different configurations of the geometry.

That's very unusual since Undoing and Redoing repeatedly should give identical results for every iteration.

Something weird is happening here. It can be seen in the following animation.

scale_UI.gif

 
For the following .gif, I removed the mirror and moved the model in Object mode then applied the Object's Location using Ctrl+a. I then used Undo and Redo repeatedly to see if this was possibly due to the GPU doing internal triangulation differently based on how Object Mode vs. Edit Mode are passing info to OpenGL . That is a known nuisance but apparently not the issue here because it's only a slight shading issue that presents itself when that is happening. ------ For this Skin Modifier problem, the geometry is actually being visually moved to different places in 3D space and the results are often very different just by Undoing and Redoing. After doing that about 20 times, I ended up seeing about 5-6 different configurations of the geometry. That's very unusual since Undoing and Redoing repeatedly should give identical results for every iteration. Something weird is happening here. It can be seen in the following animation. ![scale_UI.gif](https://archive.blender.org/developer/F150011/scale_UI.gif) ``` ```
Member

@NicholasBishop, @ideasman42, did anybody find the time to look into this?

@NicholasBishop, @ideasman42, did anybody find the time to look into this?
Nicholas Bishop was unassigned by Brecht Van Lommel 2015-05-02 15:18:45 +02:00
Campbell Barton was assigned by Brecht Van Lommel 2015-05-02 15:18:45 +02:00

Added subscriber: @brecht

Added subscriber: @brecht

This bug was caused by 92733179ae.

I can see that hull_merge_triangles uses the normal, so presumably some intermediate recalc normal operations are necessary for that. Also, is it ok to use BMO_push and bmesh_edit_begin without BMO_pop and bmesh_edit_end?

Maybe the fix looks something like this, it works but I'm not sure it's correct.

diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c
index bd16fd0..3b26b4a 100644
--- a/source/blender/modifiers/intern/MOD_skin.c
+++ b/source/blender/modifiers/intern/MOD_skin.c
@@ -1763,6 +1763,7 @@ static BMesh *build_skin(SkinNode *skin_nodes,

        /* Merge triangles here in the hope of providing better target
         * faces for skin_fix_hull_topology() to connect to */
+       BM_mesh_normals_update(so.bm);
        hull_merge_triangles(&so, smd);

        /* Using convex hulls may not generate a nice manifold mesh. Two
@@ -1781,8 +1782,12 @@ static BMesh *build_skin(SkinNode *skin_nodes,

        skin_output_end_nodes(&so, skin_nodes, totvert);
        skin_output_connections(&so, skin_nodes, medge, totedge);
+       BM_mesh_normals_update(so.bm);
        hull_merge_triangles(&so, smd);

+       bmesh_edit_end(so.bm, 0);
+       BMO_pop(so.bm);
+
        return so.bm;
 }
This bug was caused by 92733179ae. I can see that `hull_merge_triangles` uses the normal, so presumably some intermediate recalc normal operations are necessary for that. Also, is it ok to use `BMO_push` and `bmesh_edit_begin` without `BMO_pop` and `bmesh_edit_end`? Maybe the fix looks something like this, it works but I'm not sure it's correct. ``` diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c index bd16fd0..3b26b4a 100644 --- a/source/blender/modifiers/intern/MOD_skin.c +++ b/source/blender/modifiers/intern/MOD_skin.c @@ -1763,6 +1763,7 @@ static BMesh *build_skin(SkinNode *skin_nodes, /* Merge triangles here in the hope of providing better target * faces for skin_fix_hull_topology() to connect to */ + BM_mesh_normals_update(so.bm); hull_merge_triangles(&so, smd); /* Using convex hulls may not generate a nice manifold mesh. Two @@ -1781,8 +1782,12 @@ static BMesh *build_skin(SkinNode *skin_nodes, skin_output_end_nodes(&so, skin_nodes, totvert); skin_output_connections(&so, skin_nodes, medge, totedge); + BM_mesh_normals_update(so.bm); hull_merge_triangles(&so, smd); + bmesh_edit_end(so.bm, 0); + BMO_pop(so.bm); + return so.bm; } ```

This issue was referenced by abd68c6e45

This issue was referenced by abd68c6e45a67ff682f13000d1ae2f8b79edea22

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit abd68c6e45.

Closed by commit abd68c6e45.
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
9 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#42893
No description provided.