Page MenuHome

Sculpt: Grab active vertex
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Sep 1 2019, 12:45 AM.

Details

Summary

Grab active vertex snaps the maximum strength of the grab brush to the highlighted active vertex, making it easier to manipulate low poly models or meshes with subdivision surfaces.
In the sculpt-branch this also enables the dynamic mesh preview. It works by generating a list of connected vertices from the active vertex and drawing them from the cursor drawing code using OpenGL lines. If that way of doing the preview is ok, I can include it as part of this patch. If there is a better way to do it's better to wait for 2.82.

Diff Detail

Repository
rB Blender
Branch
sculpt-grab-active-vertex (branched from master)
Build Status
Buildable 4822
Build 4822: arc lint + arc unit

Event Timeline

These small changes seem fine to me. However I do miss the wire frame preview as it would be a good way to indicate that this works differently than without this option on.

@Clément Foucault (fclem) @Jeroen Bakker (jbakker) what do you think about the proposed OpenGL drawing here?

The functionality in this patch seems fine.

Would be convenient if you added the OpenGL drawing to this patch for review too.

This revision is now accepted and ready to land.Sep 6 2019, 4:59 PM

OpenGL part can also be a separate code review if you think the current implementation is usable without it, and then just commit this directly.

source/blender/makesrna/intern/rna_brush.c
1955

Missed before:

Grab active vertex -> Grab Active Vertex

1956

strenght -> strength

  • Dynamic Mesh Preview

I added the dynamic mesh preview code to this patch as it is meant to be used with modifiers and grab active vertex. If you think that this should be done in a different way I can remove it and commit the original patch.
It is enabled automatically when grab active vertex is enabled and there are modifiers in the SculptSession.

Pablo Dobarro (pablodp606) marked 2 inline comments as done.
  • Fix naming
Brecht Van Lommel (brecht) requested changes to this revision.Sep 9 2019, 8:14 PM

Immediate mode for drawing geometry doesn't have great performance. But since this is not meant to draw the entire mesh and only for a specific tool, I think this is fine.

source/blender/editors/sculpt_paint/paint_cursor.c
1191

Use GPU_matrix_push(), GPU_matrix_mul(obmat), GPU_matrix_pop() so this matrix multiplication can happen on the GPU.

This revision now requires changes to proceed.Sep 9 2019, 8:14 PM
Pablo Dobarro (pablodp606) marked an inline comment as done.
  • Rebase
  • use GPU_matrix
This revision is now accepted and ready to land.Sep 10 2019, 10:56 AM