Frame Counter?

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
super8mm
Posts: 340
Joined: Sun Oct 12, 2008 11:22 pm

Frame Counter?

Post by super8mm »

Is there a script to display in the exported movie the frame number?
Handy for timing, critiques etc.

I can use the credits script that last one frame per credit but there must be a less tedious way than typing a txt file such as:

001

002

003

004

~

999


Also, I never installed a script so an install script tutorial link would be nice too please.

Come to think of it, I could use 3 credits scripts one lasting 1 frame per credit the next 10 per credit and the next 100 per credit but it would have to repeat somehow.
ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Post by ponysmasher »

Well if you want a ready made text file with numbers from 001 to 999 here you go: http://dauid.com/counter.txt

If you want it to go higher I have a javascript tool to write out numbers here: http://www.dauid.com/tools/alinks.html
User avatar
super8mm
Posts: 340
Joined: Sun Oct 12, 2008 11:22 pm

Post by super8mm »

Thanks Ponysmasher, the first one is useless since you need a blank line for it to wait for the next credit.

The second one makes Firefox crash with high numbers but works well with IE.

One tweak I had to do is change in the credits script:

page = page + 1
if (page > 10) then
break

to:

page = page + 1
if (page > 999) then
break
ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Post by ponysmasher »

Oh, I didn't know about the line break since I havent used the credit script.
I'll probably try it now though since I would also like to be able to have the frame number displayed on screen.
arfa
Posts: 244
Joined: Tue Dec 23, 2008 8:15 pm
Location: New Zealand

Post by arfa »

> super8mm
There is a frame counter somewhere on the forum. It is called counter.anme and can be embedded as an object in any *anme file. Sized, positioned as you wish.

It is great for fine tuning timing adjustments.

I tried a quick search but couldn't see it. Let me know if you still need this but can't find it and I can set it up as a download.
ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Post by ponysmasher »

Well, since I've recently started scripting I decided to give this one a go.

The result is here: http://www.dauid.com/tools/scripts/ds_framecounter.zip

EDIT: Discovered that it didn't work in AS 6.2 so here's a version for Anime Studio 6.2: http://www.dauid.com/tools/scripts/ds_f ... ter_62.zip

It's a menu script so put it in *anime studio directory*\scripts\menu\Third Party.

And this is what it looks like:
Image

It uses switch layers for numbers and creates keys between the selected start and end frames of the project.

Things to do:
*Fixed*Make selectable font (right now it uses Arial Regular)
*Fixed*Make a better default position when it's created. Now it's created in the middle of the screen.
*Some other stuff.
Last edited by ponysmasher on Thu Jun 17, 2010 10:51 pm, edited 5 times in total.
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

wow, thank you ponysmasher!
Image Image Image Image
Moho Product Manager

www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Post by ulrik »

Great script, thank you a lot! :D
ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Post by ponysmasher »

Updated with a settings pop up:
Image

The version for 6.2 is now two scripts. One like the picture above and one that won't let you choose font since loading the font list in 6.2 is really slow.
AnnieMashon
Posts: 9
Joined: Tue Feb 07, 2012 5:11 am

Re: Frame Counter?

Post by AnnieMashon »

I am using 9.2 and found that I was getting an error with InsertText, which now takes more parameters.
Here are the edits I made to that are working for me.
btw, can someone point me to the documentation for the moho API where I would find InsertText and others?

Left file: new with fixes
Right file: original
120 moho:InsertText((9-layers), "Arial Regular", true, false, false, false, 0)
120 moho:InsertText((9-layers), "Arial Regular", true, false, 0)
------------------------------------------------------------------------
------------------------------------------------------------------------
138 moho:InsertText((9-layers), "Arial Regular", true, false, false, false, 0)
138 moho:InsertText((9-layers), "Arial Regular", true, false, 0)
------------------------------------------------------------------------
------------------------------------------------------------------------
159 moho:InsertText((9-layers), "Arial Regular", true, false, false, false, 0)
159 moho:InsertText((9-layers), "Arial Regular", true, false, 0)
------------------------------------------------------------------------
------------------------------------------------------------------------
181 moho:InsertText((9-layers), "Arial Regular", true, false, false, false, 0)
181 moho:InsertText((9-layers), "Arial Regular", true, false, 0)
------------------------------------------------------------------------
------------------------------------------------------------------------
249 vec.x=-1.2 --Upper left corner of BG
250 vec.y=0.2
251
249 vec.x=-1.5 --Upper left corner of BG
250 vec.y=0.5
251
------------------------------------------------------------------------
------------------------------------------------------------------------
254 vec.x=0.05 --upper right corner of bg
255 vec.y=0.2
254 vec.x=0.2 --upper right corner of bg
255 vec.y=0.4
------------------------------------------------------------------------
------------------------------------------------------------------------
258 vec.x=0.05 --lower right corner of bg
259 vec.y=-0.2
258 vec.x=0.2 --lower right corner of bg
259 vec.y=-0.05
------------------------------------------------------------------------
------------------------------------------------------------------------
262 vec.x=-1.2 --lower left corner
263 vec.y=-0.2
262 vec.x=-1.1 --lower left corner
263 vec.y=-0.05
------------------------------------------------------------------------
------------------------------------------------------------------------
266 vec.x=-1.2 --upper left corner
267 vec.y=0.2
266 vec.x=-1.1 --upper left corner
267 vec.y=0.4
------------------------------------------------------------------------
Post Reply