Hi Steve,
I believe there should be a way to send data to a parametric plugin using attributes.
In the following code I am trying to define where I want a boat to be placed on my wave object (version 3 of the parametric plug-in script is called "ThirdWave").
As a first step towards doing this I tried the following code with the hope of being able to set a float called "boat1" in the .AN8 script, and read it (like time, and frame) in the .a8s script.
So in the .AN8 file I created the wave object like this:
parameteric {
name { "ThirdWave01" }
script {
object $object;
attribute $attribute;
$object = project.curObject;
$attribute = $object.NewAttribute("boat1");
$attribute = SetFloatValue( 123.45 );
}
plugin { "ThirdWave" }
base {
origin { (-347.68 65 -347.68) }
orientation { (0.70711 0 0 0.70711) }
}
material { "dielectric 1.33" }
parameter { "X Tiles" int 96 }
parameter { "Y Tiles" int 96 }
parameter { "Scale" float 10.865 "scale" "scale_x" }
parameter { "Seed" int 3454 }
parameter { "Wave origin count" int 23 }
parameter { "Max wave height" float 1.8 }
parameter { "Mean wavelength" float 15 }
parameter { "Min wave distance" float 100 }
parameter { "Wave direction" float -140 }
parameter { "Time" float 92 }
}
And in ThirdWave.a8s I tried the read the value of boat1 with this code:
file $c;
$c.open("$console", "w");
$c.print("time = %5.2f\tframe = %d\t boat1=%f\n", time, frame, boat1);
Anim8or didn't like this, and so reported "Unable to locate script for Parametric plug-in: ThirdWave". It is the variable boat1 it doesn't like. It runs if you comment out the print line - but the point of the test is to transfer a value in boat1.
Is what I'm trying to do even possible? If so how?
In addition to sending boat position to "ThirdWave.a8s" I want to return the wave height and angle of the water surface at that point back to the .AN8 controller script so that the boat can bob on the water. One of the objectives is that boats can be placed without editing the .a8s parametric plug-in script - and hopefully implement 'V' shape trails as they move across the water.
The references I have looked at are pages 135-136 of
https://www.anim8or.com/learn/pdf/anim8or_manual_1.01.1318_mark.pdfand this thread.