How do I roll a square forward?

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Sketch_Turner
Posts: 44
Joined: Sun Oct 02, 2016 3:53 pm

How do I roll a square forward?

Post by Sketch_Turner »

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

Re: How do I roll a square forward?

Post by synthsin75 »

Image
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How do I roll a square forward?

Post by Greenlaw »

Do you mean like this?

Image

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

Image

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. :D

Download: SquareWheel.moho
Last edited by Greenlaw on Fri Feb 02, 2024 7:41 pm, edited 4 times in total.
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How do I roll a square forward?

Post by Greenlaw »

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.
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How do I roll a square forward?

Post by Greenlaw »

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. :D
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How do I roll a square forward?

Post by Greenlaw »

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. :D
User avatar
hayasidist
Posts: 3525
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: How do I roll a square forward?

Post by hayasidist »

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. :D

Download: url=https://www. dropbox.com/scl/fi/mircb7n4v1t0t5eqrrwwy/SquareWheelProject.gif ?rlkey=u1sbbt2ehij7eswnqwsq6d3my&dl=1]SquareWheel.moho
FWIW, the linked file is a gif! Maybe not as intended???? ;-)
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How do I roll a square forward?

Post by Greenlaw »

Link fixed! Thanks for catching that, Paul. :D
User avatar
SimplSam
Posts: 1048
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

Re: How do I roll a square forward?

Post by SimplSam »

There was also Victors' examples (and dicussions) which demonstrated similar principles. Not sure how well it would work with full rotation though:
Image
viewtopic.php?p=207274

moho file: https://www.dropbox.com/s/07lbfwqt1iy7s ... moho?raw=1
Moho 14.1 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.1 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam


Sam
Sketch_Turner
Posts: 44
Joined: Sun Oct 02, 2016 3:53 pm

Re: How do I roll a square forward?

Post by Sketch_Turner »

synthsin75 wrote: Fri Feb 02, 2024 12:41 am Image
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?
Sketch_Turner
Posts: 44
Joined: Sun Oct 02, 2016 3:53 pm

Re: How do I roll a square forward?

Post by Sketch_Turner »

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. :D
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.
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How do I roll a square forward?

Post by Greenlaw »

SimplSam wrote: Fri Feb 02, 2024 9:56 pm There was also Victors' examples (and dicussions) which demonstrated similar principles....
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. :D
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How do I roll a square forward?

Post by Greenlaw »

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.
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.

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.
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How do I roll a square forward?

Post by Greenlaw »

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...

Image

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

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

Re: How do I roll a square forward?

Post by synthsin75 »

Sketch_Turner wrote: Fri Feb 02, 2024 10:08 pm
synthsin75 wrote: Fri Feb 02, 2024 12:41 am Image
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?
https://www.mediafire.com/file/a7kf412n ... .moho/file

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