Back Forum Reply New

Suggestion for animate function

Animate function is a very useful tool for many applications and testing of plugins etc. However I found it extremely inconvenient to code it when the function to be animated have long list of parameters. e.g one of mine have 21. But it has named default parameters and so use of it normally is very easy like blankclip wherein only one or two params need to be specified. It appears that I can not specify these names and fewer params than the full list of params. Will it be possible to make it work like animate(last,1,20,quot;testquot;,10,20, color=300 :10,20, color=1000)
Here test may have any number of named params only the first two have no defaults.

Originally posted by vcmohan
Animate function is a very useful tool for many applications and testing of plugins etc. However I found it extremely inconvenient to code it when the function to be animated have long list of parameters. e.g one of mine have 21. But it has named default parameters and so use of it normally is very easy like blankclip wherein only one or two params need to be specified. It appears that I can not specify these names and fewer params than the full list of params. Will it be possible to make it work like animate(last,1,20,quot;testquot;,10,20, color=300 :10,20, color=1000)
Here test may have any number of named params only the first two have no defaults.

It's not technically feasible.  Animate is an ordinary function, and functions can take named arguments only for their own parameters.  They can't take named arguments for another function, because the parser doesn't know what that other function is yet.

One simple alternative is to use a wrapper function.

Code:
function Foo(clip c, int val)
{   return c.Bar(parameter=val)
}

Animate(last, 1, 20, quot;Fooquot;, 300, 1000)You can wrap it in a new function. So

function f(clip, int x, int y)
{
clip.blankclip(width=x, height=y)
}

Animate(clip, 1, 20, quot;fquot;, clip, x1, y1, clip, x2, y2)Btw, this example doesn't work because the dimensions of the clip should remain the same, but i hope you get the idea.

edit: too late

Thanks for the info and suggestions.

But what is this c.Bar indicated by stickboy?

Originally posted by vcmohan
Thanks for the info and suggestions.

But what is this c.Bar indicated by stickboy?

Foo, Bar, Baz, Quux, ... are metasyntactic variables.  They're just generic names.

Insert anything appropriate in the place of quot;Fooquot; or quot;Barquot;.
¥
Back Forum Reply New