Simulation freezes after exiting fullscreen mode in VR Sink (Simulink Desktop Real-Time)

8 views (last 30 days)
Hi everyone,
I’m running a Simulink Desktop Real-Time model that includes a VR Sink block (from Simulink 3D Animation) to display a virtual world. Everything works fine until I open the VR viewer in fullscreen mode.
When I exit fullscreen, MATLAB immediately shows an error in the Command Window, and the simulation freezes, it doesn’t continue running, and I have to stop and restart the model manually.
This happens consistently. Here are some details about my setup:
  • MATLAB version: R2024b
  • Simulation mode: Simulink Desktop Real-Time (External mode)
  • run in Kernel
I’m aware that in newer releases (R2025a and later) the VR Sink and related blocks are no longer supported, replaced by the new Simscape / Simulation 3D environment. However, I must use Simulink Desktop Real-Time, which currently does not support the new 3D blocks, so updating is not a viable option for my setup.
I need fullscreen rendering for human–VR interaction experiments, so I can’t avoid fullscreen mode.
Has anyone encountered this problem before? Is there a known workaround or patch for using fullscreen in VR Sink + Simulink Desktop Real-Time?
Thanks in advance for any suggestion or insight!

Answers (1)

Jan Houska
Jan Houska about 8 hours ago
Hi Giada,
could you please post the exact text of the error shown in the Command Window when you exit fullscreen mode? This will likely help to understand what's going on there.
Thanks, Jan
  1 Comment
Giada Parodi
Giada Parodi 37 minutes ago
Edited: Giada Parodi 36 minutes ago
Hi Jan,
here is the error:
Error:Error in 'AP_model_hman_red_giada/VR Sink' while executing C MEX S-function 'vrsfunc', (mdlOutputs), at time 57.0.
Caused by:
Error in vr.canvas callback "changeFullscreen":
Undefined function 'createuicontextmenu' for input arguments of type 'vr.canvas'.
Error in vr.canvas/createNewCanvasContainer (line 1188)
createuicontextmenu(obj, vrfigure.Videopreview);
Error in vr.figure/changeFullscreen (line 1666)
createNewCanvasContainer(obj.canvas, obj);
Error in vr.callbacks (line 259)
changeFullscreen(vrfigure, arg);
Error in Experiment_V2 (line 421)
pause(0.1)
BUT the problem in general is that when I exit the full screen mode (even if I don't have the error), and I want to stop the simulation, simulink freezes and doesn't answer anymore, so I need to do the forced shoutdown (end task), and every time it's a bit frustrating.
thanks

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!