| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink 3D Animation |
| Contents | Index |
| Learn more about Simulink 3D Animation |
x = vrgetpref
x = vrgetpref('preference_name')
x = vrgetpref('preference_name','factory')
x = vrgetpref('factory')
preference_name | Name of the preference to read. |
x = vrgetpref returns the values of all the Simulink 3D Animation preferences in a structure array.
x = vrgetpref('preference_name') returns the value of the specified preference. If preference_name is a cell array of preference names, a cell array of corresponding preference values is returned.
x = vrgetpref('preference_name','factory') returns the default value for the specified preference.
x = vrgetpref('factory') returns the default values for all the preferences.
The following preferences are defined. For preferences that begin with the string DefaultFigure or DefaultWorld, these values are the default values for the corresponding vrfigure or vrworld property:
| Preference | Description |
|---|---|
DataTypeBool | Specifies the handling of the VRML Bool data type for vrnode/setfield and vrnode/getfield. Valid values are 'logical' and 'char'. If set to 'logical', the VRML Bool data type is returned as a logical value. If set to 'char', the Bool data type is returned 'on' or 'off'. Default is 'logical'. |
DataTypeInt32 | Specifies handling of the VRML Int32 data type for vrnode/setfield and vrnode/getfield. Valid values are 'int32' and 'double'. If set to 'int32', the VRML Int32 data type is returned as int32. If set to 'double', the Int32 data type is returned as 'double'. Default is 'double'. |
DataTypeFloat | Specifies the handling of the VRML float data type for vrnode/setfield and vrnode/getfield. Valid values are 'single' and 'double'. If set to 'single', the VRML Float and Color data types are returned as 'single'. If set to 'double', the Float and Color data types are returned as 'double'. Default is 'double'. |
DefaultCanvasNavPanel | Controls the appearance of the control panel in the vr.canvas object. Values are:
Default: 'none' |
DefaultCanvasUnits | Specifies default units for new vr.canvas objects. See vr.canvas for detailed description. Default is 'normalized'. |
DefaultFigureAnti | Determines whether antialiasing is used by default for new vrfigure objects. This preference also applies to new vr.canvas objects. Valid values are 'off' and 'on'. |
DefaultFigureCapture | Specifies default file name for vr.capture files. See vrfigure/get for detailed description. Default is '%f_anim_%n.tif'. |
DefaultFigureDeleteFcn | Specifies the default callback invoked when closing a vrfigure object. |
DefaultFigureLighting | Specifies whether the lights are rendered by default for new vrfigure objects. This preference also applies to new vr.canvas objects. Valid values are 'off' and 'on'. |
DefaultFigureMax | Specifies the default maximum size of a texture used in rendering new vrfigure objects. This preference also applies to new vr.canvas objects. Valid values are 'auto' and 32 <= x <= video card limit, where x is a power of 2. |
DefaultFigureNavPanel | Specifies the default appearance of the control panel in the viewer. Valid values are 'opaque', 'translucent', 'none', 'halfbar', 'bar', and 'factory'. Default is 'halfbar'. |
DefaultFigureNavZones | Specifies whether the navigation zone is on or off by default for new vrfigure objects. This preference also applies to new vr.canvas objects. Valid values are 'off' and 'on'. |
DefaultFigurePosition | Sets the default initial position and size of the Simulink 3D Animation viewer window. Valid value is a vector of four doubles. |
DefaultFigureRecord2D | Specifies the default compression method for creating 2-D animation files for new vrfigure objects. Valid values are '', 'auto', 'lossless', and 'codec_code'. |
DefaultFigureRecord2D | Specifies the default quality of 2-D animation file compression for new vrfigure objects. Valid values are 0-100. |
DefaultFigureRecord2D | Specifies the default 2-D offline animation file name for new vrfigure objects. |
DefaultFigureRecord2DFPS | Specifies the default frames per second playback speed. |
DefaultFigureStatusBar | Specifies whether the status bar appears by default at the bottom of the Simulink 3D Animation viewer for new vrfigure objects. Valid values are 'off' and 'on'. |
DefaultFigureTextures | Specifies whether textures should be rendered by default for new vrfigure objects. This preference also applies to new vr.canvas objects. See vrfigure/get for detailed description. Default is 'on'. |
DefaultFigureToolBar | Specifies whether the toolbar appears by default on the Simulink 3D Animation viewer for new vrfigure objects. Valid values are 'off' and 'on'. |
DefaultFigure | Specifies whether or not transparency information is taken into account when rendering for new vrfigure objects. This preference also applies to new vr.canvas objects. Valid values are 'off' and 'on'. |
DefaultFigureWireframe | Specifies whether objects are drawn as solids or wireframes by default for new vrfigure objects. This preference also applies to new vr.canvas objects. Valid values are 'off' and 'on'. |
DefaultViewer | Specifies which viewer is used to view a virtual scene.
|
DefaultWorldRecord3D | Specifies the default 3-D animation file name for new vrworld objects. |
DefaultWorldRecordMode | Specifies the default animation recording mode for new vrworld objects. Valid values are 'manual' and 'scheduled'. |
DefaultWorldRecord | Specifies the default start and stop times for scheduled animation recording for new vrworld objects. Valid value is a vector of two doubles. |
DefaultWorldRemoteView | Specifies whether the virtual world is enabled by default for remote viewing for new vrworld objects. Valid values are 'off' and 'on'. |
DefaultWorldTimeSource | Specifies the default source of the time for new vrworld objects. Valid values are 'external' and 'freerun'. |
Editor | Path to the VRML editor. If this path is empty, the MATLAB editor is used. |
HttpPort | IP port number used to access the Simulink 3D Animation server over the Web via HTTP. If you change this preference, you must restart the MATLAB software before the change takes effect. |
TransportBuffer | Length of the transport buffer (network packet overlay) for communication between the Simulink 3D Animation server and its clients. |
TransportTimeout | Amount of time the Simulink 3D Animationserver waits for a reply from the client. If there is no response from the client, the Simulink 3D Animation server disconnects from the client. |
VrPort | IP port used for communication between the Simulink 3D Animation server and its clients. If you change this preference, you must restart the MATLAB software before the change takes effect. |
The HttpPort, VrPort, and TransportBuffer preferences affect Web-based viewing of virtual worlds. DefaultFigurePosition and DefaultNavPanel affect the Simulink 3D Animation viewer.
DefaultFigureNavPanel — Controls the appearance of the navigation panel in the Simulink 3D Animation viewer. For example, setting this value to 'translucent' causes the navigation panel to appear translucent.
DefaultViewer — Determines whether the virtual scene appears in the default Simulink 3D Animation viewer, based on MATLAB figure windows, the legacy Simulink 3D Animation viewer, or in your Web browser.
| DefaultViewer Setting | Description |
|---|---|
'internal' | Default Simulink 3D Animation viewer. This is the same as setting the value to 'internalv5' for all platforms except the Linux platform. |
'internalv4' | Simulink 3D Animation viewer that is the previous default viewer for most platforms. This viewer continues to be the default viewer for Linux platforms. |
'internalv5' | Viewer based on MATLAB figure windows. |
'web' | Viewer is the default Web browser with the VRML plug-in. |
Note If you are running the Simulink 3D Animation software on a Linux platform, the default viewer continues to be legacy viewer, which does not support MATLAB figures. If you have a Linux platform and want to access the MATLAB figure capability, you must install the hardware-accelerated OpenGL rendering engine. Otherwise, the Simulink 3D Animation software cannot properly display the viewer. You can then activate the viewer by using vrsetpref to set the DefaultViewer property to 'internalv5'. |
Editor — Contains a path to the VRML editor executable file. When you use the edit command, Simulink 3D Animation runs the VRML editor executable with all parameters required to edit the VRML file.
When you run the editor, Simulink 3D Animation uses the Editor preference value as if you typed it into a command line. The following tokens are interpreted:
%matlabroot | Refers to the MATLAB root folder |
%file | Refers to the VRML file name |
For instance, a possible value for the Editor preference is
`%matlabroot\bin\win32\meditor.exe %file'
If this preference is empty, the MATLAB editor is used.
HttpPort -- Specifies the network port to be used for Web access. The port is given in the Web URL as follows:
http://server.name:port_number
The default value of this preference is 8123.
TransportBuffer — Defines the size of the message window for client-server communication. This value determines how many messages, at a maximum, can travel between the client and the server at one time.
Generally, higher values for this preference make the animation run more smoothly, but with longer reaction times. (More messages in the line create a buffer that compensates for the unbalanced delays of the network transfer.)
The default value is 5, which is optimal for most purposes. You should change this value only if the animation is significantly distorted or the reaction times are very slow. On fast connections, where delays are introduced more by the client rendering speed, this value has very little effect. Viewing on a host computer is equivalent to an extremely fast connection. On slow connections, the correct value can improve the rendering speed significantly but, of course, the absolute maximum is determined by the maximum connection throughput.
VrPort — Specifies the network port to use for communication between the Simulink 3D Animation server (host computer) and its clients (client computers). Normally, this communication is completely invisible to the user. However, if you view a virtual world from a client computer, you might need to configure the security network system (firewall) so that it allows connections on this port. The default value of this preference is 8124.
![]() | vrgcf | vrinstall | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |