Drawing while animation is playing.

General Moho topics.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
BrahRah
Posts: 18
Joined: Fri Oct 28, 2016 8:49 am

Drawing while animation is playing.

Post 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.
former nick: mystd
dkwroot
Posts: 677
Joined: Thu May 02, 2013 6:56 am
Location: USA
Contact:

Re: Drawing while animation is playing.

Post 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
User avatar
BrahRah
Posts: 18
Joined: Fri Oct 28, 2016 8:49 am

Re: Drawing while animation is playing.

Post 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.
former nick: mystd
User avatar
slowtiger
Posts: 6079
Joined: Thu Feb 16, 2006 6:53 pm
Location: Berlin, Germany
Contact:

Re: Drawing while animation is playing.

Post 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".
AS 9.5 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
AS 11 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
Moho 13.5 iMac Quadcore 2,9GHz 16GB OS 10.15

Moho 14.1 Mac Mini Plus OS 13.5
User avatar
BrahRah
Posts: 18
Joined: Fri Oct 28, 2016 8:49 am

Re: Drawing while animation is playing.

Post by BrahRah »

I see. At least we can still convert the raster drawings into vectors or just mix it.
former nick: mystd
dkwroot
Posts: 677
Joined: Thu May 02, 2013 6:56 am
Location: USA
Contact:

Re: Drawing while animation is playing.

Post 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.
User avatar
Lost Marble
Site Admin
Posts: 2347
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Re: Drawing while animation is playing.

Post 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.
User avatar
BrahRah
Posts: 18
Joined: Fri Oct 28, 2016 8:49 am

Re: Drawing while animation is playing.

Post 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.
former nick: mystd
PeterL
Posts: 21
Joined: Wed Oct 15, 2014 12:29 pm
Location: Belgium
Contact:

Re: Drawing while animation is playing.

Post 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
Post Reply