Fix T60683, T60662: Cycles render crash in edit mode for certain meshes.

This commit is contained in:
Brecht Van Lommel 2019-01-21 15:34:34 +01:00
parent 14b5668c60
commit a6e6ad0756
Notes: blender-bot 2024-04-11 14:26:06 +02:00
Referenced by issue #61055, Crash on windows when entering edit mode in Rendered viewport shading
Referenced by issue #60762, Extra ghost edge per ngon in UV editor on Intel HD gfx
Referenced by issue #60683, Repeatable Software Crash during BAKE Ambient Occlusion operation in Cycles Render Mode
Referenced by issue #60662, Crash when going into 3D view: Rendered or by hitting render F12 for certain blend file.
Referenced by issue #60654, 2.80 Cycles crash when render a particular project.
1 changed files with 6 additions and 2 deletions

View File

@ -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);
}
}