m.nviz.script(1)
π m.nviz.script π
okay bestie, welcome to the GRASS GIS User's Manual page for m.nviz.script, and no cap this one is the movie-director module π¬β¨ she builds you a fly-through script that NVIZ then plays like a little cinematic masterpiece. main character energy fr fr π¦
πΈ NAME πΈ
m.nviz.script β creates a fly-through script to run in NVIZ. π₯
π KEYWORDS π
miscellaneous, graphics, raster, raster3d, vector, visualization
β¨ SYNOPSIS β¨
m.nviz.script
m.nviz.script --help
m.nviz.script [-fckoe] input=name output=name [name=string]
[route=east,north[,east,north,...]] dist=float ht=float frames=integer
[start=integer] [--overwrite] [--help] [--verbose] [--quiet]
[--ui]
π© Flags: π©
-fβ Full render β save those images πΎ-cβ Fly at constant elevation (ht)-kβ Include a command in the script that spits out a KeyFrame file π-oβ Render images off-screen-eβ Enable vector and sites drawing--overwriteβ let output files overwrite files that already exist (permission to be messy π )--helpβ print the usage summary--verboseβ verbose module output--quietβ quiet module output--uiβ force launching the GUI dialog
π§ Parameters: π§
input=name[required] β name of the input raster mapoutput=name[required] β name of the output scriptname=stringβ prefix of output images (default =NVIZ)route=east,north[,east,north,...]β route coordinates (east,north)dist=float[required] β camera layback distance (in map units)ht=float[required] β camera height above terrainframes=integer[required] β number of framesstart=integerβ start frame number (default=0)
π DESCRIPTION π
so m.nviz.script lets you easily create a script that can be run in NVIZ to fly through a terrain. ποΈ the NVIZ flight path can be handed to it right on the command line as comma separated coordinates. and then β the optional glow-up β the program can also create a KeyFrame file for you (after the script runs). that KeyFrame file can be loaded into the Keyframe Animation panel for fine tuning or editing. obsessed. π
the script that m.nviz.script generates can be run from the NVIZ command line (nviz script=script_name) or, once NVIZ is already up and running, by selecting Scripting->Play Script. periodt. β¨
π OPTIONS π
π© Flags: π©
-fβ Full render. the script will draw all loaded NVIZ data and save the scene to a PPM image. πΈ-cβ Fly at constant elevation. with this flag the camera gets set to an elevation given by theht=parameter. the default (no flag) is to fly atht=above the topography, i.e. camera height = elevation +ht. π«-kβ Output KeyFrame file. generates a KeyFrame file that can be loaded from the NVIZ Keyframe Animation panel. the KeyFrame file automatically gets the script name with a.kanimatorextension. π-oβ Render the animation in an off-screen context. π₯οΈ-eβ Enable vector and sites drawing. π¨
π§ Parameters: π§
inputβ the name of the GRASS raster map with elevation data. this should be the same file that will be loaded in NVIZ, ok? πoutputβ the name of the NVIZ script to create.nameβ the prefix for output images if running in full render mode (-f). the default prefix isNVIZ(eg.NVIZ0000.ppm). πΌοΈdistβ the distance of the camera behind the center of view.htβ the height of the camera above the center of view. if the-cflag is set, the height represents the actual camera height.framesβ the number of frames in the animation.startβ the starting frame number (default =0). this one is lowkey useful in full render mode when you're creating an animation in sections β like, maybe you wanna start at frame number 2000. ποΈrouteβ the comma separated geographic coordinates for keyframe locations.
π₯ EXAMPLE π₯
to interactively create an NVIZ animation from raster elev.rast with 500 frames and the camera set to 50 meters above and 250 meters behind the scene, run the following:
g.region raster=elevation.dem
d.rast elevation.dem
m.nviz.script -k input=elevation.dem output=nviz.script dist=2400 ht=1220 frames=1000
in the above example the user is prompted to select the route from the GRASS monitor. π the output script, nviz.script.nvscr, can then be run in NVIZ:
nviz elevation=elevation.dem script=nviz.script.nvscr
π«Ά NOTES / HINTS π«Ά
- the user must select at least four key-frame locations (points), otherwise an error is generated. four minimum bestie, them's the rules π¨
- if the GRASS region is changed, the
m.nviz.scriptcommand must be re-run. - the current GRASS region and the user supplied parameters are included as a comment at the top of the output script. this info can be used to easily re-create the animation. cute AND useful π
- the camera position is calculated backwards from the supplied position(s). it is possible that the camera position will lie outside the current window, in which case a non-fatal error is generated (
Error: selected point is outside region). this error can result in jerky movements during the animation π to fix it, reduce thedist=parameter or increase the current region.
π¦ Loading the script into NVIZ π¦
the user can run the script at arbitrary resolution. to re-run it at higher spatial resolution or with different settings, you first load the surface and set the resolution, lighting, etc. then internally the script generated by m.nviz.script is run. alternatively, you can run nviz with a previously saved state plus the m.nviz.script generated script:
nviz state=saved.state script=nviz.script.nvscr
π Keyframe animator script π
running the script generated by m.nviz.script within NVIZ creates a new script for kanimator (keyframe animator). the kanimator panel offers fine tuning of the speed (frame rate) as well as editing individual frames or inserting new frames. this new kanimator script has to be loaded from the Kanimator panel in NVIZ. in the Kanimator panel there are Save and Load buttons which let the user save and re-load a kanimator script. once loaded, the key frames will appear in the GUI and can then be edited there. iconic β¨
β SEE ALSO β
wxGUI 3D viewer (NVIZ)
π AUTHOR π
Bob Covill
π SOURCE CODE π
available at: m.nviz.script source code (history)
accessed: Saturday Jan 17 05:41:37 2026
main index | miscellaneous index | topics index | keywords index | graphical index | full index
Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual
and that's the whole page bestie π₯Ήπ this was GRASS 8.4.2 of the Reference Manual, accessed Saturday Jan 17 05:41:37 2026, brought to you by the Β© 2003-2025 GRASS Development Team. now go make that animation, you absolute legend π π¬β¨
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms