Skip to documentation
DocumentationAll documentsEnglish

SAVEVIEW(nged)

NAME

saveview - Write the current MGED view and displayed objects to an executable raytrace script.

On this page

SYNOPSIS

saveview [-e command] [-i input.g] [-l logfile] [-o output] filename [args]

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 .pix appended;

  • writes stderr output to a file derived from filename with .log appended;

  • 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 with nirt, saveview does not emit a default -o output 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 .log file.

  • -o output - Pass -o output to the generated command instead of the default derived .pix file.

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.

Example 1. Write a default raytrace script for the current view.

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.

Example 2. Write a script that passes an explicit image size to the generated raytrace command.

mged>saveview render.rt -s1024

Appends a script to render.rt and passes -s1024 through to the generated raytrace command.

Example 3. Write a script that runs 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