jgerstmayr / EXUDYN

Multibody Dynamics Simulation: Rigid and flexible multibody systems
https://www.youtube.com/channel/UCsQD2bIPBXB_4J23WtqKkVw/playlists
Other
166 stars 23 forks source link

VSCode and WSLg (Ubuntu20.04LTS) visualization crashes with mouse click (left and right) #47

Closed slyandsmart closed 1 year ago

slyandsmart commented 1 year ago

WSL with Ubuntu20.04LTS on Windows10 VSCode: 1.78.2 Python: 3.8.10 Exudyn: 1.6.119.dev1

Left and right mouse click on the visualization window crashes the simulation. No error code was given.

Setting the following disables the mouse click for selection and leads to no crash afterward. SC.visualizationSettings.interactive.selectionLeftMouse=False SC.visualizationSettings.interactive.selectionRightMouse=False

Zoom and view in the simulation is still possible.

jgerstmayr commented 1 year ago

It seems to be related to WSL version and possible the viewer mode. Can you add WSL version (possibly try updating WSL)? Which viewer do you use (standard WSL?) stable behavior is observed if you use (add this to .bashrc): export DISPLAY=:0 export LIBGL_ALWAYS_INDIRECT=0 The latter command slows down visualization for larger models or shadows but is rather stable.

Simply try visualization with: import exudyn exudyn.demos.Demo2()

jgerstmayr commented 1 year ago

for now, it seems to be the best solution to either use Windows or pure linux or to set SC.visualizationSettings.interactive.selectionLeftMouse=False SC.visualizationSettings.interactive.selectionRightMouse=False

jgerstmayr commented 1 year ago

This seems to be caused by OpenGL; resolved by setting: export LIBGL_ALWAYS_SOFTWARE=0 preferably, put this into your .bashrc