Page MenuHome

Poly build tool improvements
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Sat, Aug 24, 1:15 AM.
Tags
None
Tokens
"Love" token, awarded by ionflux."Love" token, awarded by cgvirus."Love" token, awarded by GlobalKrampus."Love" token, awarded by ChildishGiant."Love" token, awarded by DrawingistMusashi."Love" token, awarded by dgsantana."Love" token, awarded by justastatue."Mountain of Wealth" token, awarded by xrg."Burninate" token, awarded by amonpaike."Love" token, awarded by johnsyed."Love" token, awarded by jmztn."Love" token, awarded by A.Lex_3D."Love" token, awarded by Lumpengnom."Love" token, awarded by RyanJEC.

Details

Summary

Poly build tool improvements

This patch implements some improvements to make the poly build tool more suitable for retopology tasks.

  • Smarter edge/face/vert preselection
  • Geometry preview
  • Automatic quad creation
  • Create/move/delete mesh elements from the same tool, using a similar and consistent interaction

Even if the tool makes the retopology experience much better, there are still some blocking issues that prevent us to have a decent retopology experience.

  • You have to configure snapping and auto merge editing manually each time you want to use this tool.
  • There isn't a viewport mode available that works with this tool. We need to implement a new mesh display mode specific to retopology. See T67997
  • Preselection does not take element visibility into account. To achieve this, we will probably need to define a target retopology mesh when using the tool. This needs to match with the new mesh display mode to return only visible mesh element. This issue makes impossible to retopologize an entire model using this tool.

To Do:

  • Refactor the gizmo
  • There is a conflict in the keymap (with enable snapping) if we use Ctrl + drag to create geometry

Diff Detail

Repository
rB Blender

Event Timeline

Campbell Barton (campbellbarton) requested changes to this revision.Mon, Aug 26, 1:46 PM

Tested, previews are nice but noticed some issues.

  • On first activation it behaves as if Ctrl is held (shows a triangle extended from the edge), tapping Ctrl resolves.
  • I can get both the add & remove (red and blue) previews to show at once (hold shift and move the cursor around the model).
  • There are quite a few unused variables & arguments which should be marked as UNUSED or removed.

Otherwise this seems fine.

source/blender/editors/space_view3d/view3d_gizmo_preselect_type.c
146–171

No need to shout :)

159

called mval_fl elsewhere, no need to define zero then assign. can be written as:

const float mval_fl[2] = {UNPACK2(mval)};

This revision now requires changes to proceed.Mon, Aug 26, 1:46 PM
  • Update for review

I fixed some bugs and warnings. Now the gizmo should update correctly with the keymap hack
I also added another operator macro to extrude quads directly by clicking and dragging.

  • Extrude edges by clicking and dragging

Now the tool extrudes quads by clicking and dragging on boundary edges. Triangle/Quad creation tool is available when pressing Ctrl and delete when pressing shift.
It also prioritizes internal vertices when tweaking geometry.

Minor changes suggested inline, otherwise LGTM.

source/blender/editors/include/ED_mesh.h
251

Convention is to start these with e, could also include EditMesh in name.

eg: eEditMesh_PreSelPreview

source/blender/editors/mesh/editmesh_preselect_elem.c
264–265

Think this would read better written as:

psel->preview_tris = MEM_mallocN(sizeof(*psel->preview_tris) * 2, __func__);
psel->preview_lines = MEM_mallocN(sizeof(*psel->preview_lines) * 4, __func__);
source/blender/editors/mesh/editmesh_select.c
1519

use_boundary_edges || use_boundary_edges ?

To catch these with gcc add the CFLAG -Werror=logical-op

This revision is now accepted and ready to land.Tue, Aug 27, 4:03 AM
Pablo Dobarro (pablodp606) marked 2 inline comments as done.Tue, Aug 27, 4:26 PM
This revision was automatically updated to reflect the committed changes.