*NEW* Track Stroke Exposure

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
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

*NEW* Track Stroke Exposure

Post by synthsin75 »

Here's a menu/button script to track stroke exposure.
https://sites.google.com/site/synthsin/ ... ects=0&d=1

Image

1. Create any shape with stroke exposure End Percentage animation.
2. Run the script.

It will create all the needed groups, reference, and animate follow path to track stroke exposure End Percentage. The "faux_camera" group can be used to animate the whole setup instead of using the camera.

If you change the stroke exposure animation, you can run the script again to update the tracking. Make changes to the original layer, which is set to hide in editing and not render.
Stan
Posts: 199
Joined: Sun Apr 19, 2009 3:22 pm

Re: *NEW* Track Stroke Exposure

Post by Stan »

Nice script, Wes, thank you for sharing!

I should mention that there is a nasty little bug in Moho that stroke exposure percentage is calculated differently then follow path percentage. This creates discrepancies, especially when the curve contains straight lines and sharp corners.

I once tried to make a layer script that would move a pencil along the stroke exposure, and the result was not really good because of that bug.

This is an illustration of the issue - see, it works perfectly for circles but totally fails on squares:
Image

And this is an example made with your script:
Image
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Track Stroke Exposure

Post by synthsin75 »

Oh, yeah that is a pretty bad bug. Stroke exposure seems to interpolate between points according to curvature. That's strange. Exposure doesn't have any bezier keyframe handles either.

EDIT: M_Curve:GetPercentLocation(percent) doesn't even match the stroke's visual location, so this script might be as good as it's going to get for now.
Stan
Posts: 199
Joined: Sun Apr 19, 2009 3:22 pm

Re: *NEW* Track Stroke Exposure

Post by Stan »

synthsin75 wrote:EDIT: M_Curve:GetPercentLocation(percent) doesn't even match the stroke's visual location, so this script might be as good as it's going to get for now.
Yeah, and this is a good example of a bug that needs to be fixed on the core application level and not on the interface level.
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Track Stroke Exposure

Post by synthsin75 »

I've reported the problem.
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Track Stroke Exposure

Post by synthsin75 »

In the meantime, one thing that helps is to have less space between points on the curve. So using, Scripts>Draw>Split Curve can help the end result.

The discrepancy increases as the stroke has more ground to cover between points. It almost looks like there's a smooth interpolation from point to point, but a smaller distance is covered too quick for this to be apparent...like keyframes on the timeline.
Image
Image
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Re: *NEW* Track Stroke Exposure

Post by Víctor Paredes »

This is very interesting. Thanks, Wes!
Did you create it with a specific idea in mind? I'm trying to think where I could use it :)
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
Maestral
Posts: 531
Joined: Tue Jan 27, 2009 5:44 pm
Location: Belgrade, Serbia

Re: *NEW* Track Stroke Exposure

Post by Maestral »

To me, it looks like a perfect way of depicting birdseye view character`s tracking/following over some map or some closeup (tailoring or cutting some fabrics). Either way, some sort of extreme POV.
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Track Stroke Exposure

Post by synthsin75 »

Víctor Paredes wrote:This is very interesting. Thanks, Wes!
Did you create it with a specific idea in mind? I'm trying to think where I could use it :)
This: viewtopic.php?f=13&t=32559

But it could also be used to animate following a pen as it writes.
Post Reply