Snap Utilties Line: fix error messages

This commit is contained in:
Germano Cavalcante 2018-11-01 00:48:37 -03:00
parent 2f1fe59d88
commit d2734f0a8e
2 changed files with 9 additions and 8 deletions

View File

@ -189,13 +189,14 @@ class SnapDrawn():
bgl.glLineWidth(1.0)
elif isinstance(elem, BMFace):
face_color = self.face_color[0], self.face_color[1], self.face_color[2], self.face_color[3] * 0.2
self._program_unif_col.uniform_float("color", face_color)
if len(snap_obj.data) == 2:
face_color = self.face_color[0], self.face_color[1], self.face_color[2], self.face_color[3] * 0.2
self._program_unif_col.uniform_float("color", face_color)
tris = snap_obj.data[1].get_loop_tri_co_by_bmface(bm, elem)
tris.shape = (-1, 3)
batch = self.batch_triangles_create(tris)
batch.draw(self._program_unif_col)
tris = snap_obj.data[1].get_loop_tri_co_by_bmface(bm, elem)
tris.shape = (-1, 3)
batch = self.batch_triangles_create(tris)
batch.draw(self._program_unif_col)
# restore opengl defaults
bgl.glEnable(bgl.GL_DEPTH_TEST)

View File

@ -445,7 +445,7 @@ class SnapUtilitiesLine(bpy.types.Operator):
#Modify the current state
bpy.ops.mesh.select_all(action='DESELECT')
context.user_preferences.view.use_rotate_around_active = True
context.tool_settings.mesh_select_mode = (True, True, True)
context.tool_settings.mesh_select_mode = (True, False, True)
context.space_data.overlay.show_face_center = True
#Store values from 3d view context
@ -496,7 +496,7 @@ class SnapUtilitiesLine(bpy.types.Operator):
self.sctx.set_pixel_dist(12)
self.sctx.use_clip_planes(True)
if self.outer_verts:
if preferences.outer_verts:
for base in context.visible_bases:
self.sctx.add_obj(base.object, base.object.matrix_world)