SAVEVIEW(nged)
Write the current MGED view and displayed objects to an executable raytrace script.
πΎ SAVEVIEW(nged) β or, "bestie, save this view before you lose it" β¨
okay so this is a page from the BRL-CAD user commands, and honestly? it's a whole little lifesaver. it lives in nged (that's the MGED manual section, iykyk) and it's called saveview.
πΈ NAME πΈ
saveview β writes the current MGED view and the objects you've got displayed out to an executable raytrace script π
like, it literally takes your vibe right now and saves it as a runnable shell script. iconic behavior.
π SYNOPSIS π
saveview [-e command] [-i input.g] [-l logfile] [-o output] filename [args]
π¦ DESCRIPTION π¦
okay so here's the tea β β saveview writes a shell script that describes the current MGED view plus all the objects currently displayed. when you run that generated script, it runs a command in -M mode, and it feeds the saved viewing parameters straight into that command on standard input. cute, right?
by default, the generated script runs rt -M. and if perspective is enabled in your current view? the script also adds the matching -p option. no cap, it just knows. π₯
any extra args you toss in after filename get copied into the generated command line unchanged. like, character for character, bestie, it does not touch them.
β οΈ heads up: the script gets opened in append mode. if filename already exists, the new script block is just appended onto the existing file. also, the file gets marked executable. so likeβ¦ don't be surprised when your file grows π
unless you override them, the script does all of this:
- writes image output to a file derived from
filenamewith.pixappended - writes stderr output to a file derived from
filenamewith.logappended - uses the currently opened database file as the geometry input
- includes the currently displayed objects as the raytrace object list
and here's a lil detail that's lowkey important π: when it's deriving those default .pix and .log names, a trailing .sh suffix gets removed from filename first, if it's there. so 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. see? it's giving attention to detail. π
the following options are supported:
-e commandβ runcommandinstead ofrt. the command gets invoked with-M. and psst β ifcommandbegins withnirt,saveviewdoes not emit a default-ooutput option π«Ά-i input.gβ useinput.gin the generated script instead of the currently opened database pathname-l logfileβ write the stderr redirection tologfileinstead 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 you need to reproduce the current display, including view size, orientation, eye point, and the displayed object list. and the scripts saveview generates can be read right back into MGED with loadview to restore the same view and the same displayed objects. round trip slay π
π 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.
π AUTHOR π
BRL-CAD Team π«‘
π BUG REPORTS π
reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org β like, pls tell them, they wanna know, fr fr π
and that's the whole page, bestie π this little gem comes to you courtesy of BRL-CAD, and the footer on the original says SAVEVIEW(nged) β go forth and save those views π
π¦ where this page comes from
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms