Creating your own vluts and viewer scripts, Viewer keyboard shortcuts – Apple Shake 4 User Manual

Page 68

Advertising
background image

68

Chapter 1

An Overview of the Shake User Interface

Right-click the Viewer DOD button to access the DOD control options. For example,
using Frame DOD to Viewer (sets the DOD to the Viewer frame), you can zoom in on an
area you want to focus on and limit your DOD to that area. Note that the DOD is not
dynamic, as it would need to constantly recalculate as you pan. For more information,
see “

The Domain of Definition (DOD)

” on page 82.

Creating Your Own VLUTs and Viewer Scripts

The preset examples are stored in the end of the nreal.h file. To roll your own, you first
declare them in a startup directory following the same guidelines as for macros. The
following functions do absolutely nothing:

image ViewerLookup1_(image img)
{

return img;

}

image ViewerScript1_(image img)
{

return img;

}

Next, also in a startup file, hook them into the Viewers:

nfxDefViewerLookup(“Lookup1”, “ViewerLookup1_()”, “default”);

nfxDefViewerScript(“Script1”, “ViewerScript1_()”, “default”);

The first argument (“Lookup1”, “Script1”) is the name of the VLUT/Script as it appears in
the list in the interface. The second arguments (“ViewerLookup1_()”, “ViewerScript1_()”)
are the actual functions they call when activated. These must be declared in a startup .h
file. The third arguments are the optional icon files, relative to the icons/viewer
directory. It is assumed there is an .nri extension and that you also have a focused
version called [icon].focus.nri.

Therefore, if you want to load a button called icons/viewer/vluts/dufus.nri, you also
create a focused version called icons/viewer/vluts/dufus.focus.nri. You then use “vluts/
myVLUT” as your icon name. “default” means it is looking for [email protected], [email protected],
[email protected], and [email protected] (@ = 1, 2, 3, etc.). All paths are relative to icons/
viewer
. The icons for Viewer scripts are 30 x 30 pixels, no alpha. The standard VLUT
buttons are 51 x 30 pixels, no alpha. See “Other Macros–VLUT Button” in Chapter 32,
“The Cookbook.” Other macros required to run the VLUT Button macro can be found in
doc/html/cook/macros.

Viewer Keyboard Shortcuts

The following table contains additional Viewer hot keys.

Keyboard

Function

N

Create/Copy New Viewer.

F

Fit Image to Viewer.

Advertising