Page 1 of 1

Drawing while animation is playing.

Posted: Wed Nov 30, 2016 11:12 pm
by BrahRah
http://img-9gag-fun.9cache.com/photo/aAwyNrL_460sv.mp4

It's supposedly a Game Maker Studio 2 feature. I immediately thought this would be awesome feature for animation in general. Drawing and erasing while the animation plays that would be awesome for so many things! Like steam gushing out of a pipe, fog moving through a forest or water going down a river.

Re: Drawing while animation is playing.

Posted: Thu Dec 01, 2016 12:22 am
by dkwroot
This would work if MOHO had raster drawing tools, but at the moment MOHO is limited to vector tools. Drawing with vectors is very different than working with rasters, so I don't think this would be possible at the moment. Here is a youtube link of the feature in action for people interested. https://youtu.be/VRPln502FO4?t=1m13s

Re: Drawing while animation is playing.

Posted: Thu Dec 01, 2016 8:34 am
by BrahRah
Why isn't this possible with vectors though? It's probably much easier to code with rasters but it's just changing points and curves even if the software stops or animates very slowly while you make changes it should still be possible for a coder that knows vector programming well.

Re: Drawing while animation is playing.

Posted: Thu Dec 01, 2016 10:00 am
by slowtiger
Definitely not working, especially not with vectors.

You have to understand the inner structure of a Moho file. It's all about objects and identity. The relevant parts here are: frame, vector line, point. Every line has a name, each point in the line has a number. The line is made from all its points, no points, no line. The line is an object. The object is stored in a frame.

Now proceed 1 frame. The line is still there, maybe just referred as "same as frame before", but identifyable. Same with the points. You can change properties of each point, like position, but you can't erase or add a point during animation because then it wouldn't be the same line object any more. You can't have an object exist over several frames with a different number of constituing elements in each frame. This is why you can't draw or erase a line over several frames.

(You can, however, change properties in different frames. Play around with the Translate Point tool during playback.)

Also look at the input. If Moho is not playing, everything is clear: we are in 1 specific frame, and a drawn line is defined by starting point and end point, which are defined by pressing down the stylus and releasing it eventually. If Moho is playing, the start point would be in a different frame than the end point, and each point of the line inbetween is in some other frame - how shall the program treat this? Is it the start of a new line object? Is this a continuation from frames before, therefor casing identity problems?

In a bitmap program this is much easier, because each cursor coordinate is a finite datum which is either in this frame or another. "Draw while play" is essentially just "copy last frame's content plus new pixel coordinates".

Re: Drawing while animation is playing.

Posted: Thu Dec 01, 2016 11:17 am
by BrahRah
I see. At least we can still convert the raster drawings into vectors or just mix it.

Re: Drawing while animation is playing.

Posted: Thu Dec 01, 2016 6:39 pm
by dkwroot
I've been thinking about this and I believe it would be possible to do this using the blob brush.

How the blob brush works is that it first draws pixels on the viewport, then it traces those pixels and creates vector shapes. The blob brush could be modified so that when the user is drawing on a FBF layer and the animation is playing, pixels are drawn and then cached. The viewport would then clear and load the next frame's pixel data from memory. It would then add changes as the user draws before storing to cache and repeating.

When the user changes layer or stops the animation, the program would vector all of the pixel data stored in memory and place them in their corresponding vector layers.

The only issue with this is that the user would need to have their viewport locked to a single position as they draw. This is because the pixel data would be drawn to the viewport and not the canvas.

Re: Drawing while animation is playing.

Posted: Thu Dec 01, 2016 9:03 pm
by Lost Marble
I know this isn't what you were originally asking for, but could the Scripts->Draw->Animated Strokes script do something useful for you? It's only in Pro, but try this:

Draw some freehand curves with auto-stroke turned on. Maybe sign your name as a text.
Now choose Edit->Select all to select all the curves you just drew.
Finally, Select Scripts->Draw->Animated Strokes.

Play back the resulting animation, and you'll see your strokes play back animated.

Bonus tip: This effect works really well for animated GIF files (if you're into that). Because only a small part of the image is changing on every frame, Moho can export a very well-optimized, small GIF file.

Re: Drawing while animation is playing.

Posted: Thu Dec 01, 2016 9:15 pm
by BrahRah
I just wanted to share this find I wasn't looking for anything XD

Thanks for the tip, I haven't used any of the scripts yet. So I'll have something to play around with now.

Re: Drawing while animation is playing.

Posted: Fri Dec 09, 2016 11:35 am
by PeterL
Lost Marble wrote:...Draw some freehand curves with auto-stroke turned on. Maybe sign your name as a text.
Now choose Edit->Select all to select all the curves you just drew.
Finally, Select Scripts->Draw->Animated Strokes.

Play back the resulting animation, and you'll see your strokes play back animated.
...
Wow ! Thank you very much for this tip ! This is exactly what I was looking for :D

Peter