How to mirror points to create a head turn in both directions?

General Moho topics.

Moderators: Víctor Paredes, Belgarath, slowtiger

swingsoneto
Posts: 26
Joined: Mon Feb 20, 2017 9:23 pm
Contact:

How to mirror points to create a head turn in both directions?

Post by swingsoneto »

Hi all! I'm revisiting Moho for the first time in a few years. Finally purchased Moho 13.5, and I'm learning the UI. I'm very familiar with 2D rigging techniques in After Effects, and I was hoping that Moho had a way to speed up the creation of body and head turns. So far so good, but I'm surprised I haven't found a native way to mirror the vertices of a path to make symmetrical head turns easier. I've already created the turn to the left; I want to flip all of the animated shapes to the right without disturbing the vertex order (which seems to be what "Flip Horizontally" does).

I found DKWROOT's scripts, but they don't seem to work correctly in Moho 13.5. Is this inaccurate? Am I doing something wrong maybe? Or is there just not a way to mirror the animation of an action in Moho 13.5?
User avatar
Hoptoad
Posts: 654
Joined: Sun Jan 03, 2016 4:19 pm
Location: Florida

Re: How to mirror points to create a head turn in both directions?

Post by Hoptoad »

A few times over the years I've tried to figure-out how to flip animations. I think I managed to get it to work once or twice. Unfortunately, the process does not lend itself to memorization, as it's not intuitive and contains odd traps that may break the animation.

Nowadays, I just do everything the hard way: animate head-turn left, followed by animate head-turn right. It's much easier and faster than the
shortcut.
swingsoneto
Posts: 26
Joined: Mon Feb 20, 2017 9:23 pm
Contact:

Re: How to mirror points to create a head turn in both directions?

Post by swingsoneto »

Hoptoad wrote: Tue Jun 06, 2023 4:00 pm A few times over the years I've tried to figure-out how to flip animations. I think I managed to get it to work once or twice. Unfortunately, the process does not lend itself to memorization, as it's not intuitive and contains odd traps that may break the animation.

Nowadays, I just do everything the hard way: animate head-turn left, followed by animate head-turn right. It's much easier and faster than the
shortcut.
Yeahhhhhh... sigh. Are there no other more recent scripts though? Any rumblings from Lost Marble about making this a native feature? I've done this 'the hard way' many times in After Effects, and I just expected it to be streamlined in Moho. So many other things are! There was one video I found by a guy I can't remember, posted here in about 2014 with a very functional script that seemed to work perfectly doing this very task, as long as the base shape was symmetrical. The video showed an incredibly efficient way of mirroring an action.

Looks like I'm gonna be learning Lua...
User avatar
Hoptoad
Posts: 654
Joined: Sun Jan 03, 2016 4:19 pm
Location: Florida

Re: How to mirror points to create a head turn in both directions?

Post by Hoptoad »

Don't give up yet. There are people on the forum who can do what you're asking. It is absolutely possible.

I suggest you create a generic character rig that you won't mind sharing, do an animation and try to flip it. Post your process, too. It'll be easier for somebody to say "Don't do step 3" or whatever. And if all else fails, attach your character rig for forensic scrutiny.

One more thing: If you figure-out how to do it, please return and explain what you did! :D
User avatar
Víctor Paredes
Site Admin
Posts: 5679
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Re: How to mirror points to create a head turn in both directions?

Post by Víctor Paredes »

Gustaf Lindstrom uses a very interesting technique for mirroring head turns. You can watch his webinar here (Gustaf shows the technique around 24:30)
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
swingsoneto
Posts: 26
Joined: Mon Feb 20, 2017 9:23 pm
Contact:

Re: How to mirror points to create a head turn in both directions?

Post by swingsoneto »

Víctor Paredes wrote: Tue Jun 06, 2023 4:55 pm Gustaf Lindstrom uses a very interesting technique for mirroring head turns. You can watch his webinar here (Gustaf shows the technique around 24:30)
Thank you for that, I'll check that out. I've got a handful of videos in the queue to help me learn my way around Moho, and I don't think I came across that one.

I've done a lot of scripting in Blender and After Effects, so learning Lua to speed up my workflow doesn't phase me. I'd really like to have a button that automates this process.
User avatar
Greenlaw
Posts: 9377
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How to mirror points to create a head turn in both directions?

Post by Greenlaw »

DKW Root's script should work in 13.5.5. AFAIK, nothing has changed in Moho 13.5.5 that would break the script, and I'm pretty sure I used it in the last year.

From what I recall, there are some quirks to deal with when used with Bezier points, which is one reason I often recommend against using Bezier points for deforming items, especially where bones and Smart Bone Actions are involved. Regular Moho points are more reliable in these situations, but if you absolutely need to use Bezier points, I would edit them after using the script.

I'll make some time this evening to check out the script to make sure it's still running as intended.

Tip: if you use Bezier points in deforming items, you need to be sure to keyframe the handle positions as well as the point positions. This should help interpolations behave more predictably. But if you use regular points instead, it should just work with no extra effort.
Last edited by Greenlaw on Tue Jun 06, 2023 7:58 pm, edited 2 times in total.
worldbanger10
Posts: 13
Joined: Wed May 31, 2023 11:05 pm

Re: How to mirror points to create a head turn in both directions?

Post by worldbanger10 »

Am. Also working on one my self,





Wud have been nice to create to the left or right n let a code do the other other side, moho is tedious full of bug. it will make u wanna do something simple, n walk away.
swingsoneto
Posts: 26
Joined: Mon Feb 20, 2017 9:23 pm
Contact:

Re: How to mirror points to create a head turn in both directions?

