Flipping Translate Layer Movements

(This forum has been closed. Please use the General Moho Discussion forum.)

Moderators: Víctor Paredes, slowtiger

Locked
Toontoonz
Posts: 763
Joined: Fri Mar 25, 2005 9:28 pm

Flipping Translate Layer Movements

Post by Toontoonz »

I have a layer with one balls on it. During the animation it moves from left to right using the Translate layer tool.

I want to duplicate this and make a second ball fly to the left.
I duplicate the first layer.
Then click on the FLIP HORIZONTALLY layer button. The balls flip position, but the Translate layer movement does not flip to the other side. It continues to move the ball left to right. (If flipped the entire layer I would think it would now go right to left.)
Shouldn´t the translate layer movement flip to the other side? If not, why not?
Or how can one do it...other than manually?
Now I have to manually re-jigger the translate layer movement the other way on the duplicated layer.
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

No, it obviously doesn't work like you want it to work. Translate Layer is not affected by flip layer horizontally. However, Translate Points IS.
Image
I've made a Moho file with two vector layers and the same ball shape, one layer has a blue ball, the other a red ball.

First I created the Translate Layer animation with the red ball, for the first half, copied the keys to the appropriate frames for the second half. Precisely at the half I flipped the layer with the red ball. As you can see, the motion is not mirrored by the Flip Layer Horizontally action.

Then I positioned the blue ball with the Translate Points tool on top of the red ball (the inbetween keys at the same location, but in a different animation channel). I copied the keys for the second half. Then I flipped the layer horizontally at the bottom point (halfway), just as in the layer with the red ball.

And voila, the blue ball DOES mirror the action, unlike the red ball. And both balls follows the same trajectory during the first half of the animation.

And now you can see how you can use this to your advantage:
Image
You can repeat the movement with Translate Layer without having to worry about a mirrored layer contents.
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Post by ulrik »

You can use Crashcores script "Reverse layer keyframes", you'll find it on this side: http://www.lostmarble.com/forum/viewtop ... sc&start=0
Select the range and go for it, the reversed keys will be pasted just after the range end, select all keys inside the range and delete them, select all the pasted keys and drag them inside the range and it should work.
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

Thanks for that, ulrik, I had missed that because of my illness when this was posted in the LM Forum.

I noticed that you still have to manually set the key interpolations, because the description states that those aren't copied, only the key positions.
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Post by ulrik »

Rasheed wrote: I noticed that you still have to manually set the key interpolations, because the description states that those aren't copied, only the key positions.
Yes the standard is "linear", maybe it's possible to modificate the script so it will be able to read the interpolation as well? It would be great if you have a lot of keys and different interpolations.
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

It's not the script, but the script interface. Lua won't (as yet) let you see what a keyframes interpolation type is. If LM would fix this small oversight, it would be a golden.
User avatar
Lost Marble
Site Admin
Posts: 2354
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Post by Lost Marble »

That's true, a script cannot "see" what interpolation is happening at a keyframe, but it can change the type of interpolation. If you have an animation channel, use this function:

ch:SetKeyInterp(frame, interpMode, val1, val2)

frame: the frame number you want to set the interpolation at
interpMode: one of the following:
MOHO.INTERP_LINEAR
MOHO.INTERP_SMOOTH
MOHO.INTERP_EASE
MOHO.INTERP_STEP
MOHO.INTERP_NOISY
MOHO.INTERP_CYCLE
MOHO.INTERP_POSE
val1, val2: These depend on the type of interpolation you're using. They should both be set to -1 unless the interpolation type is one of:

INTERP_NOISY - val1 = noise amplitude, val2 = noise scale. Good values to start experimenting with are 0.1, 0.5.

INTERP_CYCLE - val1 = relative starting frame (count back this many frames and start again), val2 = absolute starting frame (count back to exactly this frame, use -1 to ignore this field)

INTERP_POSE - val1 = index to the pose, val2 ignored
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Post by ulrik »

Thanks 7feet and Lost Marble for your answers,
LM, about scripting I'm totally useless but it would be nice to get the grip of lua scripting someday.
Well I'm sorry it's not working.

btw. is it possible to write script lines on the fly,(I mean for a good scripter),while working inside moho? is there some terminal to write commandlines while moho is running? just a thought that came up right now...
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

Not really inside Moho, but in effect, thats the way I work. I have the script open in a text editor, and Moho open. Make a change in the text editor, save it, flip to Moho and hit <CTRL><F5> to reload the scripts, try it out. Repeat until something miraculously works. At least that little part of the process only takes a few seconds. Which is a good thing. A few scripts I've gone through that little cycle literally hundreds of times before I was finished, and if it was a more cumbersome process I'd never get anything done.
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

A tutorial Scripting for Moho, which continues where Programming in Lua leaves off, would be very useful as well. At the moment, everyone has to find out all these things for themselves. I guess this puts off many potential Lua for Moho scripters.

Unfortunately, I haven't noticed any animation using animation-specific scripts to enhance Moho animation until now. It is quite possible I just haven't been paying enough attention and that a whole community of Lua scripters has evolved among Moho animators since Moho 5 was released. Somehow I seriously doubt that, though.

So, if someone is willing to write a Moho-specific Lua tutorial...
macton
Posts: 93
Joined: Thu Aug 18, 2005 6:29 am
Location: San Diego

Post by macton »

Rasheed wrote:I noticed that you still have to manually set the key interpolations, because the description states that those aren't copied, only the key positions.
For this very problem there is also the "Splat Layer Keyframe Interpolation Settings" script. You can reset the interpolation settings in the range you've created, for whichever keyframes you'd like.
Locked