Updated FA_ReversePoints script to work with Moho 13...

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
SaxonRix
Posts: 1
Joined: Wed May 27, 2020 12:43 am

Updated FA_ReversePoints script to work with Moho 13...

Post by SaxonRix »

Hi all,

I recently asked on a FB Moho group if there was a script that could replicate what a script in AE does, which is flip paths (by altering the points rather than flipping the whole layer).
After it seeming like there was no such thing, someone sent me a link to a script file in this forum which was exactly what I was after!

Unfortunately, the script was from 2006 and no longer worked with Moho Pro 13... FORTUNATELY, while I'm in no way a coder it was a very easy fix, and it's now fully working in the latest Moho. I also made a button icon for it because one didn't exist for it before.

Click here to download the working script

How To Install:
Place the FA_ReversePoints.lua & icon files into the 'Moho Library\Moho Pro\scripts\tool' folder on your system.
Add the this text somewhere into the _tool_list.txt file in the same folder.

Code: Select all

button fa_reverse_points ...
DONE! Just load up Moho & use 🙂

On a related note: This script is now 14 years old. Are there any member here that could take a look at it and see if there's any ways to improve it etc? As I know there are a couple of 'issues' with it, such as not being able to accurately 'flip' curve amounts etc... It'd be fantastic if someone could help breath more life into this script and improve upon it as it seems Fazek is no longer active on the forum.

NOTE: I TAKE NO CREDIT FOR THIS SCRIPT, IT WAS CREATED BY 'FAZEK'.
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Updated FA_ReversePoints script to work with Moho 13...

Post by Greenlaw »

Thanks for posting this. I'll check it out tonight and let you know how it goes.

This script sounds like it does what part of DKW Root's MirrorPoints/SwapSides menu scripts does. These scripts were created a while back but I'm almost certain they still work in Moho 13.5.

I use Swap Sides in 12.5 to create seamless 'flipped' head animations inside Smart Bone Actions. It does this by repositioning points rather than flipping the path. I'm not sure this is the same thing you're describing but you can find these tools here:

viewtopic.php?f=12&t=28816

Mirror Points is a different take: it moves the points one side of a shape to make them symmetrical to the other side. Of course both tools expect both sides of the shape to have the same number of points to work properly.

Even if it does the same thing, I'm curious to try it. DKWRoot's Swap Sides command occasionally gets confused and may create imperfect 'flips', so having an alternative way to do this could be useful.
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Updated FA_ReversePoints script to work with Moho 13...

Post by Greenlaw »

I found a little time to try and compare the two. Indeed these are similar tools but they each handle the 'flip' differently. Here are some observations and examples...

FA_Reverse Points is a Tool script; Swap Sides is a Menu script. Not a critical distinction but worth pointing out in case you're looking for them in the wrong places.

FA_ReversePoints reverses the path to create a visually mirrored shape. There is no way to set a reflection axis point, and if the path has some hidden edges, the edge visibility will also 'flip' to the other edges. (Actually, I guess it's the same edges that have the visibility but it looks wrong.) Here's an example...

Image

In this case, it appears to have flipped the art along the horizontal axis. I'm not sure it always does this; it probably depends on where the start/end points are? (Untested by me.)

Swap Sides handles the flip a bit differently. You select a point in a shape and then run the script, and the script will move the points on either side to create a 'mirror' image of the original shape. I think the tool always flips along a vertical axis, making this ideal to reshape a left side head profile into morphable a right side profile.

Image

I mentioned how the script can get confused, and here's an example. If the script doesn't have a clear axis to flip from, you can get something like this...

Image

When this happens, just add an extra 'good' axis point to help the tool understand what you want. (That's what I had to do to get the good example above.)

I recall the script used to have problems with Bezier points, but I think this was addressed in the last release. Easy enough to check.

And, yes, Swap Sides/Mirror Points still works fine in Moho 13.5. :D

ATM, I'm not exactly sure when I might need FA_ReversePoints but I have some ideas for it. TBD.

Hope this info helps.
User avatar
neeters_guy
Posts: 1614
Joined: Mon Sep 14, 2009 7:33 pm
Contact:

Re: Updated FA_ReversePoints script to work with Moho 13...

Post by neeters_guy »

Thanks for the updating the script.

I've used the FA_ReversePoints script before to help with head turns. However, as mentioned, it's a bit fiddley in practice because the first point has to align vertically with mid-point to get a true y-axis swap.

Image

I agree this could be a basis for real time-saving tool though. I tried to mod this myself but my scripting skills weren't up to it. :oops:
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Updated FA_ReversePoints script to work with Moho 13...

Post by Greenlaw »

Ah, so that's how you control the axis with FA_ReversePoints! Thanks, I wondered if this was possible. It definitely makes the tool more useful.

Swap Sides does what I need but for the occasions when it fails, I'm glad to have this as a second option. :)
Post Reply