home *** CD-ROM | disk | FTP | other *** search
- K e y f r a m e C a l c u l a t o r
-
- CALC_I.KXP by Mark Meier
-
- A freeware IPAS Plug-In to allow users to keyframe objects and
- selection sets of objects using accurate AutoCAD type coordinate entry.
- The program is set up around a Reverse Polish Notation (RPN)
- Calculator. It is designed in this way to allow you to perform arithmetic
- on keyframe arguments, and to retrieve key information from objects
- and apply that information to other objects. Parameters for keyframe
- functions are placed on the calculator stack. This stack supports the
- following data types:
-
- - Real Numbers.
- - Points or Displacements (Width, Depth, Height).
- - Scale Factors (Width, Depth, Height).
- - Rotation Angles (Width, Depth, Height).
- - Mesh and Dummy Objects.
- - Selection Sets of Mesh and Dummy Objects.
- - RGB Color Quantities (For future use).
- - Transformation Matrices (For future use).
-
- Installation
-
- Below is a description of the files required and where to install them.
-
- The zip file CALC.ZIP contains eight files:
- README.TXT - ASCII information and tutorial file. I recommend you
- print this file (or README.DOC) to do the tutorial.
- README.DOC - A MS Word for Windows version of README.TXT.
- This version is much easier to read than README.TXT because of the
- use of multiple fonts. Use it if you are able to print it from your word
- processor.
- CALC_I.KXP - Place this file into the \3DS3\PROCESS directory
- CALC.SET - This file goes into C:\. This ASCII file contains some
- user alterable options such as default Tens/Cont/Bias. Currently the
- default Tension = 25, Continuity = 0 and Bias = 25. Read the file
- itself for more info if you need to changed these. (Note: I hope to
- eliminate the need to place these files into the fixed location C:\ in a
- future version)...
- CALC.KEY - This goes in the same place as CALC.SET. It contains
- the user defined key definitions you create. This is also an ASCII file
- and you may find it helpful to print it (it is less than a page in length).
- CALC.STR - This goes into the same place as CALC.SET. It contains
- the user defined stroke definitions you create.
- KC-DEMO.3DS - A demo file used in conjunction with the tutorial.
- Copy it into \3DS3\MESHES.
- KC-DEMO.TXT - A demo keyframe script file. Copy it into C:\.
-
- General Info:
-
- - There is a short tutorial which guides you through the basics of how to
- use the program. What is listed below will make more sense after you
- have done the tutorial, so don't get hung up here. Just quickly read
- through this portion.
- - The stack at the top of the dialog box is used to enter parameters for
- the keyframe functions. Numbers are entered into level 1 by simply
- typing and pressing ENTER. Valid characters for numeric entry are
- 0123456789./-',"<
- - You can Alt-Click on buttons in the dialog for brief on-line help. This
- will also show you any required parameters and their location on the
- stack.
- - If the stack is Clear (empty) you will be prompted for the required
- arguments when you execute the keyframe functions. If the stack is not
- empty, it is assumed you have loaded the stack with the proper
- arguments. If you want to keep the stack contents intact but still want to
- be prompted for the arguments, select the function with the Shift key
- held.
- - If the stack item in level 1 is too long to the shown in the stack window
- (an ellipses will appear), use the View Level 1 function. This will allow
- you to see the entire line. Also, if you need to edit a Selection Set,
- Matrix, or RGB Color, use View Level 1.
- - The Keyboard is programmable. Ctrl-Press the key you wish to assign
- (the keys A-Z are valid. Lowercase is the same as Uppercase.). You
- will be prompted to select a function to assign to this key. Now,
- whenever you want to execute this command, just press the key. You
- may also Alt-Press a key to see which function is assigned to it.
- - The left mouse button is used for selecting commands and dialog
- options. The right mouse button is used for 'Strokes'. This is a shape
- recognition algorithm which you can teach to execute program functions
- of your choosing.
- - For functions not available from the dialog box, press the TAB key or
- use the LIST function in the Functions: section of the dialog. This
- presents a list of all available functions. You may Alt- or Shift- click
- these choices just like buttons from the dialog (Press the Alt or Shift
- key _before_ you press TAB or LIST).
- - The button in the upper left corner of the dialog is used to quit the
- calculator. You can also press either the ESC or Q key to quit.
-
- Limitations of Version 1.0
-
- 3D Studio Release 3 is required. It won't run with r2.
-
- Position Keys:
- - Child objects cannot be keyframed for position. Parent or Unlinked
- objects are okay.
- - Spherical coordinates are unreliable when the radius is negative.
- Use Rectangular or Cylindrical to avoid problems or stick to positive
- distances.
-
- Rotation Keys:
- - The Angle specified must be greater than -360 degrees and less than
- 360 degrees.
- - Rotation keys cannot be created at frame 0.
-
- Tutorial:
-
- Calculator Layout:
-
- 1) Load the sample file KC-DEMO.3DS.
- 2) Press F4 to enter the Keyframer, press F12 and load CALC.
-
- The Calculator Dialog is divided into 5 sections:
-
- The top section is the stack display and prompt line (title line). Notice
- that the stack has 4 visible levels, labeled 1 through 4. This is where
- you enter parameters and arguments for the functions. The button in
- the upper left corner Quits the calculator. The button in the upper right
- corner hides the dialog box temporarily.
-
- The next section down contains the Keyframe functions: The
- Relative and Absolute buttons are radio buttons. They control
- how the program interprets the stack parameters for creating keyframes.
-
- The next section down contains the Stack Manipulation functions:
- These operations are used to create new items on the stack, or move
- existing items between stack levels.
-
- The next section down contains a subset of the available functions. You
- can use these functions to perform numerical operations on the stack
- contents. You can use the LIST button (or press TAB) to see the entire
- set.
-
- The last section contains the Display control functions. These
- functions let you control the display of the stack contents.
-
- Stack Manipulation:
-
- Before we get to the keyframing, lets go over a bit of how you enter
- values on the stack and move them around. The stack is eight levels
- high. Only 4 levels are visible. When you enter a new value, it goes
- into level 1, and pushes any existing data higher on the stack (into higher
- numbered levels). Try the following sequence:
-
- Press:
- 4 ENTER
- 3 ENTER
- 2 ENTER
- 1 ENTER
-
- You will see that these four numbers have been entered onto the stack.
- As you entered each one, the previous stack contents were lifted higher.
- Now use the Clear function located in the "Stack:" section.
-
- You will see that the entire contents of the stack are cleared. This is
- useful if you have a full stack, or are done using the current stack
- contents. Now execute the Last function (press the button labeled
- Last).
-
- You will see the previous (or "last") contents were restored to the stack.
- This is useful to recover any previous stack contents altered by functions
- you execute. At this point your stack should read:
-
- 4.00
- 3.00
- 2.00
- 1.00
-
- Now, lets try some of the stack movement operations. Press the 1<>2
- button. This causes stack levels 1 and 2 to be swapped, so 2.00 should
- now be in level one, and 1.00 should be in level 2. These level
- swapping functions are needed because arguments for commands are
- expected in specific stack levels, and based on the order of your data
- entry, you may need to re-organize the stack to get these arguments into
- the right order. There are two other types of stack movements
- commands labeled R-up arrow and R-dn-arrow. These 'Roll' the stack
- contents either up or down. Rolling down takes the higher levels and
- moves them down one level, and level 1 goes to the highest numbered
- level for example.
-
- You can use the BACKSPACE key to clear the item from level 1. Try
- this out. The items are dropped from the stack one by one.
-
- Lets now look at how to change the display of data on the stack. The
- functions in the Display section are used to accomplish this. Clear the
- stack (press Clear), and enter the following numbers:
-
- 4'5-3/16" ENTER
- 32.125 ENTER
- 0.25' ENTER
- -4 ENTER
-
- Your stack should look like this:
-
- Level 4: 4'-5 1/8"
- Level 3: 32.12
- Level 2: 0'-3"
- Level 1: -4.00
-
- Notice that the feet and inches values are rounded to the nearest 1/8".
- This is the default 'Maximum Denominator' for fractional display. Thus
- the 3/16" argument is formatted 4'5-1/8" (the largest fraction less
- than or equal to the maximum denominator). You will also notice that
- the decimal numbers are rounded to two decimal places not three as
- entered. To change the number of displayed decimal places, click on the
- arrow next to the 0.00 field in the Display section. The cursor changes
- to the up/dn arrow and as you move the mouse up and down, the format
- display changes from a minimum of 0 to a maximum of 0.000000.
- Use this function to format decimal numbers as you wish. Feet and Inch
- denominator formatting works the same way, moving between 1/1 and
- 1/256.
-
- You can also convert decimal number to feet and inches and vice versa.
- Level 1 should contain the number -4.00. Note that the radio buttons
- labeled Decimal and Feet & Inch control how the number is
- displayed. If you press the Feet & Inch button, the -4 will be
- formatted as -0'-4". If you press the Decimal button, the format is
- changed back to decimal. Note that only the contents of level 1 are
- altered by this conversion.
-
- Now lets take a look at how points may be formatted. You can create a
- point on the stack by entering it in one of four formats: Rectangular,
- Polar, Cylindrical or Spherical. Examples of each of these formats is
- listed below. Note in particular how the comma, minus sign, and less
- than sign are used as delimiters. AutoCAD users will already be
- familiar with this notation.
-
- Rectangular: Width, Depth, Height
- 0,0.5,2
- 0,0,5'
- 2'3",4'3-1/2",5"
- Polar: Distance<Angle in Plan
- 4'6"<45.6
- 5.125'<270.1
- Cylindrical: Distance<Angle in Plan, Height
- 4'<45,8'
- 5'<0,6.2"
- Spherical: Distance<Angle in Plan<Angle Up from Plan
- 4'<45<30.5
-
- The radio buttons REC, CYL, and SPH in the display section control the
- formatting of points. All points are stored internally as Rectangular, but
- you may display them in any format you like. (Note: Because the points
- are stored internally as Rectangular, point are 'normalized'. Basically
- the data may not be displayed exactly as you entered it, but the value
- implied is the same numerically).
-
- Rectangular format is used by all keyframe creation functions. For
- Position keys, you may also use Polar/Cylindrical and Spherical.
-
- In the case of Scale keys, the Width,Depth,Height portions of the
- Rectangular 'point' specify scale factors for each of Width/Depth/Height
- dimensions of the object.
-
- In the case of Rotation keys, the Width/Depth/Height specify rotation
- about the Local Axis of the object. This is the same as the Rotate/Object
- command in 3DS itself. (Note: You are limited to angles of rotation less
- than 360.0 and greater that -360.0).
-
- Creating Keyframes:
-
- Lets create a few kinds of keyframes. First, a Relative Position key.
- This function will move the object by the distance specified at the frame
- specified. We will also see how you can use the program to prompt you
- for all the required stack arguments.
-
- If you haven't already, Load the sample file KC-DEMO.3DS and run
- CALC.
-
- 1) Clear the stack and activate the Relative Radio button (if it is
- not already).
- 2) Press the Position button. Since the stack is clear, you are
- prompted for all required parameters.
- 3) The prompt Frame # appears. Enter 1.
- 4) Next, you are prompted for the Offset: Width, Depth, Height.
- Enter 16'4-3/4"<80,6'2". This is a Cylindrical coordinate. It
- specifies to move a distance of 16' 4-3/4" in plan at a 80 degree angle,
- and move up in height by 6'2".
- 5) Next, you will be prompted to create a selection set of objects. Click
- on Torus01 and then select OK.
-
- As soon as you select OK, the Position key is created. Notice the stack
- contents before you click Continue. In level 3 is the frame number. In
- level 2 is the offset distance. In level 1 is the Selection Set (Torus01).
- If you wanted to load the stack yourself, you would enter the parameters
- in the same order.
-
- If you need to review how to load up the stack, Alt-Click on the button
- in question. A dialog would appear which briefly describes the
- command. After you click Continue (or press Enter), the stack is
- redrawn in blue and white showing the required stack parameters in each
- level. This works for every command.
-
- 6) Press ESC to exit the calculator and go to frame 1. You will see that
- Torus01 has been moved by the amount you entered.
-
- Now lets Rotate a Selection Set of Objects.
-
- This will create identical rotation keys for each object in the selection
- set. This time, we will load up the stack manually, and then execute the
- command. We will Rotate all the Cube0? objects.
-
- 1) Press F12 and run CALC again.
- 2) First, enter the frame number on the stack, 1.
- 3) Next, we enter the rotation amounts. For this example type
- 45.05,45.05,0. This specifies a rotation of 45.05 degrees along
- each objects local Width and Depth axes, and zero rotation about each
- objects Height axis. Each object will rotate individually about its pivot
- point.
- 4) Next, press the Tag SelSet button and tag all the Cube0? objects
- (there are eight of them).
- 5) At this point, you should have the frame # in level 3, the rotation
- amount in level 2, and the selection set in level one.
-
- Level 3: 1.00
- Level 2: (45.05,45.05,0)
- Level 1: { Selection Set of 8 Objects }
-
- Lets verify that this is the correct order of the arguments for the Rotate
- command. Alt-Click on the Rotate button. A 5 line help message
- appears. Press Enter. Now the stack display is redrawn in blue and
- white showing the required parameters. Press Enter to get back to the
- normal stack display.
-
- All our data is in the correct levels, so press the Rotate button.
-
- You will see the message "Rotation Key(s) Created". When you exit the
- calculator, and return to 3DS at frame 1, you will see each Cube is
- rotate by the amount entered. Notice that each object was rotated about
- its own pivot individually.
-
- Note: You may type as many decimal places of precision as you like for
- keyframes. However, due to round off error inside 3DS, you will
- probably only be able to maintain three to five places internally (check
- this out in KeyInfo if you like). 3DS uses single precision arithmetic for
- speed, and some rounding error is inevitable.
-
- Lets create an Absolute Position key.
-
- We will move the center of the Sphere01 object to the combined
- center of all the Cube objects. To do this, we will use an Absolute
- Position. This takes two points from the stack - a Source point, and a
- Destination point. The key created will move the source point over to
- the destination point. In our case, the source point is the center of the
- Sphere01 object. The destination point is the center of the entire set of
- Cube objects. To do this involves a new command which retrieves a
- coordinate from the bounding box of an object or selection set.
-
- 1) To begin, using the standard 3DS tools, set the current frame to 2
- (this is not a required step, but will allow us to view the results of the
- operation while still within the calculator IPAS routine).
-
- 2) Run CALC. (Press F12, select CALC)
-
- 3) Enter the frame number on the stack, 2. This is the frame number
- for the Position key.
-
- 4) Now we need to retrieve the source point coordinate (i.e. the center
- of the Sphere01 object). Do this by Shift-Clicking on the
- Object->Pt button (we shift click because the stack is not clear, yet
- we would like to be prompted for the values anyway).
-
- Object->Pt returns coordinates from objects or selection sets. It
- requires two arguments, a frame # and an object.
-
- 5) The first prompt is for the Frame #, enter 2. This is frame number at
- which we wish to retrieve the coordinates.
-
- 6) Next you are prompted to tag a selection set of objects. Select object
- Sphere01 and press OK.
-
- 7) A dialog box pops up allowing your to retrieve any coordinate from
- the bounding box of the sphere. Notice you can build any combination
- of Width/Depth/Height and Min/Cen/Max. This give you good
- flexibility in choosing a coordinate for exact alignment of objects. In
- our case we want Width/Cen, Depth/Cen, Height/Cen (i.e. the
- middle of the sphere). Select OK and you will see the coordinate is
- returned to the stack. It should read (0.00,-288.00,288.00).
-
- This is the source point for our absolute move operation. We now need
- the destination coordinate. This is the center point of all the Cube
- objects. Again we will use the Object->Pt function.
-
- 8) The stack is not clear, so to have the program prompt us for the
- parameters we Shift-Click the Object->Pt button.
-
- 9) You are prompted for the Frame #. Enter 2.
-
- 10) Next, tag all the Cubes (8 total) and press OK.
-
- 11) Again, select the Width/Cen, Depth/Cen, Height/Cen
- buttons and then select OK. The center of the entire group of Cubes is
- returned to the stack. This is our destination point. It should read
- (0.00,0.00,24.00).
-
- 12) Now, the last step is to enter the object to move onto the stack. Use
- the Choose Obj button, and select Sphere01.
-
- At this point, your stack should have the Frame # in level 4, the Source
- point in level 3, the Destination point in level 2, and the Object in level
- 1 and as shown below.
-
- Level 4: 2.00
- Level 3: (0.00,-288.00,288.00)
- Level 2: (0.00,0.00,24.00)
- Level 1: Sphere01
-
- 13) If this is so, make sure the Absolute radio button is active, and
- press the Position button. You will get the message "Position Key
- Created".
-
- If you previously set 3D Studio's current frame number to 2, you can
- use the Hide Dialog function (the button in the upper right corner of the
- dialog) to temporarily hide the calculator so we can see the results of the
- move. Try this out - Click on Hide Dialog. 3DS's display is redrawn,
- and Sphere01 has moved to the center of the group of Cubes. To restore
- the calculator, press either mouse button. This is handy if you are going
- to perform several sequential operations and you want to view the
- intermediate results without leaving the calculator.
-
- Lets try one more operation, Absolute Scale.
-
- In Relative mode, Scale creates keys which represent a size relative to
- the objects size in the 3D Editor before any keys were created. So a
- scale factor of 2 would put the object at twice its original size at that
- frame. For this example, lets use Absolute mode, and scale Sphere01
- such that its bounding box exactly encloses all our rotated Cubes.
- This will expand the sphere in width and depth, and shrink it in height.
- This will demonstrate how you can extract information from some
- objects and apply that info to other objects.
-
- 1) As usual, first we enter the frame number, say frame 3.
-
- Next we need the bounding box size of all the Cube objects. There is a
- separate function to retrieve the bounding box size of an object or
- selection set called GET_OBJECT_SIZE. This is available directly
- from the buttons in the dialog (Object Size), but what we will do is
- assign the function to a key on the keyboard. The keys A-Z are
- available. Lowercase is the same as uppercase.
-
- 2) To assign GET_OBJECT_SIZE to a key, Ctrl-press a keyboard key.
- Press the Ctrl-O key. If the key is already assigned, you will be
- asked if you want to change it. (Answer Yes if it asks). A list of all the
- functions available is presented. Choose GET_OBJECT_SIZE and
- press OK. The key is assigned and available for use.
-
- Now, lets use GET_OBJECT_SIZE.
-
- 3) Hold down the Shift key and press the O key. Again, the Shift is
- so we will be prompted for the parameters.
-
- 4) You are prompted for the Frame #. Enter 3.
-
- 5) Next, tag all the Cube objects (8 total) and press OK.
-
- The bounding box size of the entire selection set at frame 3 is returned to
- level 1. It should read (321.95,307.88,81.93). This is the size
- we will assign to the bounding box of object Sphere01.
-
- 6) The final parameter for Absolute Scale is the object name in level 1,
- so use the Choose Obj button and select Sphere01 from the list.
-
- At this point, the Frame # should be in level 3, the Size should be in
- level 2, and the Object should be in level 1 as shown below.
-
- Level 3: 3
- Level 2: (321.95,307.88,81.93)
- Level 1: Sphere01
-
- If not, use the stack manipulation functions to reorganize the stack so the
- parameters are in the correct order.
-
- 7) When the values are ordered OK, make sure the Absolute button
- is active, and press Scale. The program will respond "Scale Key
- Created". Press ESC to Return to 3DS. Answer Yes to save your
- changed Key Assignments. Using the 3DS tools, go to frame 3, and
- notice that the sphere has been scaled so its bounding box is exactly fit
- around the entire volume consumed by the Cubes. This may be easier to
- see if you turn on Box mode (Alt-B). This type of inter-object
- keyframing is the idea behind the calculator design. You can extract
- parameters from existing objects and use them as input to create new
- keyframes.
-
- Reading Key Data from a File
-
- This is the final section of the tutorial. We will read key data from a
- text file. This allows very simple keyframe scripting of Position, Scale
- and Rotation. This is accomplished with the READ_SCRIPT_FILE
- command.
-
- Before we run the command, take a look at the demo file KC-
- DEMO.TXT. Do this by loading it into 3D Studio's text editor.
-
- 1) Press F11 to get to the text editor.
-
- 2) Select File/Load and choose C:\KC-DEMO.TXT
-
- Notice that the first few lines begin with REM or the // characters.
- These are comments. These lines are used to make the file more
- readable for humans, but are ignored by the program.
-
- The format of keyframe data in the file is:
- KEYFRAME TYPE; FRAME #; OBJECT NAME; DATA;
- The actual keyframe data starts with the line beginning ABS-
- POSITION. This first key line reads:
- ABS-POSITION; 0; Hedra01; -72',0,0;
- This indicates we wish to create an Absolute Position key. This will
- place the pivot point of object Hedra01 at Absolute World coordinate
- -72',0,0 at frame 0.
- The next key line reads:
- REL-POSITION; 1; Hedra01; 10'<0;
- This will translate Hedra01 by 10' at an angle of 0 degrees in plan at
- frame 1. The remainder of the position keys resemble these two lines.
- There are also Scale and Rotation keys listed. Note that in each case we
- have one key per line and each data field is separated with a semicolon
- (;). The valid Keyframe Types are: ABS-POSITION, REL-
- POSITION, ABS-SCALE, REL-SCALE, and ROTATION. You
- can review the function reference section for more detail on all the data
- formats allowed.
-
- Lets run the READ_SCRIPT_FILE command and see what it creates.
-
- 2) Select File/Exit to return to the Keyframer. Press F12 and run
- CALC.
-
- 3) Press the TAB key to get a list of the available functions and select
- READ_SCRIPT_FILE.
-
- 4) A file selector appears. Choose file C:\KC-DEMO.TXT
-
- A message appears indicating the file processing is beginning. Click
- Continue. Next a message appears indicating that 11 Position keys , 11
- Scale keys and 3 Rotations keys were created. Press Continue and then
- ESC to quit the calculator and return to 3DS.
-
- As you can see the keys have been applied to the Hedra01 object.
- Thus, READ_SCRIPT_FILE is used to allow very simple keyframe
- scripting of position, scale and rotation. Just like the rest of the
- calculator, you can specify the amounts in decimal and feet and inches
- using a range of data formats.
-
- That is it for the keyframing tutorial. Check out the section below on
- Strokes. This is another method to customize your calculator.
-
- Strokes
-
- Strokes are a user interface technique with which you can sketch a shape
- using the mouse, and assign a program command to be executed each
- time the shape is drawn. This allows you to conveniently access
- commands you use frequently. As an example, lets assign the command
- PICK_OBJECT to a horizontal stroke, drawn left to right. This is a
- quick and easy stroke to sketch. To invoke TEACH_STROKE, press the
- T key. You will be prompted to draw the stroke to teach. Hold down
- the right mouse button , and drag it horizontally from left to right. The
- length is not important. Notice that as you drag the mouse, a series of
- X's are drawn to show you the shape. Once the shape is drawn, release
- the mouse button and the X's disappear. The program now analyzes the
- shape you've drawn and assigns a name to it. It does this by centering a
- square grid over the stroke. As shown below, each internal line segment
- in the grid is given a single character name. If the stroke drawn crosses
- a particular segment, its character is added to the stroke name. In our
- case, our stroke crosses the C segment and then the D segment. Thus
- this stroke is called CD. After you draw the stroke to teach, you are
- presented with a list of all the available functions. Scroll down until you
- find PICK_OBJECT, select it and press OK. You have now taught the
- program that whenever you draw the stroke CD, you wish to execute
- PICK_OBJECT. Give it a try. Draw stroke CD and pick an object.
- The object you pick is returned to the stack. You may use the
- VIEW_STROKES command to review your stroke definitions, and
- change or delete them. Try this from the calculator by pressing the TAB
- key and choosing VIEW_STROKES.
-
- +-------+-------+-------+
- | | | |
- | A B |
- | | | |
- +-- G --+-- H --+-- I --+
- | | | |
- |xxxxxxxCxxxxxxxDxxxxxxx|
- | | | |
- +-- J --+-- K --+-- L --+
- | | | |
- | E F |
- | | | |
- +-------+-------+-------+
- Stroke Analysis Grid
- 12 segments named A through L
-
- Note: You may also teach strokes by drawing a 'T' shape with the
- mouse. If you draw any of the strokes ABBHK, BAAHK, KHAAB or
- KHBBA the Teach Stroke command will be invoked.
-
- Your stroke definitions are stored in the file CALC.STR. When you
- quit the calculator, you will be asked if you want to save the changed
- definitions.
-
- Customizing the Keyboard:
-
- You can assign functions you often use to the keys A through Z.
- Uppercase and Lowercase keys are identical. To program a key, Ctrl-
- Press it. You will be prompted to select a function to assign. Select it
- from the list and press OK. Once it is assigned, you can execute that
- function anytime by pressing the key. These key assignments are stored
- in the file CALC.KEY. When you quit the calculator, you will be asked
- if you want to save the changed definitions. You may check to see what
- function is assigned to a key by Alt-Pressing it. A short message
- appears indicating the name of the function assigned. Then on-line help
- for that function is presented.
-
- Function Reference
- This is a brief description of all the functions available.
-
- Create Keyframes
- CREATE_POSITION_KEY: This allows you to create Position Keys
- for Objects or Selection Sets. This command operates differently based
- on the setting of Relative/Absolute Mode. In Relative mode, the object
- is simply translated by the distance specified at the frame specified. In
- Absolute mode, the specified Source point is moved to the specified
- Destination point. If you use Absolute mode and press the Ctrl-key
- when you select the command, you specify a single destination for the
- objects pivot point. The required stack parameters are as follows:
-
- Absolute Mode (Ctrl key _not_ pressed):
- Level 4: Frame #
- Level 3: Source Point
- Level 2: Destination Point
- Level 1: Object or Selection Set
- Absolute Mode (Ctrl key pressed):
- Level 3: Frame #
- Level 2: Destination Point for Pivot
- Level 1: Object or Selection Set
- Relative Mode:
- Level 3: Frame #
- Level 2: Offset Distance to translate
- Level 1: Object or Selection Set
-
- The Source and Destination points may be specified in any of the
- following formats:
- Rectangular: Width, Depth, Height
- 2'3",4'3-1/2",5"
- Polar: Distance<Angle in Plan (Zero degrees is along the
- +Width axis)
- 5.125'<270.1
- Cylindrical: Distance<Angle in Plan, Height
- 4'<45,8'
- Spherical: Distance<Angle in Plan<Angle Up from Plan
- 4'<45<30.5
-
- CREATE_ROTATE_KEY: This allows you to create Rotation Keys for
- Objects or Selection Sets. The rotations are specified as angles about the
- objects local axis. For example, the rotation amount
- (0.0,45.0,87.125) specifies to rotate 0 degrees about the objects
- local Width axis, 45 degrees about the objects local Depth axis, and
- 87.125 degrees about the objects local Height axis. The right hand rule
- is used for determination of positive angles. The required stack
- parameters are:
-
- Level 3: Frame #
- Level 2: Rotation: (Width,Depth,Height)
- Level 1: Object or Selection Set
-
- CREATE_SCALE_KEY: This allows you to create Scale Keys for
- Objects or Selection Sets. This command operates differently based on
- the setting of Relative/Absolute Mode. In Absolute mode, the Objects
- bounding box is forced to the specified size. In Relative mode, the
- object is scaled along each of its local axes by the factor specified. The
- required stack parameters are:
-
- Level 3: Frame #
- Level 2: Scale Factor or Factors
- (Width,Depth,Height)
- Level 1: Object or Selection Set
-
- READ_SCRIPT_FILE: This function allows you to read keyframe
- data from a text file. The file name extension it looks for is .TXT. The
- format of data in the file is: KEYFRAME TYPE; FRAME #;
- OBJECT NAME; DATA;
- One key per line. Separate each data field with a semicolon (;). Each
- line should end in a semicolon and a Carriage Return.
- Examples:
- Rel-Position; 4; Object01; 23',0,200';
- Abs-Position; 20; Object02; 0,0,-50';
- Abs-Scale; 21; Object03; 0.36,0.24,0.36;
- Rotation; 1; Object01; 0,0,359.98;
-
- Note that each part of the line is separated by a semicolon, and that the
- line ends in a semicolon (;). The valid Keyframe Types are: Abs-
- Position, Rel-Position, Abs-Scale, Rel-Scale,
- and Rotation. The case of the Keyframe Type is not relevant.
- Only the first 5 characters of the Keyframe Type are looked at. The
- case of the Object Name is relevant. The Data field may be any valid
- type as used by the commands in the rest of the calculator. Position
- keys may use REC/POL/CYL/SPH. Scale and Rotation keys use
- Rectangular only, formatted Width,Depth,Height.
- Error checking is provided to try to handle most cases of bad data, but
- there may be strange cases which are not detected, so enter your
- keyframe data carefully.
-
- You may include blank lines in the text file. You may also use inline
- comments by beginning the line with REM or the // characters . You
- can also display a text message during the file processing using the
- ECHO statement. The displayed message is limited to 70 characters or
- less. Below is a complete sample file showing the commands which may
- be used.
-
- ECHO Beginning to process file...
- // An Absolute Move to get to a known start
- point of 0,0,0
- ABS-POSITION; 0; Object01; 0,0,0;
- // Down to the initial depth
- ABS-POSITION; 1; Object01; 0,0,-50';
- // Then add the other positions as relative
- moves ...
- REL-POSITION; 2; Object01; 70'<300,-5';
- REL-POSITION; 3; Object01; 40'<240,10';
- REL-POSITION; 4; Object01; 110'<200,-20';
- REL-POSITION; 5; Object01; 50'<180,25';
- REL-POSITION; 6; Object01; 40'<150,20';
- REL-POSITION; 7; Object01; 60'<90,20;
-
- // Force Object01 to a 2'x4'x6' box...
- ABS-SCALE; 1; Object01; 2',4',6'
-
- // Now make it twice as big in Width/Depth, and
- 3 times
- // in Height
- REL-SCALE; 8; Object01; 2.0,2.0,3.0
-
- // Now rotate Object01 180 degrees about the
- Height axis
- ROTATION; 9; Object01; 0,0,180.0
- ECHO File processing Complete...
-
- Retrieve Existing Keys (or Interpolate between keys)
- GET_POSITION_KEY: Retrieves the values of an objects position at
- the specified frame number.
- GET_SCALE_KEY: Retrieve an objects scale factor at the specified
- frame number.
- GET_PIVOT_POINT: Retrieves an objects pivot point. If Absolute
- mode is active, the world coordinate of the pivot is returned, otherwise
- if Relative mode is active, the pivot point returned is relative to the
- objects bounding box center.
-
- Display Functions
- DISPLAY_AS_DECIMAL: Converts the display of the number or point
- in level 1 to decimal.
- DISPLAY_AS_FTIN: Converts the display of the number or point in
- level 1 to feet and inches.
- ABSOLUTE_TOGGLE: Toggles Absolute mode On/Off.
- FORMAT_TOGGLE: Toggles point display between REC/CYL/SPH
- display.
- HIDE_DIALOG: Temporarily hides the calculator dialog box so the
- 3DS screen may be viewed.
- VIEW_LEVEL_1: This function allows you to view the entire contents
- of level 1 if the line is too long to be visible in the stack window. You
- may also use this function to view and edit any Selection Set, Matrix, or
- RGB Color value in level 1.
- QUIT: Terminates the calculator. If there were any changes to key or
- stroke assignments, you will be asked if you wish to save them.
-
- Function Execution
- FUNCTION_LIST: Brings up a dialog of all available functions. You
- may Alt- or Shift- click items in this list to bring up help or parameter
- prompts just like you can for buttons in the dialog box.
- REPEAT_LAST_FUNC: This repeats the last function you have
- executed. It is most appropriate to use this by assigning it to a stroke or
- keypress.
-
- Select Objects or Sets
- Selection Sets are used to apply keyframes to multiple objects at once.
- Identical keys are assigned to each object in the selection set.
-
- TAG_SELECTION_SET: Creates Selection Set by tagging objects By
- Name.
- PICK_OBJECT: Graphically Pick a single Object.
- PICK_SELECTION_SET: Graphically Pick a Selection Set of
- Objects. In order to complete the selection set, select one of the objects
- you have already selected _again_. The program recognizes this and
- terminates the selection. Do not press the right mouse button during
- selection as this will terminate the entire IPAS program. (This limitation
- is necessitated by the IPAS toolkit).
- CHOOSE_OBJECTS: Choose a single object By Name.
-
- Stroke Operations
- Strokes are a user interface technique with which you can sketch a shape
- with the mouse and assign a program command to be executed each time
- the shape is drawn. This allows you to quickly access commands you
- use frequently.
-
- TEACH_STROKE: This allows you to create a new stroke definition.
- VIEW_STROKES: This allows you to see your stroke definitions and
- change and delete them.
- DELETE_STROKE: This allows you to draw a stroke to delete.
-
- Stack Manipulation
- CLEAR_STACK: Delete the entire stack contents. If the stack is clear,
- any commands requiring several arguments will automatically prompt
- for all the required parameters. This is also useful if you receive a
- stack full message. The Last function will undo the effect of Clear.
- LAST_STACK: Restore the previous stack contents before the last
- command was executed. If you Shift-Click on the button, the last stack
- contents are merged with the current contents.
- STACK_TO_POINT: This function take one, two or three real
- arguments off the stack, and converts them to a point entity. If less
- than three reals are specified, the missing values are filled with zeros.
- The Width argument is in level 1, the Depth argument is in level 2, and
- the Height argument goes in level 3.
- POINT_TO_STACK: This function takes a point argument and
- converts it to three real values. The rectangular form of the point is
- always what is entered on the stack, regardless of how the point is
- formatted (REC/CYL/SPH). The Width parameter goes to level 1, the
- Depth to level 2, and the Height to level 3.
- SWAP_1_AND_2, SWAP_1_AND_3, SWAP_1_AND_4,
- SWAP_2_AND_3, SWAP_2_AND_4: Swap stack data between two
- levels.
-
- Retrieve Coordinates from existing Objects or Selection Sets
- OBJECT_TO_POINT: This function allows you to retrieve
- coordinates from the bounding box of an object or selection set of
- objects. You will be presented with a dialog box where you may choose
- any combination of Min/Cen/Max for Width/Depth/Height. If you
- select with Shift-Click, you will be prompted for all required values.
- GET_OBJECT_SIZE: This function allows you to retrieve the
- bounding box size of an object or selection set at any frame. If you
- select with Shift-Click, you will be prompted for all required
- parameters.
-
- Basic Math Functions
- +, -: Addition and subtraction operate on real numbers, points,
- matrices, colors, objects and selection sets.
- *, /: Multiplication and division operate on real numbers, points,
- matrices, and colors.
- %: Returns level 2 percent of level 1.
- %CH: Percentage change between level 2 and level 1.
-
- SINE (Trig functions: These work, but there is no practical application
- yet...)
- COSINE
- TANGENT
- ARC_SINE
- ARC_COSINE
- ARC_TANGENT
- SQUARE_ROOT: Square root of real in level 1.
- ^ or EXPONENTIATION: Returns level 2 to the power of level 1.
-
- Numeric Conversion
- ABSOLUTE_VALUE: Absolute Value of real or point in level 1.
- CHANGE_SIGN: -1 times the real or point in level 1.
- INTEGER_PORTION: Returns the whole number portion of the real in
- level 1.
- FRACTIONAL_PORTION: Returns the fractional portion of the real in
- level 1.
- ROUND_TO_DISP_PREC: Alters the numeric value of the real number
- in level 1 to match the displayed value. This will truncate the value to
- the number of displayed decimal places.
-
- Matrix Operations
- These operations create or alter 3 x 4 Transformation Matrices. You
- can't do anything with them yet however...They will be used in the
- future.
- ENTER_MATRIX: Create a new matrix.
- MATRIX_INIT: Initialize a new matrix.
- GET_OBJECT_XFORM: Retrieves a 3 x 4 matrix representing a node's
- transformation (relative to the world). This is returned by the IPAS
- command kxp_get_xform.
-
- Color
- RGB Color values may be entered, added, subtracted, multiplied and
- divided. You can't to anything with them yet however ... They will be
- used in the future.
- ENTER_COLOR: Allows you to enter a new color on the stack.
- EDIT_COLOR: Edits an existing color on the stack.