Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

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"

Pages: [1] 2 3

Author Topic: Animated Parameteric Plug-in Scripts  (Read 4509 times)

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2039
    • View Profile
Animated Parameteric Plug-in Scripts
« on: December 24, 2020, 10:44:27 am »

I have a prelimimary version of Anim8or Build 1394+ that supports animated parameteric plug-in meshes. You can reference the frame and time variables to animate them. Here's how it works:

1. Add the new directive #animated after the #plugin("obect", ...) directive.
2. The value of the built in variable "time" will be the scene's time in seconds, and the variable "frame" will be set to the frame number.

There are still a few loose ends in this build, such as the meshes don't revert to frame 0 in the Object editor. I hope to have an oficial buld out soon.

ianross I've modified one of your wave scripts to animate the waves. I added the statement:

$time = $time + time*10.0;

and here's what it looks like in a scene:

Logged

NickE

  • Full Member
  • ***
  • Posts: 162
    • View Profile
Re: Animated Parameteric Plug-in Scripts
« Reply #1 on: December 25, 2020, 02:09:38 pm »

Wow, Steve!
That is a great Christmas present! I have been asking for this for years!
Thank you, thank you, thank you!

NickE
Logged

2020 Hindsight

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: Animated Parameteric Plug-in Scripts
« Reply #2 on: December 29, 2020, 05:49:39 am »

That looks great Steve! I shall have to have a play with it.

John
Logged

ianross

  • Full Member
  • ***
  • Posts: 205
  • Imagination is the elixir of life.
    • View Profile
    • https://www.tradebit.com/filedetail.php/164976574-part-1-anim8or-tutor-course
Re: Animated Parameteric Plug-in Scripts
« Reply #3 on: December 29, 2020, 05:57:35 am »

Hi Steve, I did not have the pleasure of creating the new wave script, all credit goes to my good friend Hindsight. So a big thank you to Hindsight, he is new to anim8or and this is a remarkable achievement for a newbie.
Also thank you Steve for the help to make the wave script animated.
Wishing all anim8ors a Happy and Safe New year.
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2039
    • View Profile
Re: Animated Parameteric Plug-in Scripts
« Reply #4 on: December 29, 2020, 11:53:12 am »

Grest script, 2020 Hindsight. I still have a couple of issues to work out but I should have a more solid build out soon.
Logged

2020 Hindsight

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: Animated Parameteric Plug-in Scripts
« Reply #5 on: December 29, 2020, 07:01:14 pm »

This is my first try of Anim8or's animated parametric plug-in meshes. It is cribbed off Steve’s demo files. But I have moved the wave source closer, rotated the wave direction 180 degrees, and added a decaying wave origin at the centre of the grid (offset from grid by 0.49 to reduce the splash height. But this resulted in a truncated splash. Is it possible to subdivide faces on an animated parametric plug-in mesh? ):

Thanks for all your work Steve!
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2039
    • View Profile
Re: Animated Parameteric Plug-in Scripts
« Reply #6 on: December 30, 2020, 04:54:01 am »

Ahhh, yes, subdivided parameteric meshes! You read my mnd. I alrady have that about 3/4 finished :)
Logged

2020 Hindsight

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: Animated Parameteric Plug-in Scripts
« Reply #7 on: December 30, 2020, 05:10:38 am »

:)
Logged

2020 Hindsight

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: Animated Parameteric Plug-in Scripts
« Reply #8 on: December 30, 2020, 07:34:40 am »

Hi Steve – you may want to shout “That’s forboden!” at me, but …

The parameter editor only allows 10 parameters, which was a bit limiting on the waves script. Originally I had separate scaling factors for X, Y, and Z. And as an experiment I just added back the “Z scale” (as an eleventh parameter). From the .an8 file I can configure the wave scrip with all 11 parameters (proved by animating big and small waves).

Should it be safe to add extra script accessible only parameters?

If I select the wave object, and bring up the “Parametric Plug-in Editor” then hit “OK”, I get the error “Bad value:  Z scale”. And if I hit “Cancel” I get “Anim8or has stopped working”.

If I just load the .an8 script that sets all 11 parameters, I can produce animations without a problem.
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2039
    • View Profile
Re: Animated Parameteric Plug-in Scripts
« Reply #9 on: December 30, 2020, 11:19:29 am »

Heh heh! You're hacking the Anim8or file format

The 10 parameter limit is artificial, I know. I thought it would be sufficient and it was a simpler dialog. I'll see what I can do.

As for adding the parameter to the .an8 file, at least it somewhat works
Logged

2020 Hindsight

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: Animated Parameteric Plug-in Scripts
« Reply #10 on: January 05, 2021, 07:21:29 pm »

I’ve had a bit of a play with the animated waves, and tried to give the impression of interaction between an object and water.

I added a function to the script to make a boat hull shaped splash. I felt that otherwise it looks artificial - I probably should do another animation without calling the addBoat() function, and compare them:
/* Function: $addBoat( float $x, float $y, float $direction, float $length, float $width )
 *
 * x,y - Center of boat
 * direction - direction boat is pointing
 * length - length of the boat
 * width - width of the boat
 */

If you set the width to the same value as the length, then your boat is a coracle, or Rover from The Prisoner, as I have animated! (Well a sphere is a lot easier to model than a boat!)

Having the ball bobbing around a bit would help with the realism.

The function adds a number of decaying wave sources around the periphery of the boat:
$DecayingWaveOrigins.push( ($x + $len_x * $dy - $len_y * $dx,
                            $y + $len_x * $dx + $len_y * $dy,
                            1, 12) ); // amplitude, wave length


The last two parameters set the wave height and the wave length.

Anyway here is the result:
[/youtube]

I notice that the video on YouTube isn’t as sharp as the video I uploaded. I have been using the “Intel IYUV codec” for video compression. Is there a better choice for uploading to YouTube?

Logged

2020 Hindsight

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: Animated Parameteric Plug-in Scripts
« Reply #11 on: January 05, 2021, 07:45:14 pm »

The addBoat() function can make boat shaped splashes too (well ellipses anyway).

Here is an animation I made testing this functionality – you see the splashes but I haven’t added a boat.

I think I used a length of 20, a width of 5, and an angle of PI/6 radians (which is 30 degrees).
Logged

2020 Hindsight

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: Animated Parameteric Plug-in Scripts
« Reply #12 on: January 06, 2021, 06:09:20 pm »

Waves around ball but with no call of addBoat()
(For comparison with "Waves around a ball animation, with decaying waves around the ball.")

[/youtube]
The second video is the video I posted before of "Waves around a ball animation, with decaying waves around the ball."

As I mentioned in the earlier post: It is a shame that the YouTube video quality is so fuzzy – the video I uploaded was nice and crisp. I have been using the “Intel IYUV codec” for video compression. Is there a better choice for uploading to YouTube?
Logged

johnar

  • Sr. Member
  • ****
  • Posts: 989
  • Make it, Move it--Give it Life
    • View Profile
    • youtube vids
Re: Animated Parameteric Plug-in Scripts
« Reply #13 on: January 07, 2021, 01:53:20 am »

 Just wanted to say how sweet that animated water looks.
At first it looked, to me, like the ground grid was underneath  and scene mode had been flooded.
 Really cool stuff.


 
« Last Edit: January 07, 2021, 01:58:55 am by johnar »
Logged
%

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2039
    • View Profile
Re: Animated Parameteric Plug-in Scripts
« Reply #14 on: January 07, 2021, 06:24:22 am »

johnae the ground grid is underneath the water. The water has an index of refraction of 1.3 which redirects the rays as you look trough the surface.
Logged
Pages: [1] 2 3