Frame by frame idea

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Frame by frame idea

Post by Víctor Paredes »

Edit: Download link is on my next post

OK, I have this idea for button with a shortcut to create frame by frame animation easily.

Let's start with the AS normal behavior: when you draw a line, the line and points will be on the layer for ever, even when you turn off the visibility or select an absolute alpha color or whatever. You can hide the shape, but the points will be always there. You can't erase points in the middle of the animation without losing them at all. They are there or they absolutely aren't there.

This behavior makes that make a simple frame by frame be very tricky in AS.

My idea is to create a button script which take the created points and reduce them to a very little single space (I mean, all points on the same far x,y coordinate so they will look like just as one single point) and turn all shape alpha values to absolutely transparent.

That is how I imagine it working: let's suppose you have a ball which fall in water and you want to animate some simple lines for drops sprinkling from water.
For a sprinkling effect you just need, for example, three frames with three different drawings. Just like in next draw
Image
To make it, create a new vector layer and in the frame the ball touch the water you rapidly freehand some drops. Then, in next frame, you press this script button. It will create a new keyframe taking all points and shapes and reducing this to become a little invisible point and also changing the new and previous keyframes interpolation to step. Then, you draw the second frame you want. Ok, now advance to third frame you want, press the button -same hiding process- and draw the third frame. Go to next frame and press the button again.
This way you will obtain three different draws on the same layer. No interpolation, just for make some details, as the drops falling or for drawing lines of velocity of an arm moving fast.

I think that the step interpolation could be automatically added to have the ability of make draws which be visible more than a single frame. So, you draw it, advanced two or more frames, press the button and draw another thing. As the interpolation is set as step, there wouldn't be a black hole animation, just a change of draw.

I'm sorry this request be so long written. I just want to be sure you capt the idea (and as I don't trust in my English, try to explain it very carefully).

What do you think?

Thanks!
Last edited by Víctor Paredes on Sun Dec 20, 2009 6:11 pm, edited 1 time in total.
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Post by rylleman »

I think it's a pretty clever idea that should work.
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 »

Ok, the script is already written and you can download it here (new mediafire link, if this is not working, look for the code on next messages), Synth just send me an e-mail and actually what I read make me very sad
Synthsin wrote:Selgin,

I'm no longer posting publicly on the forum, as well as at least one
other scripter, but that idea was easy enough to write, so I thought
I'd send it to you, personally. It works just like you described. You
can post this script to the forum if you like. I only ask that you
include this message in any post with a link to the script.

Synthsin
I don't want to use this thread to start a debate about, but seems very sad that some decisions make important users as Synth and others to decline posting the forum anymore. I think we had a very harsh time as community with the surroundings of the arriving of AS 6 and I hope all the free constructive speaking be re-stabilized soon, as it always has been.
I hope all this get a solution.
Last edited by Víctor Paredes on Sun Jul 05, 2009 5:27 pm, edited 1 time in total.
User avatar
Mikdog
Posts: 1901
Joined: Tue Jul 05, 2005 3:51 pm
Location: South Africa
Contact:

Post by Mikdog »

I'm also sad to read that :(

Wonder why he left. I think he should have been included in the beta testing? Or he bought AS6 from WalMart and got the wrong end of the stick. Or had problems rendering to video, I remember, with AS6. Or he's using Linux or something.

Sad to see him go. Maybe he'll get a change of heart.

Back on topic, thanks for the script. A clever idea, I haven't tried it, not sure I will, let me know how the workflow goes for you Selgin ;)

Heya Synth.
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Post by rylleman »

