From 45145e746d0b414b0d9d2db6182e26f226950efa Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 13 Jun 2019 19:56:25 +0200 Subject: 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. --- source/blender/blenkernel/intern/object_update.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/blender/blenkernel/intern/object_update.c') 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 */ } -- cgit v1.2.3