Page MenuHome

PaintingModes: Facemask Wireframe Drawing
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Jun 28 2019, 12:11 PM.

Details

Summary

The wireframe drawing for face masks is intrusive as selected wires
were solid white and always drawn. This made it hard for users to see
the exact color near edges.

This patch draws only the border of the selected faces,
edges between two selected faces are not drawn at all.

Before applying this patch

After applying this patch



Diff Detail

Repository
rB Blender

Event Timeline

Jeroen Bakker (jbakker) planned changes to this revision.Jun 28 2019, 12:12 PM

I checked with @Julien Kaspar (JulienKaspar) and would like to do similar changes to the vertex/weight paint face mask selection.

Added similar drawing to weightpainting and vertex painting

Jeroen Bakker (jbakker) retitled this revision from TexturePainting: Wireframe Drawing to PaintingModes: Facemask Wireframe Drawing .Jun 28 2019, 12:52 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
Brecht Van Lommel (brecht) requested changes to this revision.EditedJun 28 2019, 1:30 PM

I wouldn't do the stippling, it looks ugly on diagonal lines and is not really needed.

Is it possible to avoid drawing the black unselected edges?

source/blender/draw/intern/draw_cache_impl_mesh.c
3877–3879

It's more efficient to have a single hash with the value being the number of selected faces.

3902

It would be more efficient to iterator over the hash.

3922

Which case is this? Can we add an explanation why this is not needed now?

This revision now requires changes to proceed.Jun 28 2019, 1:30 PM
Jeroen Bakker (jbakker) marked an inline comment as done.
Jeroen Bakker (jbakker) retitled this revision from PaintingModes: Facemask Wireframe Drawing to PaintingModes: Facemask Wireframe Drawing.

Removed second edgehash

Jeroen Bakker (jbakker) marked an inline comment as done.

Remove mapping-use

source/blender/draw/intern/draw_cache_impl_mesh.c
3840

I am not sure how we could use the EdgeHashIterator as we need the vertex loop index in the index buffer.

3922

Was copy paste mistake, will remove the if statement to use mapped data

Ok, the edge hash iterator won't work then.

Jeroen Bakker (jbakker) marked an inline comment as done.

Removed unused code example for edgehash iterator

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Jun 28 2019, 3:41 PM
source/blender/draw/intern/draw_cache_impl_mesh.c
3839

Postprocess edgehash to optimize the inner loop lookups.

@Brecht Van Lommel (brecht)

On my way home I did some math. and I think we should revert the changes to the original solution (two edgehashes). In the first solution with the two edgehashes the inner loop would only check against an edgehash that contained the edges of the border of the face mask selection. In the current solution the edgehash contains all edges. as the inner loop is per poly per edge a check against a smaller edgehash would be faster.
Don't think the speedup will be noticeable to the user, but we might want the fastest solution as this is done in the drawing code.

If the solution was possible with the edgehashIterator the second solution would have been optimal...

I think the current solution is fine, hashes are O(1) regardless of the size.

source/blender/draw/intern/draw_cache_impl_mesh.c
3839

Perhaps we can do this later

This revision is now accepted and ready to land.Jul 1 2019, 10:35 AM
This revision was automatically updated to reflect the committed changes.