Skip to content

Commit 51ea821

Browse files
committed
Maybe fixes wrong egl backend in some circumstances
1 parent 1bd25bc commit 51ea821

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

src/core.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -496,12 +496,24 @@ def run_3dphoto(device, img_rgb, img_depth, inputnames, outpath, gen_inpainted_m
496496
def run_3dphoto_videos(mesh_fi, basename, outpath, num_frames, fps, crop_border, traj_types, x_shift_range,
497497
y_shift_range, z_shift_range, video_postfix, vid_dolly, vid_format, vid_ssaa):
498498
import vispy
499-
if platform.system() == 'Windows':
500-
vispy.use(app='PyQt5')
501-
elif platform.system() == 'Darwin':
502-
vispy.use('PyQt6')
503-
else:
504-
vispy.use(app='egl')
499+
try:
500+
if platform.system() == 'Windows':
501+
vispy.use(app='PyQt5')
502+
elif platform.system() == 'Darwin':
503+
vispy.use('PyQt6')
504+
else:
505+
vispy.use(app='egl')
506+
except:
507+
import traceback
508+
print(traceback.format_exc())
509+
print('Trying an alternative...')
510+
for u in ['PyQt5', 'PyQt6', 'egl']:
511+
try:
512+
vispy.use(app=u)
513+
except:
514+
print(f'On {u}')
515+
print(traceback.format_exc())
516+
# Honestly, I don't know if it actually helps at all
505517

506518
# read ply
507519
global video_mesh_data, video_mesh_fn

0 commit comments

Comments
 (0)