python module compilation fixes

This commit is contained in:
Daniele Panozzo
2018-02-14 11:30:19 -04:00
parent d052e7c9a6
commit 08f7f8cb6b
5 changed files with 23 additions and 11 deletions
+7 -7
View File
@@ -13,7 +13,7 @@ import pyigl as igl
from shared import TUTORIAL_SHARED_PATH, check_dependencies
dependencies = ["viewer"]
dependencies = ["glfw"]
check_dependencies(dependencies)
@@ -28,15 +28,15 @@ def key_pressed(viewer, key, modifier):
if key == ord('1'):
# # Clear should be called before drawing the mesh
viewer.data.clear()
viewer.data().clear()
# # Draw_mesh creates or updates the vertices and faces of the displayed mesh.
# # If a mesh is already displayed, draw_mesh returns an error if the given V and
# # F have size different than the current ones
viewer.data.set_mesh(V1, F1)
viewer.data().set_mesh(V1, F1)
viewer.core.align_camera_center(V1,F1)
elif key == ord('2'):
viewer.data.clear()
viewer.data.set_mesh(V2, F2)
viewer.data().clear()
viewer.data().set_mesh(V2, F2)
viewer.core.align_camera_center(V2,F2)
return False
@@ -48,10 +48,10 @@ igl.readOFF(TUTORIAL_SHARED_PATH + "fertility.off", V2, F2)
print("1 Switch to bump mesh")
print("2 Switch to fertility mesh")
viewer = igl.viewer.Viewer()
viewer = igl.glfw.Viewer()
# Register a keyboard callback that allows to switch between
# the two loaded meshes
viewer.callback_key_pressed = key_pressed
viewer.data.set_mesh(V1, F1)
viewer.data().set_mesh(V1, F1)
viewer.launch()