General Category > ASL Scripts

ASL Parametric Script Questions

(1/3) > >>

NickE:
In writing the chain_maker parametric plugin, I ran across a couple of issues. I wonder if they can be addressed though some sort of work-around.

Issue 1:  I wanted to write the script such that it followed the selected path like in Steve's "spline.txt", but I discovered that the only way I could "activate" the script after the icon was pressed was to click in the editor window.  Clicking (or actually running the script - I cannot tell which) effectively de-selects the previous selected shape and automatically selects the shape created by the script.

Issue 2:  When a parametric plug-in script is run by clicking the icon, then clicking (or click-dragging) in the editor window, the parametric shape is created at the editor click coordinates and the origin is assigned at the new shape's "centroid".

Question 1:  Is there some way to store what was previously selected?  I've tried numerous things, but outside of having a separate non-parametric non-plugin script write it somewhere (like a material name or some attribute, etc.), then reading it with the actual parametric plugin script, nothing works.

Question 2:  Are the coordinates of the initial click in the editor window (after selecting the script's icon) stored someplace accessible?  I cannot find it in the documentation.  The availability of these coordinates has multiple applications.

Steve:  I love the scripting abilities of Anim8or!  If there is anything I can do to help with development of the ASL for all of Anim8or, please let me know.  I have been a programmer for a long time in multiple languages, and have written similar scripting languages for other applications.

Kubajzz:
I think there is no way to create parametric chain maker script.

Parametric shape properties cannot depend on what was selected before the shape was created, the shape only depends on its parameters.

The only way to create a shape according to a spline is to write a command script (that's what you have already done), but command scripts can't have parameters in the current version of ASL... So I guess we will have to wait for some of the future releases.

I love your chain maker script by the way!

NickE:
Kubajazz,

Thank you for the compliment.  I'm glad you like it.

I did post a parametric version, but I kinda cheated.  See the post in the other thread.

karate5662:
perhaps you can work around some of the issues by making a script that, when you run it with a spline selected, it stores the spline name. then, when you run the parametric script, it looks in that variable for the spline to make the chain with. if the variable is empty or does not exits, you could have the script execute the way it does now.

Steve:
The original spline following script that I posted is a"run-once to build the original object" command scripts, not a parameteric one.  It could be installed as a command script or run explicitly.  It doesn't work as a parameteric scripts.

The output of parameteric scripts are supposed to be entirely defined by their numeric parameters.  That's why they can't access any other input (like look to see what other shapes are in the object, see what frame they are in, the time of day, etc.).  If they could be influenced that way then they could look different when put into a scene, etc.

I suppose it's possible to keep the original spline as something like a lot of parameters but that's not anything Anim8or can do.  You'd have to type in a whole lot of numeric values to change the shape of the spline.  That's not something that any human I know could do in any controlled manner :).

Another more likely possibility is to make a new kind of script - a "derivative object" script or some such name.  You'd build a shape of some sort (e.g. a spline) and then attach a script to it.  Whenever the shape was modified the script would be run.   The base shape wouldn't be visible (except in the Object editor where you could edit it) but the result of the script would.  I think that would do something more like what you want.  Anyway it's an interesting idea.

Navigation

[0] Message Index

[#] Next page

Go to full version