That download link just loops back to this topic. No script. :(
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Post by chucky »

Frame by frame, I do this :
Draw on frame 0 use the sequencer to move that frame in its place on the time line and then place an onion skin on that frame, go back to frame 0, then draw the next frame with the onion skin(s) as reference, then repeat the process .
Pity about Synth, I really don't understand, other than Walmart put stock on the shelves early, what do they know, right? Mmakes no difference to me, I bought AS6 as I always would have.

We miss you Wes. :cry:
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 »

rylleman wrote:That download link just loops back to this topic. No script. :(
Oh, sorry, here you have a link on mediafire
http://www.mediafire.com/?cwnm5yjzmxn
If that link doesn't work, here you have the icon Image and the code of the script

Code: Select all

-- **************************************************
-- Provide Moho with the name of this script object
-- **************************************************

ScriptName = "Syn_SingleLayerFBF"

-- **************************************************
-- General information about this script
-- **************************************************

Syn_SingleLayerFBF = {}

function Syn_SingleLayerFBF:Name()
	return "SingleLayer FBF"
end

function Syn_SingleLayerFBF:Version()
	return "1.0"
end

function Syn_SingleLayerFBF:Description()
	return "frame-by-frame on a single layer"
end

function Syn_SingleLayerFBF:Creator()
	return "(C) 2009 J.Wesley Fowler (Synthsin75), concept by Selgin"
end

function Syn_SingleLayerFBF:UILabel()
	return "SLFBF"
end

-- **************************************************
-- The guts of this script
-- **************************************************

function Syn_SingleLayerFBF:IsEnabled(moho)
    if (moho.layer:LayerType() ~= MOHO.LT_VECTOR) then
        return false
    end
    return true
end

function Syn_SingleLayerFBF:Run(moho)
    moho.document:PrepUndo(moho.layer)
    moho.document:SetDirty()
    local mesh = moho:Mesh()
    local shapeid = mesh:CountShapes() -1
    for i = 0, shapeid do
        local shape = mesh:Shape(i)
        shape.fMyStyle.fFillCol.value.a = 0
        shape.fMyStyle.fLineCol.value.a = 0
        shape.fMyStyle.fFillCol:StoreValue()
        shape.fMyStyle.fFillCol:SetKeyInterp(moho.frame, 3, 0, 0)
        local keyid = shape.fMyStyle.fFillCol:GetClosestKeyID(moho.frame - 1)
        local keyat = shape.fMyStyle.fFillCol:GetKeyWhen(keyid)
        shape.fMyStyle.fFillCol:SetKeyInterp(keyat, 3, 0, 0)
        shape.fMyStyle.fLineCol:StoreValue()
        shape.fMyStyle.fLineCol:SetKeyInterp(moho.frame, 3, 0, 0)
        shape.fMyStyle.fLineCol:SetKeyInterp(keyat, 3, 0, 0)
    end
    local pointid = mesh:CountPoints() -1
    for i = 0, pointid do
        local point = mesh:Point(i)
        local Vec = LM.Vector2:new_local()
        Vec:Set(0, 0)
        local keyid = point.fAnimPos:GetClosestKeyID(moho.frame - 1)
        local keyat = point.fAnimPos:GetKeyWhen(keyid)
        point:SetPos(Vec, moho.frame)
        point.fAnimPos:SetKeyInterp(moho.frame, 3, 0, 0)
        point.fAnimPos:SetKeyInterp(keyat, 3, 0, 0)
    end
end
chucky wrote:Frame by frame, I do this :
Draw on frame 0 use the sequencer to move that frame in its place on the time line and then place an onion skin on that frame, go back to frame 0, then draw the next frame with the onion skin(s) as reference, then repeat the process .
Try with this script, it's fantastic for fast movements, or shiver or many simple tasks that requires too much effort in AS.
Stan
Posts: 199
Joined: Sun Apr 19, 2009 3:22 pm

Post by Stan »

The script is great, the idea is genius, thank you guys!

Here is the first hmm... not bug report... asking for an improvement!)

Since the "active" and "selected" styles are now the same in version 6, this is what happens after you press the script's button: "zero alpha fill and stroke" becomes an active style, which is a little bit annoying...

Is there an easy solution for the tool to store the current style, and then return it back?

I'll keep my fingers crossed for "yes" :)

-Stan
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Post by chucky »

Thanks might give that a go, it took me a while to understand.
Weird, but it makes some kind of twisted sense... :D
User avatar
Imago
Posts: 698
Joined: Wed Dec 10, 2008 9:48 am
Location: Sardinia

Post by Imago »

This Script works only on Version 6?
Sorry for my bad english... Q_Q
Stan
Posts: 199
Joined: Sun Apr 19, 2009 3:22 pm

Post by Stan »

Here is the reply I got from Synthsin:
Synthsin75 wrote: Stan,

The problem with the current style getting a zero alpha is a problem with the new current style. Basically the current style is being taken from the selected shape, but not the animated value at the current frame. Any shape made on a frame other than zero has a frame zero alpha of zero. The only way to avoid this is to not select any shape that was created after frame zero.

I don't intend to spend time finding some long scripting workaround for bad behavior in version 6. It's really like we lost an extra painting pallet when we lost a default style. That really should have been made optional. I can't imagine working in Debut with no saved styles AND no default style. Imagine all the constant copy and pasting of styles. It'll slow me down enough in Pro.

Just try not to select those shapes, or copy a good style before you do.

Feel free to quote any of this in a post. I think it is an actual version 6 bug, but like I said, I'm not posting anymore.

Synthsin75


Imago wrote:This Script works only on Version 6?


It works perfectly in 5.6!. Just put the unzipped files into your /scripts/tool folder, and add this code to the "_tool_list.txt":

Code: Select all

button    syn_singlelayer_fbf        ...
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 »

For some reason the script is not working well on 6.1
:(
can anyone help me, please? I work with this tool on almost all my projects!

thanks
meltedtoons
Posts: 159
Joined: Mon Oct 05, 2009 6:06 am

Post by meltedtoons »

the script dosen't work on mine i have ASP 6
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 »

meltedtoons wrote:the script dosen't work on mine i have ASP 6
Haven't you any problem with shapes dissapearing or non dissapearing?
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 »

Uhm, seems to be that it works well with fazek's freehand.
Have you Fazek's or LM's frehand tool?
Post Reply