Post by swingsoneto »

Greenlaw wrote: Tue Jun 06, 2023 6:19 pm From what I recall, there are some quirks to deal with when used with Bezier points, which is one reason I often recommend against using Bezier points for deforming items, especially where bones and Smart Bone Actions are involved. Regular Moho points are more reliable in these situations, but if you absolutely need to use Bezier points, I would edit them after using the script.

Tip: if you use Bezier points in deforming items, you need to be sure to keyframe the handle positions as well as the point positions. This should help interpolations behave more predictably. But if you use regular points instead, it should just work with no extra effort.
The script definitely does... something... but I can't tell if I'm just using it completely incorrectly, because it causes my paths to go all wonky. I'm still quite new to Moho's interface and peculiarities.

Could I get you to elaborate a bit on the Bezier vs regular Moho points? I don't think I knew about this distinction. What are regular Moho points?
User avatar
Greenlaw
Posts: 9377
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How to mirror points to create a head turn in both directions?

Post by Greenlaw »

In a big nutshell:

Regular Moho points do not use Bezier handles to define the curvature; to adjust a regular point's curvature, you adjust only the Curvature setting using the Curvature tool. This is all we had before we got Bezier points and handles in Moho.

Once you click on a Bezier handle, the point is converted into a Bezier point. Bezier points are pretty great to draw with but they can deform unpredictably with bones, so I mainly use them only for static drawings. As mentioned earlier, it is possible to use Bezier points with bones if you're careful to keyframe the handles but, IMO, it's easier and more predictable to just use regular points for this.

If you convert a point to Bezier unintentionally, it can be reset back into a regular point by clicking on the Smooth or Peak button in Curvature.

To prevent unintentionally converting a regular point into a Bezier point, you can hide the handles in the Transform Points and Add Points tool options. Note that the Curvature tool lacks this option but you can add it using Synthsin75's Curvature tool mod.

Hope this helps. If I have time this evening, I can post more info.
User avatar
Greenlaw
Posts: 9377
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How to mirror points to create a head turn in both directions?

Post by Greenlaw »

One more thing re: DKWRoot's tool: make sure you have the same number of points on both sides of your curve. The script works mirroring the positions of points on either side so you can get mirrored morphing effects. If the point count on both sides doesn't match, the result is probably not going to be properly mirrored.

Also, as mentioned earlier, the tool can have issues with Bezier points (I think it can't mirror handle positions,) so if you activated Bezier points you may need to switch back into regular points, run the script, and then apply your Bezier edits if you need them.

This is a script I used to use a lot at my workplace (mainly for mirroring head shapes,) so I'll run a test at home tonight to make sure it still works.
swingsoneto
Posts: 26
Joined: Mon Feb 20, 2017 9:23 pm
Contact:

Re: How to mirror points to create a head turn in both directions?

Post by swingsoneto »

https://www.dropbox.com/s/zjbztwaslpxwp ... 3.gif?dl=0

Not sure if I'm doing something wrong, so I'm posting a screenshot. I notice that if I draw a primitive shape like a circle, then modify one of the points, Swap Sides and Mirror Points will work. But if I create a shape with the Add Points tool, it'll go wonky UNLESS the first point created is the top or bottom point and they're aligned vertically.
User avatar
Greenlaw
Posts: 9377
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How to mirror points to create a head turn in both directions?

Post by Greenlaw »

Hi,

I finally got around to trying Mirror and Swap in 13.5.5. For me, anyway, these scripts are working as intended and should still be useful. The quirks I mentioned are still there but they're easy enough to work around.

BTW, I just remembered that I posted a quick tutorial for using the Mirror/Swap scripts here...

https://lostmarble.com/forum/viewtopic. ... ial #1[/u]
swingsoneto wrote: Wed Jun 07, 2023 1:53 am ...if I create a shape with the Add Points tool, it'll go wonky UNLESS the first point created is the top or bottom point and they're aligned vertically.
I ran a test just now and, from what I see, the scripts don't care which point is first but I think it uses the centermost point along x in the shape, and uses that point as the mirror/swap axis.

For head turns, you're most likely going to use Swap, not Mirror.

When using Mirror, the script always mirrors the right side point positions to the left side. So if you need the opposite reflection, you may need to flip your curve first. Do this for a Smart Bone Action, run the tool on another keyframe and then copy/paste the 'mirror' keys where appropriate.

If for some reason, you need to change the point order in the shape, you can use SimplSam's Curve Exposure tool to change which point in a curve is the 'first' point (very important for Stroke Exposure.)

I hope this info is helpful.
User avatar
Greenlaw
Posts: 9377
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How to mirror points to create a head turn in both directions?

Post by Greenlaw »

Actually ignore the tips I wrote above about the Mirror/Swap scripts and just follow my instructions from the tutorial at the link. I just re-read my own tutorial and that info is probably more correct, especially the part about how to tell the script which side of the shape to reference.

(Yes, there's a reason I post so much and it's because I can't possibly remember all this stuff.) 😸
animas3D
Posts: 49
Joined: Tue Aug 07, 2018 3:09 pm

Re: How to mirror points to create a head turn in both directions?

Post by animas3D »

Greenlaw wrote: Thu Jun 08, 2023 1:54 am Actually ignore the tips I wrote above about the Mirror/Swap scripts and just follow my instructions from the tutorial at the link. I just re-read my own tutorial and that info is probably more correct, especially the part about how to tell the script which side of the shape to reference.

(Yes, there's a reason I post so much and it's because I can't possibly remember all this stuff.) 😸
That looks like a really cool script! Can't wait to try that out myself.
Post Reply