Scripting Vizard settings from Basilisk
All scriptable Vizard settings live on theviz.settings object returned by enableUnityVisualization(). These settings are applied once at startup. If a setting is omitted, Vizard uses its own default.
For flag-type settings, use 1 to enable, -1 to disable, and 0 to defer to the Vizard default.
Selected startup settings
| Setting | Type | Description |
|---|---|---|
ambient | float 0–1 | Ambient scene lighting level |
spacecraftCSon | (-1, 0, 1) | Show spacecraft coordinate axes |
planetCSon | (-1, 0, 1) | Show planet coordinate axes |
showHillFrame | (-1, 0, 1) | Show Hill frame of the camera target spacecraft |
showVelocityFrame | (-1, 0, 1) | Show velocity frame of the camera target spacecraft |
orbitLinesOn | (-1, 0, 1, 2) | Show osculating orbit lines (1 = parent-body-relative, 2 = chief-relative) |
trueTrajectoryLinesOn | (-1, 0, 1–5) | Show true trajectory lines in various reference frames |
skyBox | string | Star background: "" for NASA SVS starmap, "ESO" for Milky Way, "black", or a file path |
atmospheresOff | (-1, 0, 1) | Disable planet atmosphere shaders |
mainCameraTarget | string | Spacecraft or celestial body to target at startup |
forceStartAtSpacecraftLocalView | (-1, 0, 1) | Lock the camera in spacecraft-centric view |
spacecraftSizeMultiplier | float > 0 | Scale spacecraft size in planet-centric view |
show24hrClock | (-1, 0, 1) | Use 24-hour mission clock |
showMissionTime | (-1, 0, 1) | Display mission date/time instead of elapsed time |
messageBufferSize | int (bytes) | Maximum vizMessages to load into memory; -1 forces loading the entire file |
customGUIReferenceHeight | float (pixels) | Override automatic GUI scale (must be > 300) |
Live settings
Some settings update with every message sent. Access them throughviz.liveSettings:
| Setting | Type | Description |
|---|---|---|
targetLineList | vector<PointLine> | Lines between two scenario objects, redrawn each time step |
relativeOrbitChief | string | Chief spacecraft for relative orbit calculations |
terminateVizard | bool | Shuts Vizard down cleanly when True |
playbackPaused | bool | Pauses Vizard playback |
playbackInRealTime | int | +1 for real-time, -1 for frame-rate |
playbackMultiplier | int | Sets playback speed to 2^n |
Pointing lines
A pointing line draws a colored heading arrow from one object to another. UsecreatePointLine() to script them:
fromBodyName parameter defaults to the primary spacecraft if omitted. The lineColor accepts a color name string or a four-element RGBA list with values 0–255.
Keep-in and keep-out cones
Cones indicate whether a body-fixed axis is within or outside a specified angle to a target body. UsecreateConeInOut():
isKeepIn=False for a keep-out cone. The cone turns solid when the constraint is violated.
Ground and satellite locations
UseaddLocation() to place a location marker on a planet or spacecraft and visualize line-of-sight links:
stationName must be unique. Call changeLocation() with the same arguments to update a location’s properties at runtime.
Actuator GUI options
Script the actuator panel and HUD visibility withsetActuatorGuiSetting():
Custom spacecraft appearance
OBJ/GLB model import
Script a custom model import so it applies every time the scenario runs:modelPath can be absolute or relative. Relative paths are resolved against the playback .bin file location for recorded scenarios, or the scenario’s working directory for live streaming.
You can also use built-in shape primitives instead of a file:
Custom textures
Apply a custom texture and optional normal map alongside the model:.jpg, .bmp, .exr, .gif, .hdr, .iff, .pict, .png, .psd, .tga, .tiff. Maximum image dimensions are 16384 × 16384 pixels.
Models applied to spacecraft are assumed to be in meters. Models applied to celestial bodies are assumed to be in kilometers.
Unity Addressable bundles
For complex models, build them into Unity Addressable bundles using the VizardPublicContent Unity project. This approach uses Unity’s internal model pre-processing pipeline, which gives better runtime performance than the OBJ importer.Determine the Unity version
Open Vizard, load a scenario, and go to
File > About Vizard to see the Unity version.Download and install the matching Unity Editor
Download the correct Unity Editor version from the Unity archive. Include build support for all target platforms (macOS, Linux, Windows).
Download the VizardPublicContent project
Download the VizardPublicContent Unity project and open it in Unity. If Unity warns about a version mismatch, select the installed version and continue.
Import and prepare your models
Follow the ImportingCustomModels guide to prepare your models for export.
Build and export the bundle
Follow the ExportingCustomModelBundles guide. Build a separate bundle for each target platform.
Install the bundle
Unzip the bundle and place its contents directly in the platform-specific
CustomModels directory. See Download for the correct path on each OS.Multi-spacecraft visualization
Pass a list of spacecraft objects toenableUnityVisualization(). Each spacecraft is identified by its ModelTag.
None entries keep the default circle sprite. Passing None as the spriteList argument entirely uses the default for all spacecraft.
Live communication modes
Vizard supports three live communication modes.liveStream
Basilisk and Vizard run in lockstep. After each time step, Basilisk waits for Vizard to acknowledge before continuing. This is the best mode for interactive local visualization.tcp://0.0.0.0:5556. You can change it:
DirectComm at the startup panel.
broadcastStream
Basilisk broadcasts read-only messages in a publish/subscribe pattern. Multiple Vizard instances can subscribe simultaneously. Basilisk does not wait for any subscriber to connect before executing.liveStream to interact with the simulation while students subscribe via broadcastStream:
tcp://0.0.0.0:5570. In Vizard, enter the broadcast address and select Receive Only.
noDisplay
Vizard runs headless and only renders the scene when an image is requested from Basilisk. This is a high-performance mode for optical navigation that does not show a graphical window.Interactive event panels
InliveStream mode you can display interactive dialog panels in Vizard and read the user’s responses back in Basilisk.
Creating a panel
Reading responses
Keyboard listeners
Register key listeners before starting the simulation:Vizard pre-assigns several keys as hot-keys for GUI actions. If you register a key that duplicates a hot-key, Vizard displays a warning and both actions will fire.
Command-line launching
You can launch Vizard from the terminal and pass arguments to control startup behavior. The examples below use macOS syntax with an application namedVizard.app in /Applications.
open command and application name for Linux or Windows.
Recording simulation output
To produce a Vizard-compatible binary recording from a Basilisk scenario, provide asaveFile name to enableUnityVisualization():
_VizFiles/myScenario_UnityViz.bin relative to the scenario directory. Pass a full path ending in .bin to specify the location explicitly.
You can also save messages from a running or completed Vizard session via File > Save Messages to File inside the application. This stores data to ~/VizardData/.
Simulation epoch
Vizard can show mission date/time in addition to elapsed simulation time. Set the epoch by subscribing thevizInterface module to an EpochMsgPayload message: