diff options
-rw-r--r-- | intern/cycles/blender/blender_util.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h index b2046b290b2..2c83ee6c2b5 100644 --- a/intern/cycles/blender/blender_util.h +++ b/intern/cycles/blender/blender_util.h @@ -43,10 +43,12 @@ void python_thread_state_restore(void **python_thread_state); static inline BL::Mesh object_to_mesh(BL::BlendData data, BL::Object object, BL::Scene scene, bool apply_modifiers, bool render, bool calc_undeformed) { BL::Mesh me = data.meshes.new_from_object(scene, object, apply_modifiers, (render)? 2: 1, false, calc_undeformed); - if (me.use_auto_smooth()) { - me.calc_normals_split(me.auto_smooth_angle()); + if ((bool)me) { + if (me.use_auto_smooth()) { + me.calc_normals_split(me.auto_smooth_angle()); + } + me.calc_tessface(); } - me.calc_tessface(); return me; } |