Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  


Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - 2020 Hindsight

Pages: [1]
Feature request for Steve,

I was wondering if it would be possible for you to add a feature to Anim8or so that if a user entered an image file name like "hero{frame}.png", Animator would understand it should replace "{frame}" with the frame number, to pull in a different image file for each frame. It would be even nicer for video editing if you could enter something like "hero{frame+30}.png" to have the first frame read from "hero30.png", then "hero31.png"... ?

I envisage this working regardless of whether you enter the file name in a dialog box, or into a '.an8' script like:
  image {
    "C:\\ANIM8OR MANUAL\\waves\\water types\\sky-1286888_960_720_{frame}.jpg" }

The image files could be generated from video by other software. I have written code to do it in Python, but I expect there are software packages available to chop video into image files.

OK,  I didn't anticipate a new update this quick, but looking at Ian Ross's yacht image made me think that it would look better if objects in the water looked like they were interacting with the water. So here is a new script to do that, called "Combo waves". It has a new icon to avoid confusion with the "waves" script.

I considered tagging this onto the end of the "waves" topic. But I think the script is different enough to warrant starting fresh. The interface for generating random waves is identical, and you should follow the instructions posted on the "waves" post,6025.0.html.

If you don't edit the script itself then this script is indistinguishable from my "waves" script. However I have modified the code to allow wave sources to be easily added.

There are two types of wave that can be added:
1) Decaying waves: These are best for boat hulls, drips, etc.
2) Immortal waves: These never reduce in size, and are good for wind produced waves - best if they are placed outside the visible area of the mesh.

As with the original "waves" script the user can play with the run time parameters to create random weather. The values plugged into the "Parametric Plug-in Editor" only act on the randomly generated waves, not the hard coded waves (actually you can write code to read $XTiles, $YTiles, and potentially other passed variables, if you want to do clever things with your hard coded waves).

To add hard coded waves look for the following comment block in the script:
// Start of additional hard coded waves block

Under this there are two sub sections:
//  Add additional hard coded non-decaying "immortal" wave origins here if required:

You can add as many additional wave origins as you want.

Each "immortal" wave origin is added with a line like:
$WaveOrigins.push( (0,0, 0.25, 5) );

In this example push() takes the parameter (0, 0, 0.25, 5). Which means the origin is at x=0,y=0, the wave height = 0.25, and the wave length = 5.

The second sub section is where decaying waves origins are added with a line like:
$DecayingWaveOrigins.push( (10, 20, 40, 7) );

In this example push takes the parameter  (10, 20, 40, 7). Which means the origin is at X=10, and Y=20, with a height of 40, and a wavelength of 7. (Decaying waves need larger height values than immortal waves do.)

You could place it at the center of the grid with:
$DecayingWaveOrigins.push( ($XTiles/2, $YTiles/2, 40, 7) );

In this example the width and height the user sets in the "Parametric Plug-in Editor" are read from $XTiles, and $YTiles, and used to find the centre.

Another variable that may be useful is "Max wave height" stored in $MaxWaveHeight

I mark the end of the area where hard coded waves should be added with the comment block:
// End of additional hard coded waves block

Have fun!

I'm new to Anim8or, and this forum. I posted a script "animated_waves.a8s" yesterday.

In my waves script there is a time field to allow moving waves to be animated.

I was wondering if there is a way to automate the animation. What I have read on the forum so far indicates I cannot get the frame number or scene time passed to the script. There was a post on animating a flame, which involved having numbered flame image files which a script read in.

Would a possibility be to write a script that saved a series of wave objects as a sequence of .stl files? Is this idea sound, but a different file format would be better?

Has anything like this been done before that I could crib from? I.e. where a form changes as a function of time or frame number?

Any guidance /  recommendations?


( I posted my wave script here:,6025.0.html )

ASL Scripts / I have written a script to simulate waves.
« on: November 13, 2020, 03:56:50 pm »
Description of the script:

To understand what the script is doing, imagine it is firing a shotgun into the water to generate waves. To get a pleasing scene you can play around with the parameters (draw a "Waves" object on the screen, then double click on it to bring up the "Parametric Plug-in Editor").

The larger the area the better the waves look, but the slower the software will run. I recommend setting the X Tiles and Y Tiles parameters to about 100.

"Scale" (I removed the Y-Scale and Z-scale parameter so that I could add "wave direction" and "Time". The X,Y, and Z Scale are now all set to "Scale".) If you want bigger/smaller waves you can change "Max wave height").

The "Seed" parameter is the random number generator seed value. If you don't like what you see, plug in a different random number into this field. Some numbers seem to be quite good seeds. I keep returning to 25637.

"Wave origin count": You can think of this parameter as how many pellets there are in the shotgun cartridge.

Expanding on the shotgun analogy, each pellet produces waves of different height, and frequency.  These are assigned randomly, guided by the following parameters:

"Max wave height": This is used to control the height of waves. This is usually best set to a value close to 1.

(Note: the unit of distance used by "Mean wavelength", and "Min wave distance" are in terms of the length of a tile side.)

"Mean wavelength": Waves are set to a random wavelength around this value.

The "Min wave distance" is basically where you target the shotgun. So some "pellets" land closer than the "min" distance - perhaps that should be renamed. The distance is measured from the center of the mesh. If you set this to 0 you can see what the "shotgun blast" looks like.

"Wave direction"  This sets where to aim the "shotgun" around the mesh in degrees (0 = 12 O'clock). Think of this in conjunction with "minimum wave distance".

"Time" This field allows animation of the water. Increasing this by 1 moves the waves by one tile length. (You can get a feel of it by advancing the time by 10, and shift-Tab, Tab, to modify the field again.)

There are a few tweaks that can be made to the script:
Originally "Wave direction" was assigned at random. This functionality can be restored by changing line 93 to: $dominantAngle = PI * frand();

With the script as it stands waves never get weaker no matter how far they are from their source. This can be changed by commenting out line 133, and uncommenting line 134. You can then get drip effects. Note that you will need to set  "Max wave height" to much bigger values than with the unmodified script, otherwise you may think the script isn't working.

In the real world long waves move faster than short waves, but I'm not sure by what ratio. In this script I have all waves advancing at the same speed. The code for this is on line 128, if you comment that line out, and un-comment line 129, the waves move according to their wavelengths.

P.S. This is my first post on this forum, it is Friday the 13th, and it's 2020 - what can go wrong?

Pages: [1]