Setting Preferences and Customizing Shake |
This page has six sections:
Where to Put .h Files and Custom Icons |
You can create your own preference files to either add to or change Shake's performance. To add your own files, create the following directory subtree:
<somewhere>/include/startup/ui.
"Somewhere" can be one or more of three possible locations (searched in the order they are listed below):
Files that change performance or add macros (see below) are always located in <somewhere>/include/startup, and have a .h file extension, i.e.,
/usr/people/me/nreal/include/startup/memory_settings.h
I refer to this directory in the documentation as the startup Directory, or as $NR_INCLUDE_PATH/startup.
Files that change the interface in some way (see below) are always located in <somewhere>/include/startup/ui, and have a .h file extension, i.e.,
/usr/people/me/nreal/include/startup/ui/slider_settings.h
I refer to this directory as the ui Directory, or as $NR_INCLUDE_PATH/startup/ui.
Files that change additional default settings or add extra controls are in the templates directory, which is always under a ui directory:
/usr/people/me/nreal/include/startup/ui/templates/defaultfilter.h
All of these files can have any name, except "nreal.h" or "nrui.h", which are reserved files used by Shake as the standard list of functions and settings. Also, they must have the .h extension, so a fast way of disabling a file is to remove the extension.
Within a startup or startup/ui directory, files are loaded in no specific order. If it is important that a file gets loaded before another one, this can be accomplished by either:
#include <common.h>
#include <mystuff/loadmefirst.h>
#include <mystuff/nowloadthis.h>
#include <mystuff/andthistoo.h>
Include files are never loaded twice, so it's OK if two .h file contain the
same #include <somefile.h>
Just as you can create preference files, you can also create your own icons to be used. The description of the actual icons can be found below on the section on Changing the Interface. Icons can be found in one of 3 locations:
startup Files |
Shake comes with two important files in the <ShakeInstall>/include directory, nreal.h and nrui.h. The first file, nreal.h, lists out every single function and all of the default performance settings. This file should not be touched by the user, but may be read for reference on formatting. The commands found in this file can be copied and modified and placed in your startup Directory. The second file, nrui.h, contains all of the information to build the entire interface. It assigns menus names and listings, tabs, buttons, slider settings, every function connected to these items, and all of the default settings when they are called up in the GUI. The commands in this file can be copied and modified and placed in your ui Directory. As with the nreal.h file, you shouldn't modify this file, with one exception, which is listed below in ui Preference Files.
The following items are set in your startup Directory (see above), in any file ending with a .h (except the reserved names nreal.h and nrui.h). All of these commands can normally be found in the nreal.h file. I usually create one file for machine settings, and one file per macro. Simply add the lines to a file and save it. I have included the default values in the listings here. The // means that line is commented out and inactive.
A Sample Macro | |
image AngleBlur(image input, float angle = 0, float blur = 200) { R1 = Rotate(input, -R2.angle, 1, width/2, height/2, 0, 0.5, 0); B1 = Blur(R1, blur, 0, 1, "gauss", xFilter, "rgba"); R2 = Rotate(B1, angle, 1, width/2, height/2, 0, 0.5, 0); return R2; } |
|
This simple macro creates a blur at any angle that you set. We have declared it as an image macro, i.e., it will spit out an image, rather than a float, int, or string, and that its name is AngleBlur. In between the normal parentheses, we have declared three variables, input, angle and blur. input is an image variable, the others are floats (meaning a number with a decimal point). Then, in the curly parentheses, we have the body of the macro. The variable blur has been plugged into the xPixels parameter of Blur, and angle has been plugged into the angle parameter of R2, the second Rotate. input is declared to pass into the first Rotate command, R1. Finally, we are ensuring that R2 is output from the macro by assigning it to the return command. For more information, see the GUI tutorial.
|
|
Setting Memory Usage | |
cache.cacheMemory = 64; diskCache.cacheMemory = 64; |
|
These controls determine your memory allocations for rendering. See About Caching for detailed information.
|
|
Setting Cache Controls | |
// diskCache.cacheLocation = "/var/tmp/Shake/cache"; // for IRIX // diskCache.cacheLocation = "c:/temp/Shake/cache"; // for Windows NT // diskCache.cacheMaxFile = 2048; // diskCache.cacheMaxFileSize = 2048*2048*4*2; diskCache.cacheSize = 512; |
|
These lines control the size and location of the cache. By having different cache location files, and pointing to them with NR_INCLUDE_PATH, you can have multiple cache locations, based on different shots or projects.
For more information on caching, jump to About Caching. For information on tmp files created by Shake when rendering, jump to About I/O.
|
|
UNC File Path Naming Convention | |
script.uncFileNames = 1; |
|
When Shake reads in a file, it will automatically convert it to the UNC naming convention of //DeviceName/path....To turn this off, set this value to 0, which will give you the regular path to your image. Note that either mode recognizes and retains local file paths, i.e., ../pix/my_image.iff.
|
|
Default Frames Per Second | |
script.framesPerSecond = 24; |
|
To override this, use the framesPerSecond in the Global Parameters, or with -fps in the command line. You can also change the playback speed of a flipbook with the NumPad +/- keys - the fps is displayed in the title bar.
|
|
Default Video Resolution (for Shake Video) | |
// Valid resolutions are: // "NTSC 640x480" // "NTSC 720x486" // "PAL 720x576" // "PAL 768x576" script.videoResolution = "NTSC 640x480"; |
|
This sets the default ouput resolution for the Shake Video version. This is different from the defaultWidth and defaultHeight, which regulate the creation resolution of nodes like Grad and Ramp.
|
|
Assigning the default width or height to a parameter | |
image Black( int width=GetDefaultWidth(), int height=GetDefaultHeight(), float aspectRatio=GetDefaultAspect() ) |
|
These three commands will check the default global settings and return the value at the time of node creation; they are not dynamically linked. Therefore, if you change the default parameters, the node's values will not change. |
|
Setting the default amount of processors | |
sys.maxThread = nrcGetAvailableProcessors(); |
|
This sets the default number of processors you assign to Shake when running it interactively. You can either use a number, or use the default command which automatically assigns all availalbe processors to Shake. In the command-line mode, use the -cpus option, i.e., shake -exec my_script.shk -cpus 4
|
|
Cineon/Tiff Format Writing | |
script.cineonTopDown = 1; script.tiffTopDown = 1; |
|
Shake can support writing Cineons (.cin) and Tiff (.tif) either bottom-up or top-down. It is much faster to write from the bottom up, which would have a value of 0. However, most other software packages do not properly support the bottom-up version, so we set the default to the slower top-down method by setting this value to 1.
|
|
Setting Jpeg Image Quality | |
jpeg_quality=100; |
|
Sets the jpeg quality, 100 meaning 100% quality. You can also set an environment variable, jpeq_quality in a .tcshrc file.
|
|
Defining Custom Kernels | |
DefKernel( "smoothedge", 5, 5, 1, 0, -0.0625, -0.125, -0.25, -0.125, -0.0625, -0.125, -0.25, -0.5, -0.25, -0.125, -0.25, -0.5, 5.0, -0.5, -0.25, -0.125, -0.25, -0.5, -0.25, -0.1251, -0.0625, -0.125, -0.25, -0.125, -0.0625 ); |
|
You can define your own kernel with the DefKernel command. These kernels will then be automatically listed in the Filter - Convolve kernel list next you launch Shake. For more information on the kernel format, jump to Convolve.
|
|
Lightweight GUI Mode | ![]() |
sys.hardwareType = 1; | |
This command opens Shake without any borders on buttons, making the interactivity a little faster for graphically slower machines, like an O2. A value of 0 means the normal mode, a value of 1 gives you the lightweight mode.
|
|
If they do not appear to be working, refer to the following check list:
ui Files |
These files control the way the interface looks, but don't effect actual images themselves. A good test to see if a setup command should go into the startup Directory or the ui Directory is to ask yourself "Does this command change the image in some way, or does it make sense in a command-line mode?" If the answer is "Nope", then it is probably a ui Directory command. All of these commands go in a file with a .h ending in your include/startup/ui directory.
template Preference Files |
You can add additional parameters and default settings by adding files into the startup/ui/templates directory. Everytime Shake is launched, it will add these extra parameters. For example, if you always want the Proxy Filter to be "box" instead of "default", and you always want a slider in the Globals tab called switch1, create a .h file under the templates directory with:
SetProxyFilter("box");
curve int switch1=0;
Basically, take a saved script and strip out the lines you want to set as defaults, and save it as a .h file into templates. For a good example of using a template file to use pregenerated proxies, jump to the Cookbook's proxyToggle page.
Environment Variables for Shake |
setenv NR_CINEON_TOPDOWN
Cineon frames are written in the slower top-down method for compatibility with other less protocol-observant software.
setenv NR_INCLUDE_PATH /shots/show1/shake_settings
should have /shots/show1/shake_settings/include/startup/ui
Interface Devices and Styles |
If you are left-handed, set the mouse behavior within the OS itself. On the SGI, its is under the Desktop-Customize-Mouse page tab, and on NT, its under Start-Settings-Control Panel-Mouse.
With the menu command View: Spawn Viewer Desktop, you can create a new Viewer window that floats above the normal Shake interface. You can therefore move it to a second monitor, clearing up space on the first for node editing operations. This only works when both monitors are being driven by the card. Systems with two X servers running two graphics cards are not yet supported.
This is also a handy ui Directory command to automatically create the second Viewer Desktop:
gui.dualHead= 1; // This is an example of what you can do to open a second // viewer desktop on the other monitor. if(gui.dualHead) spawnViewerDesktop(1290,10,1260,960);
The Tremor-style interface, regardless if it is Shake or Tremor, is designed for a 1600-pixel wide interface. To set your resolution on an SGI, you can use either xsetmon, which is a graphical interface for setting it, or use the command-line setmon. This is SGI's thing, by the way...
To set your resolution, use the command 'setmon' in the command line,
AS ROOT:
/usr/gfx/setmon -x 1600x1024_72
The allowed values depend on your graphics card. If you are using an Octane
with MXI graphics, go to the
/usr/gfx/ucode/MGRAS/vof/2RSS/ directory to see the allowed choices.
In the case of the MXI Octance, you have:
1024x768_60.sdb 1280x1024_72.sdb
1024x768_60p.sdb 1280x1024_76.sdb 1024x768_72.sdb 1280x492_120s.sdb 1024x768_76.sdb 1280x960_30i.sdb 1024x768_96s.sdb 1600x1024_72.sdb 1024x768_96s_vs.sdb 1600x1200_60.sdb 1280x1024_49.sdb 1600x1200_60_32db.sdb 1280x1024_50.sdb 1920x1035_60.sdb 1280x1024_50_2f.sdb 1920x1080_60_32db_gdm24w.sdb 1280x1024_59.sdb 616x492_140os.sdb 1280x1024_60.sdb 640x480_60.sdb 1280x1024_60_2f.sdb 640x486_30i.sdb 1280x1024_60p.sdb 768x576_25i.sdb
So: /usr/gfx/setmon -x [settingFileWithoutExtension]
In both cases, you will have to log out and log in again. No reboot needed.