Page MenuHome

Multires: Stitch grids visibility after Face Set modifications
Needs RevisionPublic

Authored by Pablo Dobarro (pablodp606) on Sep 15 2020, 11:43 PM.

Details

Summary

Previously, the visibiliy of the Face Set was copied to the entire grid
bitmap, so it was possible for an element to be visibile and its
duplicate to hidden if the element was between a visibile and invisible
grid.

This adds an extra step to that ensures that if an element is visible,
all its duplicates in other grids are also visibile. This now happens
always after a Face Set visibility chage, so the old sync funcion using
only for sculpt mode was replaced for the generic sync funcion.

Having an anbiguous visibility stated on the grid elements should be
causing a considable number of bugs in all the sculpt tools when using
partial visibility.

Diff Detail

Repository
rB Blender
Branch
multires-stitch-visibility (branched from master)
Build Status
Buildable 10222
Build 10222: arc lint + arc unit

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Sep 15 2020, 11:43 PM
Sergey Sharybin (sergey) requested changes to this revision.Sep 16 2020, 10:05 AM
Sergey Sharybin (sergey) added inline comments.
source/blender/blenkernel/intern/multires.c
1476

First, use early continue instead of nested levels.

Second, this goes to the older discussion of thew neighborhood API: it is not nice to make user code to worry about memory layout of the coordinates.

There are easy ways to make things way more explicit for the user code:

Way #1: Hide the check under BKE_subdiv_ccg_neighbour_coord_is_duplicate(). Easiest to implement, but is still not very ideal.

Way #2: Make SubdivCCGNeighbors to store SubdivCCGNeighbourCoord where the latter one is

typedef struct SubdivCCGNeighbourCoord {
  int grid_index;
  int x, y;
  bool is_duplicate;
} SubdivCCGNeighbourCoord;

The latter one makes user code explicit, and allows to simplify indexing logic in the BKE_subdiv_ccg_neighbor_coords_get().

Such refactor is something we discussed already and agreed it should happen,. yet there is new code which keeps spreading code which we want to be changed.

1486–1488

Move this to BKE_subdiv_ccg_neighbor_coords_free()

This revision now requires changes to proceed.Sep 16 2020, 10:05 AM