*NEW* Track Stroke Exposure

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

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

Post Reply
User avatar
synthsin75
Posts: 7084
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

*NEW* Track Stroke Exposure

Post by synthsin75 » Sat Dec 22, 2018 6:29 am

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.
- Wes
ImageImageImage
Stan
Posts: 118
Joined: Sun Apr 19, 2009 3:22 pm
Contact:

Re: *NEW* Track Stroke Exposure

Post by Stan » Sun Dec 23, 2018 12:08 am

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
________________________________________________________________________
http://mohoscripting.com/ - Unofficial Moho (Anime Studio) Lua Scripting Documentation
http://2danimator.ru/ - Russian Anime Studio Forum
User avatar
synthsin75
Posts: 7084
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Track Stroke Exposure

Post by synthsin75 » Sun Dec 23, 2018 1:04 am

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.
- Wes
ImageImageImage
Stan
Posts: 118
Joined: Sun Apr 19, 2009 3:22 pm
Contact:

Re: *NEW* Track Stroke Exposure

Post by Stan » Sun Dec 23, 2018 5:25 am

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.
________________________________________________________________________
http://mohoscripting.com/ - Unofficial Moho (Anime Studio) Lua Scripting Documentation
http://2danimator.ru/ - Russian Anime Studio Forum
User avatar
synthsin75
Posts: 7084
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Track Stroke Exposure

Post by synthsin75 » Sun Dec 23, 2018 6:45 am

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

Re: *NEW* Track Stroke Exposure

Post by synthsin75 » Sun Dec 23, 2018 7:06 am

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
- Wes
ImageImageImage
User avatar
Víctor Paredes
Posts: 4857
Joined: Wed Jan 26, 2005 12:18 am
Location: Ireland/Chile
Contact:

Re: *NEW* Track Stroke Exposure

Post by Víctor Paredes » Fri Jan 04, 2019 1:16 pm

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 :)
Víctor Paredes
Former Moho Product Manager
Animator in Cartoon Saloon
My Youtube Channel - My webinars
User avatar
Maestral
Posts: 325
Joined: Tue Jan 27, 2009 5:44 pm
Location: Belgrade, Serbia

Re: *NEW* Track Stroke Exposure

Post by Maestral » Fri Jan 04, 2019 2:50 pm

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

Re: *NEW* Track Stroke Exposure

Post by synthsin75 » Fri Jan 04, 2019 6:07 pm

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.
- Wes
ImageImageImage
Post Reply