diff options
author | mano-wii <germano.costa@ig.com.br> | 2018-11-01 06:48:37 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2018-11-01 06:48:37 +0300 |
commit | d2734f0a8e400f7f4d082a5f9119e21a888242be (patch) | |
tree | 706d57fd06b82ebcb66c3e4fda363c58e574ec4d /mesh_snap_utilities_line/common_classes.py | |
parent | 2f1fe59d88db13d2a51d2d23617f9e19f54cf9f1 (diff) |
Snap Utilties Line: fix error messages
Diffstat (limited to 'mesh_snap_utilities_line/common_classes.py')
-rw-r--r-- | mesh_snap_utilities_line/common_classes.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/mesh_snap_utilities_line/common_classes.py b/mesh_snap_utilities_line/common_classes.py index 9a968862..aad68b8b 100644 --- a/mesh_snap_utilities_line/common_classes.py +++ b/mesh_snap_utilities_line/common_classes.py @@ -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) - - 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) + 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) # restore opengl defaults bgl.glEnable(bgl.GL_DEPTH_TEST) |