saveview [-e command] [-i input.g] [-l logfile] [-o output] filename [args]
SAVEVIEW(nged)
NAME
saveview - Write the current MGED view and displayed objects to an executable raytrace script.
On this page
SYNOPSIS
DESCRIPTION
The saveview command writes a shell script describing the current MGED view and the objects currently displayed. The generated script runs a command in -M mode, feeding it the saved viewing parameters on standard input.
By default, the generated script runs rt -M. If perspective is enabled in the current view, the script also adds the matching -p option. Any additional args supplied after filename are copied into the generated command line unchanged.
The script is opened in append mode. If filename already exists, the new script block is appended to the existing file. The file is also marked executable.
Unless overridden, the script:
-
writes image output to a file derived from filename with
.pixappended; -
writes stderr output to a file derived from filename with
.logappended; -
uses the currently opened database file as the geometry input;
-
includes the currently displayed objects as the raytrace object list.
When deriving default .pix and .log names, a trailing .sh suffix is removed from filename first, if present. For example, saveview render.sh defaults to render.pix and render.log, while saveview render.rt defaults to render.rt.pix and render.rt.log.
The following options are supported:
-
-e command - Run command instead of
rt. The command is invoked with-M. If command begins withnirt, saveview does not emit a default-ooutput option. -
-i input.g - Use input.g in the generated script instead of the currently opened database pathname.
-
-l logfile - Write stderr redirection to logfile instead of the default derived
.logfile. -
-o output - Pass
-o outputto the generated command instead of the default derived.pixfile.
The resulting script contains the view state needed to reproduce the current display, including view size, orientation, eye point, and the displayed object list. Scripts generated by saveview can be read back into MGED with loadview to restore the same view and displayed objects.
EXAMPLES
These examples show how saveview records the current MGED view into a reusable shell script.
mged>saveview render.rt
Appends an executable shell script to render.rt that runs rt -M on the currently displayed objects using the current view.
mged>saveview render.rt -s1024
Appends a script to render.rt and passes -s1024 through to the generated raytrace command.
nirt instead of rt.mged>saveview -e nirt raycast.sh
Appends an executable script to raycast.sh that runs nirt -M using the current MGED view.
SEE ALSO
view(nged)
AUTHOR
BRL-CAD Team
BUG REPORTS
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org