Page MenuHome

Fix T78664: Implement Mesh and Face Set boundary automasking in Multires
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Jul 6 2020, 11:10 PM.

Details

Summary

This implements the SCULPT_vertex_is_boundary and SCULPT_vertex_has_unique_face_set functions for PBVH_GRIDS, which makes features such as automasking now work in multires. It also fixes some other face sets related features in multires, like face set boundary smoothing.

This uses the BKE_subdiv_ccg_coarse_mesh_adjacency_info_get function to get the vertex indicies in the base mesh from multires. This way the API functions can get topology or face set information directly from it. In the future, these vertex indices can be used to get any other information from the base mesh from multires, like seams, sharp edges, disconnected elements IDs...

Diff Detail

Repository
rB Blender
Branch
T78664 (branched from master)
Build Status
Buildable 8911
Build 8911: arc lint + arc unit

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Jul 6 2020, 11:10 PM
Sergey Sharybin (sergey) requested changes to this revision.Jul 7 2020, 11:06 AM
Sergey Sharybin (sergey) added inline comments.
source/blender/blenkernel/intern/subdiv_ccg.c
1845–1847

If you intend to use these indices to address anything from Blender side, you can not go this route. Topology refiner only contains manifold part of geometry.

1850–1852

This sounds to be too much semantic encoded into too little entities, which is worsen by weak function naming choice.

You can make things more clear by:

  • Properly naming the function (what it does, is finds adjacency information from the coarse mesh)
  • Return explicit enum which will indicate if there is no adjacency, vertex adjacency, or edge edjacency.
1864

else after return.

Try to minimize amount if branches and indentation.

This revision now requires changes to proceed.Jul 7 2020, 11:06 AM
Pablo Dobarro (pablodp606) marked 3 inline comments as done.
  • Review Update: Don't use the topology refiner
source/blender/blenkernel/intern/subdiv_ccg.c
1858–1860

The comment is brief enough and will not violate guideline when is moved to the header.

The motivation to keep comments in the header is to have clear explanation and overview about what API is doing.

1891

Redundant statement.

source/blender/editors/sculpt_paint/sculpt.c
608

const SubdivCCGCoord coord ?

612

const SubdivCCGAdjacencyType adjacency

828

const

832

const

Pablo Dobarro (pablodp606) marked 6 inline comments as done.
  • Review update

Looks good now!

This revision is now accepted and ready to land.Jul 9 2020, 2:47 PM