General Category > ASL Scripts

Object Script that Generates Scene Controller Scripts

(1/3) > >>

NickE:
In response to a request from Kreator:

This script outputs to the console two controller scripts - one for position and the other for orientation - generated from reading the position and orientation components of a path.
   
This script requires Anim8or 0.97b or later.
   
The generated controller scripts must be cut and pasted from the console window (debug window) into the "Expression" areas of the controller of the scene element you wish to control.  NOTE:  this is necessary because Anim8or 0.97b broke the file export abilities.  Normally one would export these generated scripts to a text file, but the console is the only output currently available.  It is recommended that the properties of the console window be altered to allow more lines to be buffered.  Do do this:
1) Right-click on the title bar of the "Anim8or Debug Output" window, select "Properties"
2) On the "Layout" tab, increase the "Screen Buffer Size" to some large value (like 1000)
   
The number of frames that it should take to traverse the path must be placed into an integer attribute called "framesperpath" created in the object that contains the path.  If you want the path repeated continuously during the entire length of the the scene, an integer attribute called "repeat" must be created and set to 1 (set to 0 for no repeating).
   
Detailed instructions on usage:
1) Draw the path in a new object that you want followed
2) Go to Object->Attributes...
3) Select "New"
4) Type the name "framesperpath"
5) Select "Int" type
6) Type the number of frames for the path traversal
7) Select "New" again
8) Type the name "repeat"
9) Select "Int" type
10) Type either "1" for repeat or "0" for no repeat
11) Be sure the path is selected
12) Scripts->Run Scripts->path_to_controller.txt

The two scripts will be shown in the console window ready to be cut-and-pasted into the controller expression areas of the element you wish to follow the path.


Please let me know your feedback.

kreator:
Excellent Script NickE !! just what I was looking for!! Scratch my Last PM I could`nt get anything to work on my Laptop at work , which was where I was testing it .... but once I got it home and on a decent sized machine it went like magic!!

Now I`m wondering about Roll as there is provision for that as well but I don`t think that, that is implemented in the current version  ( I might be wrong though!)

Once again THANK YOU very much!

NickE:
kreator,
I am not sure what you mean by roll.  Currently the script generates two controller scripts - one for position and the other for orientation.  The orientation is generated by reading the orientation of the spline.  Since the z-direction is along the spline, you effectively only get rotations about the x and y axes from the spline.  I could easily add a provision to generate rotations about the axes if I had a clearer idea of what you have in mind.
Do you want:
1) a static tilt relative to the spline?
2) a continuous rotation as it traverses the spline?
3) all the above, plus other stuff too?

If you can give me a vision of what you are looking for, I will sure attempt it.

Oh, and of course, you are very welcome!  I am glad to contribute to the greater glory of Anim8or!

RudySchneider:
I don't mean to butt-in here, but I think kreator is referring to Roll as in Roll, Yaw, and Pitch, sometimes also referred to as Roll, Heading, and Bearing, respectively.  In general, this refers to rotations about the Z-, Y-, and X axes, respectively.  For a more long-winded explanation, or for the geeks among us, there's http://en.wikipedia.org/wiki/Flight_dynamics

kreator:
No ProbLem Rudy ...... You are quite right.
 I should have explained myself a little better, but you have nailed it on the head ....

Navigation

[0] Message Index

[#] Next page

Go to full version