Page MenuHome

Fix T72438: Use PBVH vert coordinates in sculpt API when using shape keys
AcceptedPublic

Authored by Pablo Dobarro (pablodp606) on Dec 17 2019, 4:20 AM.

Details

Summary

This is the most straightforward solution for the reported issue. If
there is a shape key active, read the coordinates from the PBVH instead
of from the SculptSession mesh array. This affects the cursor, the
dynamic mesh preview, and the tools.

The idea of the dynamic mesh preview was to show the original mesh while
sculpting on the modified. I don't think this makes much sense with shape
keys, so I disabled the preview there. The cursor and the vertex preview
should work correctly.

I'm not sure if it is worth adding an if statement to the sculpt_vertex_co_get function for a case that is barely used (andwhen it is, it is used with low poly meshes). That function is called
constantly multiple times per vertex and per redraw on high poly meshes,
so maybe this has a performance impact. Another solution could be
making a separate set of functions (something like

sculpt_vertex_modified_co_get ##) and use them just of the cursor and

the mesh preview.

Diff Detail

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

Event Timeline

Jeroen Bakker (jbakker) requested changes to this revision.Dec 18 2019, 10:50 AM
Jeroen Bakker (jbakker) added inline comments.
source/blender/blenkernel/BKE_pbvh.h
230

PBVH_FACES?

This revision now requires changes to proceed.Dec 18 2019, 10:50 AM
This revision is now accepted and ready to land.Dec 19 2019, 8:43 AM