Page 16 of 16

Posted: Sun Aug 09, 2009 9:32 am
by Rudiger
Since you offered, Genete... :D

I'm on the verge of releasing a version of my morph dials scripts, now with similar pose array support, and I was looking at this script to see if there were any optimizations I should consider adding. My script tends to bloat out the memory that AnimeStudio uses, so I was interested in adding some calls to Lua's collectgarbage function. Unfortunately, the syntax for this function seems to have changed from Lua 5.0 to 5.1, so your poses script doesn't currently work with ASP v6.0.
Lua 5.0 Manual wrote:collectgarbage ([limit])

Sets the garbage-collection threshold to the given limit (in Kbytes) and checks it against the byte counter. If the new threshold is smaller than the byte counter, then Lua immediately runs the garbage collector (see 2.9). If limit is absent, it defaults to zero (thus forcing a garbage-collection cycle).
Lua 5.1 Manual wrote:collectgarbage (opt [, arg])

This function is a generic interface to the garbage collector. It performs different functions according to its first argument, opt:

* "stop": stops the garbage collector.
* "restart": restarts the garbage collector.
* "collect": performs a full garbage-collection cycle.
* "count": returns the total memory in use by Lua (in Kbytes).
* "step": performs a garbage-collection step. The step "size" is controlled by arg (larger values mean more steps) in a non-specified way. If you want to control the step size you must experimentally tune the value of arg. Returns true if the step finished a collection cycle.
* "setpause": sets arg as the new value for the pause of the collector (see §2.10). Returns the previous value for pause.
* "setstepmul": sets arg as the new value for the step multiplier of the collector (see §2.10). Returns the previous value for step.
So I was wondering if you, or Tim knew how to replicate the old functionality with this new syntax.

Thanks in advance

Posted: Sun Aug 09, 2009 1:19 pm
by Genete
So I was wondering if you, or Tim knew how to replicate the old functionality with this new syntax.
Maybe use:

collectgarbage ("step", arg)

in all places where it is used in the old script and start with arg =10.

I have not more lua knowledge or experience that the reading of the scripts and some reading of the lua manual. :)

-G

Posted: Fri Feb 12, 2010 12:13 am
by Mylenthes
I know this is an old topic but the new script doesnt work and the first script messes up the original bone like i cant move the main bone to move the eyes any more.