Apple Shake 4 User Manual

Page 920

Advertising
background image

920

Chapter 30

Installing and Creating Macros

The macro that is created in the following example is called VidResize. It takes an image
of any size and resizes it to video resolution. There are slider controls to specify NTSC or
PAL (vidformat), to maintain the aspect ratio (keepAspect), and if you do keep the
aspect ratio, the color of the exposed background area. The following image represents
the original node tree.

To create the VidResize macro:

1

Quit Shake.

2

To load the macro, copy the VidResize.h file from doc/html/cook/macros to your $HOME/
nreal/include/startup
directory.

3

Copy the VidResizeUI.h file from doc/html/cook/macros into your $HOME/nreal/include/
startup/ui
directory.

4

Start the Shake interface.

5

Create a Grad node with the following parameter settings:

Set the width to 400.

Set the height to 200.

6

Attach the Transform–VidResize node and test each slider. To have any effect, the
keepAspect parameter needs to jump to 2.

image VidResize(

image In=0,
int keepAspect = 1,//keeps aspect ratio or not
int vidFormat = 0, //This select NTSC (0) or PAL (1) res
float bgRed = 0,//if keeping aspect ratio, determines
float bgGreen =0,//the bg color
float bgBlue =0

)
{

curve int yRes = vidFormat ==0?486:576;
Fit1 = Fit(In, 720, yRes, “default”, xFilter, 1);
Resize1 = Resize(In, 720, yRes, “default”, 0);
SetBGColor1 = SetBGColor(Fit1, “rgbaz”,

Advertising