How do I roll a square forward?
Moderators: Víctor Paredes, Belgarath, slowtiger
-
- Posts: 46
- Joined: Sun Oct 02, 2016 3:53 pm
How do I roll a square forward?
Recently I saw a couple exercises meant to teach vector animation in After Effects, and one of those involved rolling a square forward. In AE it goes like this: you put the anchor point in the lower right corner, rotate the square around it 90 degrees to the right, then move the anchor point to the new lower right corner and repeat the process for however steps necessary, so that in the end you get an illusion of a box rolling along the ground. "It would be EASY to recreate this kind of movement in Moho," I thought... and then got stumped.
Now, you can get a similar effect by moving the anchor embedded in the Transform Points tool, but, as you all know, if you try to rotate a shape with the Transform Points tool it gets disfigured in the interpolated frames. "Well, no biggie, I'll manipulate the layer itself," I thought again... but turns out you can't change the layer's Origin frame to frame.
So, in essence, my question boils down to this: how do you rotate a layer around different points at different times in the animation?
I haven't used Moho in a while, and there must be some obvious solution to this trivial problem (probably something involving bones), but it's late, and I'm tired, and I'd be grateful if somebody pointed it out to me. Thanks in advance.
Now, you can get a similar effect by moving the anchor embedded in the Transform Points tool, but, as you all know, if you try to rotate a shape with the Transform Points tool it gets disfigured in the interpolated frames. "Well, no biggie, I'll manipulate the layer itself," I thought again... but turns out you can't change the layer's Origin frame to frame.
So, in essence, my question boils down to this: how do you rotate a layer around different points at different times in the animation?
I haven't used Moho in a while, and there must be some obvious solution to this trivial problem (probably something involving bones), but it's late, and I'm tired, and I'd be grateful if somebody pointed it out to me. Thanks in advance.
- synthsin75
- Posts: 10266
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: How do I roll a square forward?

- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: How do I roll a square forward?
Do you mean like this?

This is a total cheat, but it took only a couple of minutes to set up and animate...

To be honest, I would not know how to do this mathematically correct in Moho, but depending on the animation's requirements, that might not be necessary?
It's a really simple setup. Here's the project file if you want to look at it.
Download: SquareWheel.moho

This is a total cheat, but it took only a couple of minutes to set up and animate...

To be honest, I would not know how to do this mathematically correct in Moho, but depending on the animation's requirements, that might not be necessary?
It's a really simple setup. Here's the project file if you want to look at it.

Download: SquareWheel.moho
Last edited by Greenlaw on Fri Feb 02, 2024 7:41 pm, edited 4 times in total.
NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
Re: How do I roll a square forward?
As usual, Wes beat me to it! His is a different setup, so you have a couple of options now.
In my setup, I only animated a quarter turn because it was a square, but for a rectangle like in Wes' example, the cycle will need to accommodate at least half the rotation.
In my setup, I only animated a quarter turn because it was a square, but for a rectangle like in Wes' example, the cycle will need to accommodate at least half the rotation.
NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
Re: How do I roll a square forward?
BTW, if this was for a real work project, I might put the 'in-place' cycle animation inside a Smart Bone. This way, I can control the speed and direction of the animation as it moves forward and backward. It's still a cheat, but that's what I'm good at. 

NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
Re: How do I roll a square forward?
If you want to do it as described in the Ae exercise, try Lukas' Set Origin script, available here...
Set Origin
This tool lets you animate the Origin (i.e, 'pivot point') position. I have not tried Set Origin to animate a rolling box, but I think it should work. Just a guess, but it probably works best if you place the box art inside a group and use this tool on the group. Also, set the origin's position animation to Step.
Ok, now I'm curious and I may have to try this out myself this evening.
Set Origin
This tool lets you animate the Origin (i.e, 'pivot point') position. I have not tried Set Origin to animate a rolling box, but I think it should work. Just a guess, but it probably works best if you place the box art inside a group and use this tool on the group. Also, set the origin's position animation to Step.
Ok, now I'm curious and I may have to try this out myself this evening.

NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
- hayasidist
- Posts: 3841
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: How do I roll a square forward?
FWIW, the linked file is a gif! Maybe not as intended????Greenlaw wrote: ↑Fri Feb 02, 2024 12:48 am ...
It's a really simple setup. Here's the project file if you want to look at it.![]()
Download: url=https://www. dropbox.com/scl/fi/mircb7n4v1t0t5eqrrwwy/SquareWheelProject.gif ?rlkey=u1sbbt2ehij7eswnqwsq6d3my&dl=1]SquareWheel.moho

Re: How do I roll a square forward?
Link fixed! Thanks for catching that, Paul. 

NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
Re: How do I roll a square forward?
There was also Victors' examples (and dicussions) which demonstrated similar principles. Not sure how well it would work with full rotation though:

viewtopic.php?p=207274
moho file: https://www.dropbox.com/s/07lbfwqt1iy7s ... moho?raw=1

viewtopic.php?p=207274
moho file: https://www.dropbox.com/s/07lbfwqt1iy7s ... moho?raw=1
Moho 14.3 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
-
- Posts: 46
- Joined: Sun Oct 02, 2016 3:53 pm
Re: How do I roll a square forward?
At the risk of sounding like a total noob... I don't get what you're doing with the bones here. (Bear in mind that I've never worked with bone layers other than for the simplest of tasks.) Could you elaborate a bit?
-
- Posts: 46
- Joined: Sun Oct 02, 2016 3:53 pm
Re: How do I roll a square forward?
If it's not too much trouble, could you try out this option when you have the time? I can't seem to get it to work. The "embed layerscript" buttons aren't active neither for a vector layer nor for a group, and anyway, when I pressed them for a switch layer there was still no effect.Greenlaw wrote: ↑Fri Feb 02, 2024 2:33 am If you want to do it as described in the Ae exercise, try Lukas' Set Origin script, available here...
Set Origin
This tool lets you animate the Origin (i.e, 'pivot point') position. I have not tried Set Origin to animate a rolling box, but I think it should work. Just a guess, but it probably works best if you place the box art inside a group and use this tool on the group. Also, set the origin's position animation to Step.
Ok, now I'm curious and I may have to try this out myself this evening.![]()
Re: How do I roll a square forward?
Thanks for posting this, SimplSam!
I'd seen Victor's setup back when he posted it, but I couldn't remember it well enough to search for it. Funny...I stated on that thread that I would have to remember that setup. D'oh!
Bookmarking for sure now.

NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
Re: How do I roll a square forward?
I haven't used this script but I'll try it today. My understanding is that it should be straightforward when used on a regular drawing layer, but I could be wrong about that. Anyway, to add a Layer Script, enable the option in the Layer Settings, and Moho will ask you to select the Lua script.Sketch_Turner wrote: ↑Fri Feb 02, 2024 10:19 pm If it's not too much trouble, could you try out this option when you have the time? I can't seem to get it to work. The "embed layerscript" buttons aren't active neither for a vector layer nor for a group, and anyway, when I pressed them for a switch layer there was still no effect.
Update: I tried the script out briefly, and couldn't get it to work in 14.1. I'm probably using it incorrectly but maybe it's broken for Moho 14.1? I'll check this in an older version.
NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
Re: How do I roll a square forward?
Here's another method: nest the art layer in multiple groups and give each group a different origin. Then animate each group in sequence.
Like this...

As with everything Moho, there are many ways to do create similar animations.
With any of the methods shown so far, I'd create the animation as a cycle and add it a Smart Bone. This way I can adjust the speed and direction as appropriate.
Like this...

As with everything Moho, there are many ways to do create similar animations.

With any of the methods shown so far, I'd create the animation as a cycle and add it a Smart Bone. This way I can adjust the speed and direction as appropriate.
NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
- synthsin75
- Posts: 10266
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: How do I roll a square forward?
https://www.mediafire.com/file/a7kf412n ... .moho/fileSketch_Turner wrote: ↑Fri Feb 02, 2024 10:08 pmAt the risk of sounding like a total noob... I don't get what you're doing with the bones here. (Bear in mind that I've never worked with bone layers other than for the simplest of tasks.) Could you elaborate a bit?
Since I didn't bother to the save the last one, I made this one more complex. If you use the reparent bone tool, you can see the bones are arranged in a spiral, with the block point-bound to the last bone. I used more bones so it can roll longer without having to reset the bones... which you do by copying frame zero and using onionskin to match the last position. I used auto-freeze keys so all the bones get keyed together, and all the bones are set to ignore IK.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/