home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / 3dstudio / ipas / readme.doc < prev    next >
Encoding:
Text File  |  1994-08-01  |  38.8 KB  |  873 lines

  1. K e y f r a m e   C a l c u l a t o r
  2.  
  3. CALC_I.KXP by Mark Meier
  4.  
  5. A freeware IPAS Plug-In to allow users to keyframe objects and 
  6. selection sets of objects using accurate AutoCAD type coordinate entry.  
  7. The program is set up around a Reverse Polish Notation (RPN) 
  8. Calculator.  It is designed in this way to allow you to perform arithmetic 
  9. on keyframe arguments, and to retrieve key information from objects 
  10. and apply that information to other objects.  Parameters for keyframe 
  11. functions are placed on the calculator stack.  This stack supports the 
  12. following data types:
  13.  
  14. - Real Numbers.
  15. - Points or Displacements (Width, Depth, Height).
  16. - Scale Factors (Width, Depth, Height).
  17. - Rotation Angles (Width, Depth, Height).
  18. - Mesh and Dummy Objects.
  19. - Selection Sets of Mesh and Dummy Objects.
  20. - RGB Color Quantities (For future use).
  21. - Transformation Matrices (For future use).
  22.  
  23. Installation
  24.  
  25. Below is a description of the files required and where to install them.
  26.  
  27. The zip file CALC.ZIP contains eight files:
  28. README.TXT - ASCII information and tutorial file.  I recommend you 
  29. print this file (or README.DOC) to do the tutorial.
  30. README.DOC - A MS Word for Windows version of README.TXT.  
  31. This version is much easier to read than README.TXT because of the 
  32. use of multiple fonts.  Use it if you are able to print it from your word 
  33. processor.
  34. CALC_I.KXP - Place this file into the \3DS3\PROCESS directory
  35. CALC.SET - This file goes into C:\.  This ASCII file contains some 
  36. user alterable options such as default Tens/Cont/Bias.  Currently the 
  37. default Tension = 25, Continuity = 0 and Bias = 25.  Read the file 
  38. itself for more info if you need to changed these. (Note: I hope to 
  39. eliminate the need to place these files into the fixed location C:\ in a 
  40. future version)...
  41. CALC.KEY - This goes in the same place as CALC.SET.   It contains 
  42. the user defined key definitions you create.  This is also an ASCII file 
  43. and you may find it helpful to print it (it is less than a page in length).
  44. CALC.STR - This goes into the same place as CALC.SET.  It contains 
  45. the user defined stroke definitions you create.
  46. KC-DEMO.3DS - A demo file used in conjunction with the tutorial.  
  47. Copy it into \3DS3\MESHES.
  48. KC-DEMO.TXT - A demo keyframe script file.  Copy it into C:\.
  49.  
  50. General Info:
  51.  
  52. - There is a short tutorial which guides you through the basics of how to 
  53. use the program. What is listed below will make more sense after you 
  54. have done the tutorial, so don't get hung up here.  Just quickly read 
  55. through this portion.
  56. - The stack at the top of the dialog box is used to enter parameters for 
  57. the keyframe functions.  Numbers are entered into level 1 by simply 
  58. typing and pressing ENTER.  Valid characters for numeric entry are 
  59. 0123456789./-',"<
  60. - You can Alt-Click on buttons in the dialog for brief on-line help.  This 
  61. will also show you any required parameters and their location on the 
  62. stack.
  63. - If the stack is Clear (empty) you will be prompted for the required 
  64. arguments when you execute the keyframe functions.  If the stack is not 
  65. empty, it is assumed you have loaded the stack with the proper 
  66. arguments.  If you want to keep the stack contents intact but still want to 
  67. be prompted for the arguments, select the function with the Shift key 
  68. held.
  69. - If the stack item in level 1 is too long to the shown in the stack window 
  70. (an ellipses will appear), use the View Level 1 function.  This will allow 
  71. you to see the entire line.  Also, if you need to edit a Selection Set, 
  72. Matrix, or RGB Color, use View Level 1.
  73. - The Keyboard is programmable.  Ctrl-Press the key you wish to assign 
  74. (the keys A-Z are valid.  Lowercase is the same as Uppercase.).  You 
  75. will be prompted to select a function to assign to this key.  Now, 
  76. whenever you want to execute this command, just press the key.  You 
  77. may also Alt-Press a key to see which function is assigned to it.
  78. - The left mouse button is used for selecting commands and dialog 
  79. options.  The right mouse button is used for 'Strokes'.  This is a shape 
  80. recognition algorithm which you can teach to execute program functions 
  81. of your choosing.
  82. - For functions not available from the dialog box, press the TAB key or 
  83. use the LIST function in the Functions: section of the dialog.  This 
  84. presents a list of all available functions.  You may Alt- or Shift- click 
  85. these choices just like buttons from the dialog  (Press the Alt or Shift 
  86. key _before_ you press TAB or LIST).
  87. - The button in the upper left corner of the dialog is used to quit the 
  88. calculator.  You can also press either the ESC or Q key to quit.
  89.  
  90. Limitations of Version 1.0
  91.  
  92. 3D Studio Release 3 is required.  It won't run with r2.
  93.  
  94. Position Keys:
  95. - Child objects cannot be keyframed for position.  Parent or Unlinked 
  96. objects are okay.
  97. - Spherical coordinates are unreliable when the radius is negative.  
  98.   Use Rectangular or Cylindrical to avoid problems or stick to positive 
  99. distances.
  100.  
  101. Rotation Keys:
  102. - The Angle specified must be greater than -360 degrees and less than 
  103. 360 degrees.
  104. - Rotation keys cannot be created at frame 0.
  105.  
  106. Tutorial:
  107.  
  108. Calculator Layout:
  109.  
  110. 1) Load the sample file KC-DEMO.3DS.
  111. 2) Press F4 to enter the Keyframer, press F12 and load CALC.
  112.  
  113. The Calculator Dialog is divided into 5 sections:
  114.  
  115. The top section is the stack display and prompt line (title line).  Notice 
  116. that the stack has 4 visible levels, labeled 1 through 4.  This is where 
  117. you enter parameters and arguments for the functions.  The button in 
  118. the upper left corner Quits the calculator.  The button in the upper right 
  119. corner hides the dialog box temporarily.
  120.  
  121. The next section down contains the Keyframe functions:  The 
  122. Relative and Absolute buttons are radio buttons.  They control 
  123. how the program interprets the stack parameters for creating keyframes.  
  124.  
  125. The next section down contains the Stack Manipulation functions:  
  126. These operations are used to create new items on the stack, or move 
  127. existing items between stack levels.
  128.  
  129. The next section down contains a subset of the available functions.  You 
  130. can use these functions to perform numerical operations on the stack 
  131. contents.  You can use the LIST button (or press TAB) to see the entire 
  132. set.
  133.  
  134. The last section contains the Display control functions.  These 
  135. functions let you control the display of the stack contents.
  136.  
  137. Stack Manipulation:
  138.  
  139. Before we get to the keyframing, lets go over a bit of how you enter 
  140. values on the stack and move them around.  The stack is eight levels 
  141. high.  Only 4 levels are visible.  When you enter a new value, it goes 
  142. into level 1, and pushes any existing data higher on the stack (into higher 
  143. numbered levels).  Try the following sequence:
  144.  
  145. Press:
  146. 4 ENTER
  147. 3 ENTER
  148. 2 ENTER
  149. 1 ENTER
  150.  
  151. You will see that these four numbers have been entered onto the stack.  
  152. As you entered each one, the previous stack contents were lifted higher.  
  153. Now use the Clear function located in the "Stack:" section.
  154.  
  155. You will see that the entire contents of the stack are cleared.  This is 
  156. useful if you have a full stack, or are done using the current stack 
  157. contents.  Now execute the Last function (press the button labeled 
  158. Last).
  159.  
  160. You will see the previous (or "last") contents were restored to the stack.  
  161. This is useful to recover any previous stack contents altered by functions 
  162. you execute.  At this point your stack should read:
  163.  
  164. 4.00
  165. 3.00
  166. 2.00
  167. 1.00
  168.  
  169. Now, lets try some of the stack movement operations.  Press the 1<>2 
  170. button.  This causes stack levels 1 and 2 to be swapped, so 2.00 should 
  171. now be in level one, and 1.00 should be in level 2.  These level 
  172. swapping functions are needed because arguments for commands are 
  173. expected in specific stack levels, and based on the order of your data 
  174. entry, you may need to re-organize the stack to get these arguments into 
  175. the right order.  There are two other types of stack movements 
  176. commands labeled R-up arrow and R-dn-arrow.  These 'Roll' the stack 
  177. contents either up or down.  Rolling down takes the higher levels and 
  178. moves them down one level, and level 1 goes to the highest numbered 
  179. level for example. 
  180.  
  181. You can use the BACKSPACE key to clear the item from level 1.  Try 
  182. this out.   The items are dropped from the stack one by one.
  183.  
  184. Lets now look at how to change the display of data on the stack.  The 
  185. functions in the Display section are used to accomplish this.    Clear the 
  186. stack (press Clear), and enter the following numbers:
  187.  
  188. 4'5-3/16" ENTER
  189. 32.125 ENTER
  190. 0.25' ENTER
  191. -4 ENTER
  192.  
  193. Your stack should look like this:
  194.  
  195. Level 4: 4'-5 1/8"
  196. Level 3: 32.12
  197. Level 2: 0'-3"
  198. Level 1: -4.00
  199.  
  200. Notice that the feet and inches values are rounded to the nearest 1/8".  
  201. This is the default 'Maximum Denominator' for fractional display.  Thus 
  202. the 3/16" argument is formatted 4'5-1/8" (the largest fraction less 
  203. than or equal to the maximum denominator).  You will also notice that 
  204. the decimal numbers are rounded to two decimal places not three as 
  205. entered.  To change the number of displayed decimal places, click on the 
  206. arrow next to the 0.00 field in the Display section.  The cursor changes 
  207. to the up/dn arrow and as you move the mouse up and down, the format 
  208. display changes from a minimum of 0 to a maximum of 0.000000.  
  209. Use this function to format decimal numbers as you wish.  Feet and Inch 
  210. denominator formatting works the same way, moving between 1/1 and 
  211. 1/256.
  212.  
  213. You can also convert decimal number to feet and inches and vice versa.  
  214. Level 1 should contain the number -4.00.  Note that the radio buttons 
  215. labeled Decimal and Feet & Inch control how the number is 
  216. displayed.  If you press the Feet & Inch button, the -4 will be 
  217. formatted as -0'-4".  If you press the Decimal button, the format is 
  218. changed back to decimal.  Note that only the contents of level 1 are 
  219. altered by this conversion.
  220.  
  221. Now lets take a look at how points may be formatted.  You can create a 
  222. point on the stack by entering it in one of four formats: Rectangular, 
  223. Polar, Cylindrical or Spherical.  Examples of each of these formats is 
  224. listed below.  Note in particular how the comma, minus sign, and less 
  225. than sign are used as delimiters.  AutoCAD users will already be 
  226. familiar with this notation.
  227.  
  228. Rectangular: Width, Depth, Height
  229.     0,0.5,2
  230.     0,0,5'
  231.     2'3",4'3-1/2",5"
  232. Polar: Distance<Angle in Plan
  233.     4'6"<45.6
  234.     5.125'<270.1
  235. Cylindrical: Distance<Angle in Plan, Height
  236.     4'<45,8'
  237.     5'<0,6.2"
  238. Spherical:  Distance<Angle in Plan<Angle Up from Plan
  239.     4'<45<30.5
  240.  
  241. The radio buttons REC, CYL, and SPH in the display section control the 
  242. formatting of points.  All points are stored internally as Rectangular, but 
  243. you may display them in any format you like.  (Note: Because the points 
  244. are stored internally as Rectangular, point are 'normalized'.  Basically 
  245. the data may not be displayed exactly as you entered it, but the value 
  246. implied is the same numerically).
  247.  
  248. Rectangular format is used by all keyframe creation functions.  For 
  249. Position keys, you may also use Polar/Cylindrical and Spherical.  
  250.  
  251. In the case of Scale keys, the Width,Depth,Height portions of the 
  252. Rectangular 'point' specify scale factors for each of Width/Depth/Height 
  253. dimensions of the object.  
  254.  
  255. In the case of Rotation keys, the Width/Depth/Height specify rotation 
  256. about the Local Axis of the object.  This is the same as the Rotate/Object 
  257. command in 3DS itself.  (Note: You are limited to angles of rotation less 
  258. than 360.0 and greater that -360.0).
  259.  
  260. Creating Keyframes:
  261.  
  262. Lets create a few kinds of keyframes.  First, a Relative Position key.  
  263. This function will move the object by the distance specified at the frame 
  264. specified.  We will also see how you can use the program to prompt you 
  265. for all the required stack arguments.  
  266.  
  267. If you haven't already, Load the sample file KC-DEMO.3DS and run 
  268. CALC.
  269.  
  270. 1) Clear the stack and activate the Relative Radio button (if it is 
  271. not already).  
  272. 2) Press the Position button.  Since the stack is clear, you are 
  273. prompted for all required parameters.
  274. 3) The prompt Frame # appears.  Enter  1.
  275. 4) Next, you are prompted for the Offset: Width, Depth, Height.  
  276. Enter 16'4-3/4"<80,6'2".  This is a Cylindrical coordinate.  It 
  277. specifies to move a distance of 16' 4-3/4" in plan at a 80 degree angle, 
  278. and move up in height by 6'2".
  279. 5) Next, you will be prompted to create a selection set of objects.  Click 
  280. on Torus01 and then select OK.  
  281.  
  282. As soon as you select OK, the Position key is created.  Notice the stack 
  283. contents before you click Continue.  In level 3 is the frame number.  In 
  284. level 2 is the offset distance.  In level 1 is the Selection Set (Torus01).  
  285. If you wanted to load the stack yourself, you would enter the parameters 
  286. in the same order.
  287.  
  288. If you need to review how to load up the stack, Alt-Click on the button 
  289. in question.  A dialog would appear which briefly describes the 
  290. command.  After you click Continue (or press Enter), the stack is 
  291. redrawn in blue and white showing the required stack parameters in each 
  292. level.  This works for every command.  
  293.  
  294. 6) Press ESC to exit the calculator and go to frame 1.  You will see that 
  295. Torus01 has been moved by the amount you entered.
  296.  
  297. Now lets Rotate a Selection Set of Objects.  
  298.  
  299. This will create identical rotation keys for each object in the selection 
  300. set.  This time, we will load up the stack manually, and then execute the 
  301. command.  We will Rotate all the Cube0? objects.  
  302.  
  303. 1) Press F12 and run CALC again.  
  304. 2) First, enter the frame number on the stack, 1.  
  305. 3) Next, we enter the rotation amounts.  For this example type 
  306. 45.05,45.05,0.  This specifies a rotation of 45.05 degrees along 
  307. each objects local Width and Depth axes, and zero rotation about each 
  308. objects Height axis.  Each object will rotate individually about its pivot 
  309. point.
  310. 4) Next, press the Tag SelSet button and tag all the Cube0? objects 
  311. (there are eight of them).  
  312. 5) At this point, you should have the frame # in level 3, the rotation 
  313. amount in level 2, and the selection set in level one.  
  314.  
  315. Level 3: 1.00
  316. Level 2: (45.05,45.05,0)
  317. Level 1: { Selection Set of 8 Objects }
  318.  
  319. Lets verify that this is the correct order of the arguments for the Rotate 
  320. command.  Alt-Click on the Rotate button.  A 5 line help message 
  321. appears.  Press Enter.  Now the stack display is redrawn in blue and 
  322. white showing the required parameters.  Press Enter to get back to the 
  323. normal stack display.
  324.  
  325. All our data is in the correct levels, so press the Rotate button.  
  326.  
  327. You will see the message "Rotation Key(s) Created".  When you exit the 
  328. calculator, and return to 3DS at frame 1, you will see each Cube is 
  329. rotate by the amount entered.  Notice that each object was rotated about 
  330. its own pivot individually.  
  331.  
  332. Note: You may type as many decimal places of precision as you like for 
  333. keyframes.  However, due to round off error inside 3DS, you will 
  334. probably only be able to maintain three to five places internally (check 
  335. this out in KeyInfo if you like).  3DS uses single precision arithmetic for 
  336. speed, and some rounding error is inevitable.
  337.  
  338. Lets create an Absolute Position key.   
  339.  
  340. We will move the center of the Sphere01 object to the combined 
  341. center of all the Cube objects.  To do this, we will use an Absolute 
  342. Position.  This takes two points from the stack - a Source point, and a 
  343. Destination point.  The key created will move the source point over to 
  344. the destination point.  In our case, the source point is the center of the 
  345. Sphere01 object.  The destination point is the center of the entire set of 
  346. Cube objects.  To do this involves a new command which retrieves a 
  347. coordinate from the bounding box of an object or selection set.  
  348.  
  349. 1) To begin, using the standard 3DS tools, set the current frame to 2 
  350. (this is not a required step, but will allow us to view the results of the 
  351. operation while still within the calculator IPAS routine).  
  352.  
  353. 2) Run CALC.  (Press F12, select CALC)
  354.  
  355. 3) Enter the frame number on the stack, 2.  This is the frame number 
  356. for the Position key.
  357.  
  358. 4) Now we need to retrieve the source point coordinate (i.e. the center 
  359. of the Sphere01 object).  Do this by Shift-Clicking on the 
  360. Object->Pt button (we shift click because the stack is not clear, yet 
  361. we would like to be prompted for the values anyway).  
  362.  
  363. Object->Pt returns coordinates from objects or selection sets.  It 
  364. requires two arguments, a frame # and an object.
  365.  
  366. 5) The first prompt is for the Frame #, enter 2.  This is frame number at 
  367. which we wish to retrieve the coordinates.  
  368.  
  369. 6) Next you are prompted to tag a selection set of objects.  Select object 
  370. Sphere01 and press OK.  
  371.  
  372. 7) A dialog box pops up allowing your to retrieve any coordinate from 
  373. the bounding box of the sphere.  Notice you can build any combination 
  374. of Width/Depth/Height and Min/Cen/Max.  This give you good 
  375. flexibility in choosing a coordinate for exact alignment of objects.  In 
  376. our case we want Width/Cen, Depth/Cen, Height/Cen (i.e. the 
  377. middle of the sphere).  Select OK and you will see the coordinate is 
  378. returned to the stack. It should read (0.00,-288.00,288.00). 
  379.  
  380. This is the source point for our absolute move operation.  We now need 
  381. the destination coordinate.  This is the center point of all the Cube 
  382. objects.  Again we will use the Object->Pt function.  
  383.  
  384. 8) The stack is not clear, so to have the program prompt us for the 
  385. parameters we Shift-Click the Object->Pt button.  
  386.  
  387. 9) You are prompted for the Frame #.  Enter 2.
  388.  
  389. 10) Next, tag all the Cubes (8 total) and press OK.
  390.  
  391. 11) Again, select the Width/Cen, Depth/Cen, Height/Cen 
  392. buttons and then select OK.  The center of the entire group of Cubes is 
  393. returned to the stack.  This is our destination point.  It should read 
  394. (0.00,0.00,24.00).
  395.  
  396. 12) Now, the last step is to enter the object to move onto the stack.  Use 
  397. the Choose Obj button, and select Sphere01.  
  398.  
  399. At this point, your stack should have the Frame # in level 4, the Source 
  400. point in level 3, the Destination point in level 2, and the Object in level 
  401. 1 and  as shown below.  
  402.  
  403. Level 4: 2.00
  404. Level 3: (0.00,-288.00,288.00)
  405. Level 2: (0.00,0.00,24.00)
  406. Level 1: Sphere01
  407.  
  408. 13) If this is so, make sure the Absolute radio button is active, and 
  409. press the Position button.  You will get the message "Position Key 
  410. Created".  
  411.  
  412. If you previously set 3D Studio's current frame number to 2, you can 
  413. use the Hide Dialog function (the button in the upper right corner of the 
  414. dialog) to temporarily hide the calculator so we can see the results of the 
  415. move.  Try this out - Click on Hide Dialog.  3DS's display is redrawn, 
  416. and Sphere01 has moved to the center of the group of Cubes.  To restore 
  417. the calculator, press either mouse button.  This is handy if you are going 
  418. to perform several sequential operations and you want to view the 
  419. intermediate results without leaving the calculator.
  420.  
  421. Lets try one more operation, Absolute Scale.  
  422.  
  423. In Relative mode, Scale creates keys which represent a size relative to 
  424. the objects size in the 3D Editor before any keys were created.  So a 
  425. scale factor of 2 would put the object at twice its original size at that 
  426. frame.  For this example, lets use Absolute mode, and scale Sphere01 
  427. such that its bounding box exactly encloses all our rotated Cubes.   
  428. This will expand the sphere in width and depth, and shrink it in height.  
  429. This will demonstrate how you can extract information from some 
  430. objects and apply that info to other objects.  
  431.  
  432. 1) As usual, first we enter the frame number, say frame 3.  
  433.  
  434. Next we need the bounding box size of all the Cube objects.  There is a 
  435. separate function to retrieve the bounding box size of an object or 
  436. selection set called GET_OBJECT_SIZE.  This is available directly 
  437. from the buttons in the dialog (Object Size), but what we will do is 
  438. assign the function to a key on the keyboard.  The keys A-Z are 
  439. available.  Lowercase is the same as uppercase.  
  440.  
  441. 2) To assign GET_OBJECT_SIZE to a key, Ctrl-press a keyboard key.  
  442. Press the Ctrl-O key.  If the key is already assigned, you will be 
  443. asked if you want to change it.  (Answer Yes if it asks).  A list of all the 
  444. functions available is presented.  Choose GET_OBJECT_SIZE and 
  445. press OK.  The key is assigned and available for use. 
  446.  
  447. Now, lets use GET_OBJECT_SIZE.  
  448.  
  449. 3) Hold down the Shift key and press the O key.  Again, the Shift is 
  450. so we will be prompted for the parameters.
  451.  
  452. 4) You are prompted for the Frame #.  Enter 3.
  453.  
  454. 5) Next, tag all the Cube objects (8 total) and press OK.
  455.  
  456. The bounding box size of the entire selection set at frame 3 is returned to 
  457. level 1.  It should read (321.95,307.88,81.93).  This is the size 
  458. we will assign to the bounding box of object Sphere01.  
  459.  
  460. 6) The final parameter for Absolute Scale is the object name in level 1, 
  461. so use the Choose Obj button and select Sphere01 from the list.  
  462.  
  463. At this point, the Frame # should be in level 3, the Size should be in 
  464. level 2, and the Object should be in level 1 as shown below.  
  465.  
  466. Level 3: 3
  467. Level 2: (321.95,307.88,81.93)
  468. Level 1: Sphere01
  469.  
  470. If not, use the stack manipulation functions to reorganize the stack so the 
  471. parameters are in the correct order.  
  472.  
  473. 7) When the values are ordered OK,  make sure the Absolute button 
  474. is active, and press Scale.  The program will respond "Scale Key 
  475. Created".  Press ESC to Return to 3DS.  Answer Yes to save your 
  476. changed Key Assignments.  Using the 3DS tools, go to frame 3, and 
  477. notice that the sphere has been scaled so its bounding box is exactly fit 
  478. around the entire volume consumed by the Cubes.  This may be easier to 
  479. see if you turn on Box mode (Alt-B).  This type of inter-object 
  480. keyframing is the idea behind the calculator design.  You can extract 
  481. parameters from existing objects and use them as input to create new 
  482. keyframes.   
  483.  
  484. Reading Key Data from a File
  485.  
  486. This is the final section of the tutorial.  We will read key data from a 
  487. text file.  This allows very simple keyframe scripting of Position, Scale 
  488. and Rotation.  This is accomplished with the READ_SCRIPT_FILE 
  489. command.
  490.  
  491. Before we run the command, take a look at the demo file KC-
  492. DEMO.TXT.  Do this by loading it into 3D Studio's text editor.
  493.  
  494. 1) Press F11 to get to the text editor.
  495.  
  496. 2) Select File/Load and choose C:\KC-DEMO.TXT
  497.  
  498. Notice that the first few lines begin with REM or the // characters.  
  499. These are comments.  These lines are used to make the file more 
  500. readable for humans, but are ignored by the program.  
  501.  
  502. The format of keyframe data in the file is:
  503. KEYFRAME TYPE; FRAME #; OBJECT NAME; DATA;
  504. The actual keyframe data starts with the line beginning ABS-
  505. POSITION.  This first key line reads:
  506. ABS-POSITION;  0; Hedra01; -72',0,0;
  507. This indicates we wish to create an Absolute Position key.  This will 
  508. place the pivot point of  object Hedra01 at Absolute World coordinate 
  509. -72',0,0 at frame 0.
  510. The next key line reads:
  511. REL-POSITION;  1; Hedra01;  10'<0;
  512. This will translate Hedra01 by 10' at an angle of 0 degrees in plan at 
  513. frame 1.  The remainder of the position keys resemble these two lines.  
  514. There are also Scale and Rotation keys listed.  Note that in each case we 
  515. have one key per line and each data field is separated with a semicolon 
  516. (;).  The valid Keyframe Types are: ABS-POSITION, REL-
  517. POSITION, ABS-SCALE, REL-SCALE, and ROTATION.   You 
  518. can review the function reference section for more detail on all the data 
  519. formats allowed.
  520.  
  521. Lets run the READ_SCRIPT_FILE command and see what it creates.
  522.  
  523. 2) Select File/Exit to return to the Keyframer.  Press F12 and run 
  524. CALC.
  525.  
  526. 3) Press the TAB key to get a list of the available functions and select 
  527. READ_SCRIPT_FILE.  
  528.  
  529. 4) A file selector appears.  Choose file C:\KC-DEMO.TXT
  530.  
  531. A message appears indicating the file processing is beginning.  Click 
  532. Continue.  Next a message appears indicating that 11 Position keys , 11 
  533. Scale keys and 3 Rotations keys were created.  Press Continue and then 
  534. ESC to quit the calculator and return to 3DS.
  535.  
  536. As you can see the keys have been applied to the Hedra01 object.  
  537. Thus, READ_SCRIPT_FILE is used to allow very simple keyframe 
  538. scripting of position, scale and rotation.  Just like the rest of the 
  539. calculator, you can specify the amounts in decimal and feet and inches 
  540. using a range of data formats.
  541.  
  542. That is it for the keyframing tutorial.  Check out the section below on 
  543. Strokes.  This is another method to customize your calculator.
  544.  
  545. Strokes
  546.  
  547. Strokes are a user interface technique with which you can sketch a shape 
  548. using the mouse, and assign a program command to be executed each 
  549. time the shape is drawn.  This allows you to conveniently access 
  550. commands you use frequently.  As an example, lets assign the command 
  551. PICK_OBJECT to a horizontal stroke, drawn left to right.  This is a 
  552. quick and easy stroke to sketch.  To invoke TEACH_STROKE, press the 
  553. T key.  You will be prompted to draw the stroke to teach.  Hold down 
  554. the right mouse button , and drag it horizontally from left to right.  The 
  555. length is not important.  Notice that as you drag the mouse, a series of 
  556. X's are drawn to show you the shape.  Once the shape is drawn, release 
  557. the mouse button and the X's disappear.  The program now analyzes the 
  558. shape you've drawn and assigns a name to it.  It does this by centering a 
  559. square grid over the stroke.  As shown below, each internal line segment 
  560. in the grid is given a single character name.  If the stroke drawn crosses 
  561. a particular segment, its character is added to the stroke name.  In our 
  562. case, our stroke crosses the C segment and then the D segment.  Thus 
  563. this stroke is called CD.  After you draw the stroke to teach, you are 
  564. presented with a list of all the available functions.  Scroll down until you 
  565. find PICK_OBJECT, select it and press OK.  You have now taught the 
  566. program that whenever you draw the stroke CD, you wish to execute 
  567. PICK_OBJECT.  Give it a try.  Draw stroke CD and pick an object.  
  568. The object you pick is returned to the stack.  You may use the 
  569. VIEW_STROKES command to review your stroke definitions, and 
  570. change or delete them.  Try this from the calculator by pressing the TAB 
  571. key and choosing VIEW_STROKES.
  572.  
  573.                +-------+-------+-------+
  574.                |       |       |       |
  575.                |       A       B       |
  576.                |       |       |       |
  577.                +-- G --+-- H --+-- I --+
  578.                |       |       |       |
  579.                |xxxxxxxCxxxxxxxDxxxxxxx|
  580.                |       |       |       |
  581.                +-- J --+-- K --+-- L --+
  582.                |       |       |       |
  583.                |       E       F       |
  584.                |       |       |       |
  585.                +-------+-------+-------+
  586.                  Stroke Analysis Grid
  587.              12 segments named A through L
  588.  
  589. Note: You may also teach strokes by drawing a 'T' shape with the 
  590. mouse.  If you draw any of the strokes ABBHK, BAAHK, KHAAB or 
  591. KHBBA the Teach Stroke command will be invoked.
  592.  
  593. Your stroke definitions are stored in the file CALC.STR.  When you 
  594. quit the calculator, you will be asked if you want to save the changed 
  595. definitions.
  596.  
  597. Customizing the Keyboard:
  598.  
  599. You can assign functions you often use to the keys A through Z.  
  600. Uppercase and Lowercase keys are identical.  To program a key, Ctrl-
  601. Press it.  You will be prompted to select a function to assign.  Select it 
  602. from the list and press OK.  Once it is assigned, you can execute that 
  603. function anytime by pressing the key.  These key assignments are stored 
  604. in the file CALC.KEY.  When you quit the calculator, you will be asked 
  605. if you want to save the changed definitions.  You may check to see what 
  606. function is assigned to a key by Alt-Pressing it.  A short message 
  607. appears indicating the name of the function assigned.  Then on-line help 
  608. for that function is presented.
  609.  
  610. Function Reference
  611. This is a brief description of all the functions available.
  612.  
  613. Create Keyframes
  614. CREATE_POSITION_KEY: This allows you to create Position Keys 
  615. for Objects or Selection Sets.  This command operates differently based 
  616. on the setting of Relative/Absolute Mode.  In Relative mode, the object 
  617. is simply translated by the distance specified at the frame specified.  In 
  618. Absolute mode, the specified Source point is moved to the specified 
  619. Destination point.  If you use Absolute mode and press the Ctrl-key 
  620. when you select the command, you specify a single destination for the 
  621. objects pivot point.  The required stack parameters are as follows:
  622.  
  623.     Absolute Mode (Ctrl key _not_ pressed):
  624.     Level 4: Frame #
  625.     Level 3: Source Point
  626.     Level 2: Destination Point
  627.     Level 1: Object or Selection Set
  628.     Absolute Mode (Ctrl key pressed):
  629.     Level 3: Frame #
  630.     Level 2: Destination Point for Pivot
  631.     Level 1: Object or Selection Set
  632.     Relative Mode:
  633.     Level 3: Frame #
  634.     Level 2: Offset Distance to translate
  635.     Level 1: Object or Selection Set
  636.  
  637. The Source and Destination points may be specified in any of the 
  638. following formats:
  639.     Rectangular: Width, Depth, Height
  640.     2'3",4'3-1/2",5"
  641.     Polar: Distance<Angle in Plan (Zero degrees is along the 
  642. +Width axis)
  643.     5.125'<270.1
  644.     Cylindrical: Distance<Angle in Plan, Height
  645.     4'<45,8'
  646.     Spherical:  Distance<Angle in Plan<Angle Up from Plan
  647.     4'<45<30.5
  648.  
  649. CREATE_ROTATE_KEY: This allows you to create Rotation Keys for 
  650. Objects or Selection Sets.  The rotations are specified as angles about the 
  651. objects local axis.  For example, the rotation amount 
  652. (0.0,45.0,87.125) specifies to rotate 0 degrees about the objects 
  653. local Width axis, 45 degrees about the objects local Depth axis, and 
  654. 87.125 degrees about the objects local Height axis.  The right hand rule 
  655. is used for determination of positive angles.  The required stack 
  656. parameters are: 
  657.  
  658.     Level 3: Frame #
  659.     Level 2: Rotation: (Width,Depth,Height)
  660.     Level 1: Object or Selection Set
  661.  
  662. CREATE_SCALE_KEY: This allows you to create Scale Keys for 
  663. Objects or Selection Sets.  This command operates differently based on 
  664. the setting of Relative/Absolute Mode.  In Absolute mode, the Objects 
  665. bounding box is forced to the specified size.  In Relative mode, the 
  666. object is scaled along each of its local axes by the factor specified.  The 
  667. required stack parameters are:
  668.  
  669.     Level 3: Frame #
  670.     Level 2: Scale Factor or Factors 
  671. (Width,Depth,Height)
  672.     Level 1: Object or Selection Set
  673.  
  674. READ_SCRIPT_FILE:  This function allows you to read keyframe 
  675. data from a text file.  The file name extension it looks for is .TXT.  The 
  676. format of data in the file is:  KEYFRAME TYPE; FRAME #; 
  677. OBJECT NAME; DATA;
  678. One key per line.  Separate each data field with a semicolon (;).  Each 
  679. line should end in a semicolon and a Carriage Return.
  680. Examples:
  681. Rel-Position; 4; Object01; 23',0,200';
  682. Abs-Position; 20; Object02; 0,0,-50';
  683. Abs-Scale; 21; Object03; 0.36,0.24,0.36;
  684. Rotation; 1; Object01; 0,0,359.98;
  685.  
  686. Note that each part of the line is separated by a semicolon, and that the 
  687. line ends in a semicolon (;).  The valid Keyframe Types are: Abs-
  688. Position, Rel-Position, Abs-Scale, Rel-Scale, 
  689. and Rotation.  The case of the Keyframe Type is not relevant.  
  690. Only the first 5 characters of the Keyframe Type are looked at.  The 
  691. case of the Object Name is relevant.  The Data field may be any valid 
  692. type as used by the commands in the rest of the calculator.  Position 
  693. keys may use REC/POL/CYL/SPH.   Scale and Rotation keys use 
  694. Rectangular only, formatted Width,Depth,Height.
  695. Error checking is provided to try to handle most cases of bad data, but 
  696. there may be strange cases which are not detected, so enter your 
  697. keyframe data carefully.
  698.  
  699. You may include blank lines in the text file.  You may also use inline 
  700. comments by beginning the line with REM or the // characters .  You 
  701. can also display a text message during the file processing using the 
  702. ECHO statement.  The displayed message is limited to 70 characters or 
  703. less.  Below is a complete sample file showing the commands which may 
  704. be used.
  705.  
  706. ECHO Beginning to process file...
  707. // An Absolute Move to get to a known start 
  708. point of 0,0,0
  709. ABS-POSITION; 0; Object01; 0,0,0;
  710. // Down to the initial depth
  711. ABS-POSITION; 1; Object01; 0,0,-50';
  712. // Then add the other positions as relative 
  713. moves ...
  714. REL-POSITION; 2; Object01; 70'<300,-5';
  715. REL-POSITION; 3; Object01; 40'<240,10';
  716. REL-POSITION; 4; Object01; 110'<200,-20';
  717. REL-POSITION; 5; Object01; 50'<180,25';
  718. REL-POSITION; 6; Object01; 40'<150,20';
  719. REL-POSITION; 7; Object01; 60'<90,20;
  720.  
  721. // Force Object01 to a 2'x4'x6' box...
  722. ABS-SCALE; 1; Object01; 2',4',6'
  723.  
  724. // Now make it twice as big in Width/Depth, and 
  725. 3 times 
  726. // in Height
  727. REL-SCALE; 8; Object01; 2.0,2.0,3.0
  728.  
  729. // Now rotate Object01 180 degrees about the 
  730. Height axis
  731. ROTATION; 9; Object01; 0,0,180.0
  732. ECHO File processing Complete...
  733.  
  734. Retrieve Existing Keys (or Interpolate between keys)
  735. GET_POSITION_KEY:  Retrieves the values of an objects position at 
  736. the specified frame number.
  737. GET_SCALE_KEY:  Retrieve an objects scale factor at the specified 
  738. frame number.
  739. GET_PIVOT_POINT:  Retrieves an objects pivot point.  If Absolute 
  740. mode is active, the world coordinate of the pivot is returned, otherwise 
  741. if Relative mode is active, the pivot point returned is relative to the 
  742. objects bounding box center.
  743.  
  744. Display Functions
  745. DISPLAY_AS_DECIMAL:  Converts the display of the number or point 
  746. in level 1 to decimal.
  747. DISPLAY_AS_FTIN:  Converts the display of the number or point in 
  748. level 1 to feet and inches.
  749. ABSOLUTE_TOGGLE:  Toggles Absolute mode On/Off.
  750. FORMAT_TOGGLE: Toggles point display between REC/CYL/SPH 
  751. display.
  752. HIDE_DIALOG: Temporarily hides the calculator dialog box so the 
  753. 3DS screen may be viewed.
  754. VIEW_LEVEL_1: This function allows you to view the entire contents 
  755. of level 1 if the line is too long to be visible in the stack window.  You 
  756. may also use this function to view and edit any Selection Set, Matrix, or 
  757. RGB Color value in level 1.
  758. QUIT:  Terminates the calculator.  If there were any changes to key or 
  759. stroke assignments, you will be asked if you wish to save them.
  760.  
  761. Function Execution
  762. FUNCTION_LIST:  Brings up a dialog of all available functions.  You 
  763. may Alt- or Shift- click items in this list to bring up help or parameter 
  764. prompts just like you can for buttons in the dialog box.
  765. REPEAT_LAST_FUNC:  This repeats the last function you have 
  766. executed.  It is most appropriate to use this by assigning it to a stroke or 
  767. keypress.
  768.  
  769. Select Objects or Sets
  770. Selection Sets are used to apply keyframes to multiple objects at once.  
  771. Identical keys are assigned to each object in the selection set.
  772.  
  773. TAG_SELECTION_SET:  Creates Selection Set by tagging objects By 
  774. Name.
  775. PICK_OBJECT:  Graphically Pick a single Object.
  776. PICK_SELECTION_SET:  Graphically Pick a Selection Set of 
  777. Objects.  In order to complete the selection set, select one of the objects 
  778. you have already selected _again_.  The program recognizes this and 
  779. terminates the selection.  Do not press the right mouse button during 
  780. selection as this will terminate the entire IPAS program.  (This limitation 
  781. is necessitated by the IPAS toolkit).
  782. CHOOSE_OBJECTS:  Choose a single object By Name.
  783.  
  784. Stroke Operations
  785. Strokes are a user interface technique with which you can sketch a shape 
  786. with the mouse and assign a program command to be executed each time 
  787. the shape is drawn.  This allows you to quickly access commands you 
  788. use frequently. 
  789.  
  790. TEACH_STROKE:  This allows you to create a new stroke definition.
  791. VIEW_STROKES:  This allows you to see your stroke definitions and 
  792. change and delete them.
  793. DELETE_STROKE:  This allows you to draw a stroke to delete.
  794.  
  795. Stack Manipulation
  796. CLEAR_STACK:  Delete the entire stack contents.  If the stack is  clear,  
  797. any commands  requiring  several  arguments  will automatically prompt 
  798. for all the required  parameters.  This is also useful if you receive a 
  799. stack full message.   The Last function will undo the effect of Clear.
  800. LAST_STACK:  Restore the previous stack contents before the last 
  801. command was executed.  If you Shift-Click on the button,  the last stack 
  802. contents are merged with the current contents.
  803. STACK_TO_POINT:  This function take one, two or three real 
  804. arguments off the stack, and  converts them to a  point entity.   If less 
  805. than three reals are specified, the missing values are filled with zeros.  
  806. The Width argument is in level 1, the Depth argument is in level 2, and 
  807. the Height argument goes in level 3.
  808. POINT_TO_STACK:  This function takes a  point argument and 
  809. converts it to  three real  values.   The rectangular  form  of the  point is 
  810. always what is entered on the stack, regardless  of how the point is 
  811. formatted (REC/CYL/SPH).  The  Width parameter goes to  level 1, the 
  812. Depth to level 2, and the Height to level 3.
  813. SWAP_1_AND_2, SWAP_1_AND_3, SWAP_1_AND_4, 
  814. SWAP_2_AND_3, SWAP_2_AND_4:  Swap stack data between two 
  815. levels.
  816.  
  817. Retrieve Coordinates from existing Objects or Selection Sets
  818. OBJECT_TO_POINT:  This function  allows you  to retrieve 
  819. coordinates from the bounding box of an object  or selection set of 
  820. objects.  You will be presented with a dialog box where you may choose 
  821. any  combination of Min/Cen/Max for Width/Depth/Height.   If you  
  822. select with  Shift-Click, you will be prompted for all required values.
  823. GET_OBJECT_SIZE:  This function allows you to retrieve the 
  824. bounding box size of an object or selection set at any frame.   If you  
  825. select with  Shift-Click, you will be prompted for all required 
  826. parameters.
  827.  
  828. Basic Math Functions
  829. +, -:  Addition and subtraction operate on real numbers, points, 
  830. matrices, colors, objects and selection sets.
  831. *, /:  Multiplication and division operate on real numbers, points, 
  832. matrices, and colors.
  833. %: Returns level 2 percent of level 1.
  834. %CH:  Percentage change between level 2 and level 1.
  835.  
  836. SINE  (Trig functions: These work, but there is no practical application 
  837. yet...)
  838. COSINE
  839. TANGENT
  840. ARC_SINE
  841. ARC_COSINE
  842. ARC_TANGENT
  843. SQUARE_ROOT:  Square root of real in level 1.
  844. ^ or EXPONENTIATION: Returns level 2 to the power of level 1.
  845.  
  846. Numeric Conversion
  847. ABSOLUTE_VALUE:  Absolute Value of real or point in level 1.
  848. CHANGE_SIGN:  -1 times the real or point in level 1.
  849. INTEGER_PORTION:  Returns the whole number portion of the real in 
  850. level 1.
  851. FRACTIONAL_PORTION:  Returns the fractional portion of the real in 
  852. level 1.
  853. ROUND_TO_DISP_PREC:  Alters the numeric value of the real number 
  854. in level 1 to match the displayed value.  This will truncate the value to 
  855. the number of displayed decimal places.
  856.  
  857. Matrix Operations
  858. These operations create or alter 3 x 4 Transformation Matrices.  You 
  859. can't do anything with them yet however...They will be used in the 
  860. future.
  861. ENTER_MATRIX:  Create a new matrix.
  862. MATRIX_INIT:  Initialize a new matrix.
  863. GET_OBJECT_XFORM:  Retrieves a 3 x 4 matrix representing a node's 
  864. transformation (relative to the world).  This is returned by the IPAS 
  865. command kxp_get_xform. 
  866.  
  867. Color
  868. RGB Color values may be entered, added, subtracted, multiplied and 
  869. divided.  You can't to anything with them yet however ... They will be 
  870. used in the future.
  871. ENTER_COLOR:  Allows you to enter a new color on the stack.
  872. EDIT_COLOR:  Edits an existing color on the stack.
  873.