Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-01-21 17:34:34 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-01-21 18:10:00 +0300
commita6e6ad07563738b641c9df9e8c48ec0cf9342068 (patch)
tree6206fe74d7cce09a07fe2c8117f1c6ec6b781bc7 /intern/cycles/blender/blender_util.h
parent14b5668c6017965df85b633a0f1cae1646a6bb37 (diff)
Fix T60683, T60662: Cycles render crash in edit mode for certain meshes.
Diffstat (limited to 'intern/cycles/blender/blender_util.h')
-rw-r--r--intern/cycles/blender/blender_util.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h
index d3a8b935a6c..1b9e1911591 100644
--- a/intern/cycles/blender/blender_util.h
+++ b/intern/cycles/blender/blender_util.h
@@ -71,8 +71,12 @@ static inline BL::Mesh object_to_mesh(BL::BlendData& data,
/* TODO: calc_undeformed is not used. */
mesh = BL::Mesh(object.data());
- /* Make a copy to split faces if we use autosmooth, otherwise not needed. */
- if (mesh.use_auto_smooth() && subdivision_type == Mesh::SUBDIVISION_NONE) {
+ /* Make a copy to split faces if we use autosmooth, otherwise not needed.
+ * Also in edit mode do we need to make a copy, to ensure data layers like
+ * UV are not empty. */
+ if (mesh.is_editmode() ||
+ (mesh.use_auto_smooth() && subdivision_type == Mesh::SUBDIVISION_NONE))
+ {
mesh = data.meshes.new_from_object(depsgraph, object, false, false);
}
}