diff options
Diffstat (limited to 'intern/cycles/blender/blender_util.h')
-rw-r--r-- | intern/cycles/blender/blender_util.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h index 45ca0e17550..b2046b290b2 100644 --- a/intern/cycles/blender/blender_util.h +++ b/intern/cycles/blender/blender_util.h @@ -42,7 +42,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) { - return data.meshes.new_from_object(scene, object, apply_modifiers, (render)? 2: 1, true, 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()); + } + me.calc_tessface(); + return me; } static inline void colorramp_to_array(BL::ColorRamp ramp, float4 *data, int size) |