diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-06-13 20:56:25 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-06-13 21:14:19 +0300 |
commit | 45145e746d0b414b0d9d2db6182e26f226950efa (patch) | |
tree | 9bf93a23db1e4fe7817b4fb248b38c695c5315f6 /source/blender/blenkernel/intern | |
parent | 15dd2899923093db6c070b4520e0678affe49d09 (diff) |
Fix part of T63595: generated texture coordinates don't stick to deforming mesh
Always compute CD_ORCO undeformed coordinates now for rendering, same as before.
There is still a refresh issue to be fixed, when switching from solid to textured
mode in the viewport.
Computing such undeformed coordinates can be expensive and is not actually needed
if the mesh is only using e.g. UV maps. This was the same in 2.79, at least now we
are skipping the computation when there are no deforming mdifiers on the mesh.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/object_update.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c index 84e46f1ef70..6a6adb82225 100644 --- a/source/blender/blenkernel/intern/object_update.c +++ b/source/blender/blenkernel/intern/object_update.c @@ -168,13 +168,16 @@ void BKE_object_handle_data_update(Depsgraph *depsgraph, Scene *scene, Object *o CustomData_MeshMasks cddata_masks = scene->customdata_mask; CustomData_MeshMasks_update(&cddata_masks, &CD_MASK_BAREMESH); + if (DEG_get_mode(depsgraph) == DAG_EVAL_RENDER) { + /* Make sure Freestyle edge/face marks appear in DM for render (see T40315). */ #ifdef WITH_FREESTYLE - /* make sure Freestyle edge/face marks appear in DM for render (see T40315) */ - if (DEG_get_mode(depsgraph) != DAG_EVAL_VIEWPORT) { cddata_masks.emask |= CD_MASK_FREESTYLE_EDGE; cddata_masks.pmask |= CD_MASK_FREESTYLE_FACE; - } #endif + /* Always compute UVs, vertex colors as orcos for render. */ + cddata_masks.lmask |= CD_MASK_MLOOPUV | CD_MASK_MLOOPCOL; + cddata_masks.vmask |= CD_MASK_ORCO; + } if (em) { makeDerivedMesh(depsgraph, scene, ob, em, &cddata_masks); /* was CD_MASK_BAREMESH */ } |