[Bf-extensions-cvs] [7df4133] master: Print3D: Fix for T49895
Mikhail Rachinskiy
noreply at git.blender.org
Fri Nov 11 16:21:13 CET 2016
Commit: 7df41339ae89c3281cb8d81f0b9d09c11aa266ae
Author: Mikhail Rachinskiy
Date: Fri Nov 11 19:19:44 2016 +0400
Branches: master
https://developer.blender.org/rBA7df41339ae89c3281cb8d81f0b9d09c11aa266ae
Print3D: Fix for T49895
===================================================================
M object_print3d_utils/__init__.py
M object_print3d_utils/mesh_helpers.py
===================================================================
diff --git a/object_print3d_utils/__init__.py b/object_print3d_utils/__init__.py
index 6ccca8d..60c903c 100644
--- a/object_print3d_utils/__init__.py
+++ b/object_print3d_utils/__init__.py
@@ -35,6 +35,7 @@ if "bpy" in locals():
import importlib
importlib.reload(ui)
importlib.reload(operators)
+ importlib.reload(mesh_helpers)
else:
import bpy
from bpy.props import (
diff --git a/object_print3d_utils/mesh_helpers.py b/object_print3d_utils/mesh_helpers.py
index 5c72f4e..84d5ac7 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
More information about the Bf-extensions-cvs
mailing list