Reference/Release Notes/2.63/Sculpt Hiding/Implementation

From Blender Developer Wiki
Jump to: navigation, search

Blender 2.63: Sculpt Hiding Implementation Notes

This is a much different system than what 2.4x sculpt did. Formerly, hiding part of the mesh would temporarily reorder the mesh element arrays (vertices/faces/edges), moving hidden elements to the end so they could be skipped during sculpting and drawing. This lead to all sorts of issues (including severe mesh corruption) with saving and undo.

The new implementation is much safer, and mostly affects the PBVH. Note that the implementation has also changed a bit from its appearance in recent GSoCs, including one user-visible change: partial-visibility with multires now correctly hides sub-elements in grids, rather than very course hiding of grids.

For non-multires meshes, the ME_HIDE flag of mesh vertices is used to mark a vertex as hidden. This means that hiding is shared between edit mode and sculpt mode (hiding/unhiding in one mode affects the other mode too.)

For multires meshes, a new 'hidden' field was added to the MDisps structure. The field stores a dynamic array much like MDisps.disps, except it's a bitmap rather than float[3] displacement vectors.

When VBO is enabled, hiding vertices or grid elements in a node results in a rebuild of the GPU buffers for that node. Hiding elements affects the size (and contents) of the index buffer object, but not the vertex buffer object (removing coordinate/normal data from the VBO would require yet another index mapping container in order to do buffer updates, which seems counterproductive.)

Bugs

  • Alt+HKEY often seems to do HKEY action too

Operator

paint.hide_show

The operator has two properties, action and area. The action property can be set to either HIDE or SHOW. The area property can be set to INSIDE, OUTSIDE, or ALL.

Test file

File:Pv-sample-00.blend