diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-09-14 11:56:54 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-09-14 15:43:56 +0300 |
commit | 8e8952b7e363b878cfc97440c1d2254dffbaf840 (patch) | |
tree | 3e313cc676d5c0073ca17810fe818542ee8dc41b /source/blender/editors/sculpt_paint | |
parent | 744233f2078fca85986bc98c7b72393fda9ca58e (diff) |
Multires: Initial work to get sculpting to work with OpenSubdiv
Allows to go to sculpt mode, do brush strokes, get out of sculpt mode
and have deformation preserved.
The issues currently is that the current implementation of CCG
storage is created from the limit surface, without displacement
taken into account. It is trivial to get displaced coordinates,
but it is more tricky to get displaced normals. This is something
to be solved next.
Another limitation is that this only works for sculpting at a maximal
multires level. There is code to be done to support propagation
of displacement onto a higher levels.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 45037cfddfa..ccba962a6f8 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -74,6 +74,7 @@ #include "BKE_colortools.h" #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" #include "WM_api.h" #include "WM_types.h" @@ -4868,8 +4869,12 @@ static void sculpt_flush_update(bContext *C) ARegion *ar = CTX_wm_region(C); MultiresModifierData *mmd = ss->multires; - if (mmd) - multires_mark_as_modified(ob, MULTIRES_COORDS_MODIFIED); + if (mmd != NULL) { + /* NOTE: SubdivCCG is living in the evaluated object. */ + Depsgraph *depsgraph = CTX_data_depsgraph(C); + Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); + multires_mark_as_modified(ob_eval, MULTIRES_COORDS_MODIFIED); + } DEG_id_tag_update(&ob->id, DEG_TAG_SHADING_UPDATE); |