Skip to content
Snippets Groups Projects
Commit d2734f0a authored by mano-wii's avatar mano-wii
Browse files

Snap Utilties Line: fix error messages

parent 2f1fe59d
No related branches found
No related tags found
No related merge requests found
...@@ -189,13 +189,14 @@ class SnapDrawn(): ...@@ -189,13 +189,14 @@ class SnapDrawn():
bgl.glLineWidth(1.0) bgl.glLineWidth(1.0)
elif isinstance(elem, BMFace): elif isinstance(elem, BMFace):
face_color = self.face_color[0], self.face_color[1], self.face_color[2], self.face_color[3] * 0.2 if len(snap_obj.data) == 2:
self._program_unif_col.uniform_float("color", face_color) 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) tris = snap_obj.data[1].get_loop_tri_co_by_bmface(bm, elem)
batch = self.batch_triangles_create(tris) tris.shape = (-1, 3)
batch.draw(self._program_unif_col) batch = self.batch_triangles_create(tris)
batch.draw(self._program_unif_col)
# restore opengl defaults # restore opengl defaults
bgl.glEnable(bgl.GL_DEPTH_TEST) bgl.glEnable(bgl.GL_DEPTH_TEST)
......
...@@ -445,7 +445,7 @@ class SnapUtilitiesLine(bpy.types.Operator): ...@@ -445,7 +445,7 @@ class SnapUtilitiesLine(bpy.types.Operator):
#Modify the current state #Modify the current state
bpy.ops.mesh.select_all(action='DESELECT') bpy.ops.mesh.select_all(action='DESELECT')
context.user_preferences.view.use_rotate_around_active = True 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 context.space_data.overlay.show_face_center = True
#Store values from 3d view context #Store values from 3d view context
...@@ -496,7 +496,7 @@ class SnapUtilitiesLine(bpy.types.Operator): ...@@ -496,7 +496,7 @@ class SnapUtilitiesLine(bpy.types.Operator):
self.sctx.set_pixel_dist(12) self.sctx.set_pixel_dist(12)
self.sctx.use_clip_planes(True) self.sctx.use_clip_planes(True)
if self.outer_verts: if preferences.outer_verts:
for base in context.visible_bases: for base in context.visible_bases:
self.sctx.add_obj(base.object, base.object.matrix_world) self.sctx.add_obj(base.object, base.object.matrix_world)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment