diff options
author | Mikhail Rachinskiy <mikhail.rachinskiy@gmail.com> | 2016-11-11 18:19:44 +0300 |
---|---|---|
committer | Mikhail Rachinskiy <mikhail.rachinskiy@gmail.com> | 2016-11-11 18:19:44 +0300 |
commit | 7df41339ae89c3281cb8d81f0b9d09c11aa266ae (patch) | |
tree | 98ed91c56f7ef3100af7d97730b0e233ee3a57d5 /object_print3d_utils/mesh_helpers.py | |
parent | 75ebeaff4c90b1b74cfcb4a15db509d82d9e04b2 (diff) |
Print3D: Fix for T49895
Diffstat (limited to 'object_print3d_utils/mesh_helpers.py')
-rw-r--r-- | object_print3d_utils/mesh_helpers.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/object_print3d_utils/mesh_helpers.py b/object_print3d_utils/mesh_helpers.py index 5c72f4e4..84d5ac74 100644 --- a/object_print3d_utils/mesh_helpers.py +++ b/object_print3d_utils/mesh_helpers.py @@ -157,12 +157,22 @@ def bmesh_check_thick_object(obj, thickness): # Convert new/old map to index dict. # Create a real mesh (lame!) - scene = bpy.context.scene + context = bpy.context + scene = context.scene me_tmp = bpy.data.meshes.new(name="~temp~") bm.to_mesh(me_tmp) # bm.free() # delay free obj_tmp = bpy.data.objects.new(name=me_tmp.name, object_data=me_tmp) - scene.objects.link(obj_tmp) + base = scene.objects.link(obj_tmp) + + # Add new object to local view layer + v3d = None + if context.space_data and context.space_data.type == 'VIEW_3D': + v3d = context.space_data + + if v3d and v3d.local_view: + base.layers_from_view(context.space_data) + scene.update() ray_cast = obj_tmp.ray_cast |