Here's some handy scripts

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

Moderators: Víctor Paredes, Belgarath, slowtiger

macton
Posts: 93
Joined: Thu Aug 18, 2005 6:29 am
Location: San Diego

Post by macton »

bupaje wrote:Just testing these now -quick question on Reverse Layer Keyframes if anyone can clarify.

I made a simple animation 144 frames, moved layer on frame 24, 48 and on 72 put back at start position reverse and when it plays back it only goes 2/3 of the way back. May be something with that Offset setting?
Hard to tell without seeing the Moho file, but I suspect that you are missing a keyframe.

Your original keyframes are at:
0 -> 24 -> 48

You probably reversed 1 -> 48 with an offset of zero, which would have created keyframes at:
0 -> 24 -> 48 -> 50 -> 74

Because there was no keyframe between 1 and 24, no keyframe was reversed at the end. Which means you are missing the final segment of your loop.

What you probably want to do is create a new keyframe at frame 1 like so:
0 -> 1 -> 24 -> 48

And then when you reverse 1 -> 48 you will get keyframes at:
0 -> 1 -> 24 -> 48 -> 50 -> 74 -> 97


--------------------

Another possibility (it's not in your case, but just a warning to other people using the script) is that you have to change the End Frame in Project Settings to reflect the fact that you have a longer animation.
User avatar
bupaje
Posts: 1175
Joined: Fri Nov 12, 2004 5:44 pm
Location: California
Contact:

Post by bupaje »

macton wrote: ...I suspect that you are missing a keyframe.... You probably reversed 1 -> 48 with an offset of zero, which would have created keyframes at:
0 -> 24 -> 48 -> 50 -> 74 ...

Thanks, that's exactly what I did. :oops:
[url=http://burtabreu.animationblogspot.com:2gityfdw]My AnimationBlogSpot[/url:2gityfdw]
User avatar
bupaje
Posts: 1175
Joined: Fri Nov 12, 2004 5:44 pm
Location: California
Contact:

Post by bupaje »

macton wrote: ...
Not sure what are you looking for... center the parent layer on the average of all the points in the child vector layers?
Probably just a goof on using switch layers on my part - I haven't used them (or even Moho much in the past few months).

We just started our first traditional animation lesson at school of a bouncing ball with squash and stretch. I thought I'd give a quick test in Moho to showcase Moho to them so I made a switch layer with the balls normal, squash, and stretch shapes as vector layers. I thought I could use the Translate Layer tool to lay out the path of action of the switch layer and then switch the shape at the required frames but I had the problem I mentioned.

Centering it on the average or maybe on the default switch layer? Or maybe if the parent can use the origin of the selected switch sublayer?
[url=http://burtabreu.animationblogspot.com:2gityfdw]My AnimationBlogSpot[/url:2gityfdw]
macton
Posts: 93
Joined: Thu Aug 18, 2005 6:29 am
Location: San Diego

Update

Post by macton »

* Copy and Paste scripts added.
* Instructions for copying between different types of layers added.
* ZIP file of all scripts added.
macton
Posts: 93
Joined: Thu Aug 18, 2005 6:29 am
Location: San Diego

Update

Post by macton »

* Added clear camera animation script
macton
Posts: 93
Joined: Thu Aug 18, 2005 6:29 am
Location: San Diego

Update

Post by macton »

* Added list external files script
macton
Posts: 93
Joined: Thu Aug 18, 2005 6:29 am
Location: San Diego

Update

Post by macton »

* Added Copy Curve script
* Added Paste Curve to Layer Translation Script
* Added simple example file and instructions for the above scripts
macton
Posts: 93
Joined: Thu Aug 18, 2005 6:29 am
Location: San Diego

Update

Post by macton »

* Added Paste Curve To Camera Track script
* Added Paste Curve To Camera Target script
* Added instructions and examples
User avatar
bupaje
Posts: 1175
Joined: Fri Nov 12, 2004 5:44 pm
Location: California
Contact:

Post by bupaje »

Mike, these are fantastic additions. I just tried out the copy/paste camera track bit and works like a charm!
[url=http://burtabreu.animationblogspot.com:2gityfdw]My AnimationBlogSpot[/url:2gityfdw]
macton
Posts: 93
Joined: Thu Aug 18, 2005 6:29 am
Location: San Diego

Post by macton »

bupaje wrote:Mike, these are fantastic additions. I just tried out the copy/paste camera track bit and works like a charm!
Thanks! I always appreciate knowing someone is using the scripts. :)
macton
Posts: 93
Joined: Thu Aug 18, 2005 6:29 am
Location: San Diego

Update

Post by macton »

* Added Relink Lost Images script
User avatar
bupaje
Posts: 1175
Joined: Fri Nov 12, 2004 5:44 pm
Location: California
Contact:

Post by bupaje »

I was playing with these a bit and I wanted to suggest 2 related future tools if 1)they are of use to your guys as well and 2) it is possible.

I tried something and made a line, applied the wavy script to it, then used this as the curve for your 'copy curve' script and then pasted it to a 'boat' layer.

Here is the result

http://stormvisions.com/moho/curvetest1.mov

I was thinking that if this could be done to 'copy curve'>'paste to path' so that you could use the 'rotate to follow path' option it might be cool as the ship (or car, herd, particles etc would orient to follow the path. That's the first idea.

Next idea for a tool which might be cool I got when I duplicated the water layer. I was thinking what if you could put multiple water / trees / cloud / etc layers and animate an object raising through the layers? For example you create

Tree Layer 1
Tree Layer 2
Tree Layer 3
Tree Layer 4
Tree Layer 5
Tree Layer 6
Gorilla Layer


and then have a tool so you could pick a start frame to have the Gorilla begin moving to the top of all the tree layers. So if you have him animated and translate him so he gets bigger, then can have him rise through the layers over X amount of frames he'd see to be rushing past the trees at you. Can also do the same to have objects traveling away down through several layers -ie a character walking away through layers of foilage or down a city street past garbage cans etc. Can be done manually but might be a nice time saver in some cases.
[url=http://burtabreu.animationblogspot.com:2gityfdw]My AnimationBlogSpot[/url:2gityfdw]
macton
Posts: 93
Joined: Thu Aug 18, 2005 6:29 am
Location: San Diego

Post by macton »

bupaje wrote:I was thinking that if this could be done to 'copy curve'>'paste to path' so that you could use the 'rotate to follow path' option it might be cool as the ship (or car, herd, particles etc would orient to follow the path. That's the first idea.
What I did instead was update the "Paste to Layer Translation" script to give you an option to "Rotate to Face Curve". You can also add a rotation offset if your layer isn't facing to the right.

I added a simple example and some instructions as well.
User avatar
bupaje
Posts: 1175
Joined: Fri Nov 12, 2004 5:44 pm
Location: California
Contact:

Post by bupaje »

Woohoo! Excellent. :) Gotta play this weekend. ;)
[url=http://burtabreu.animationblogspot.com:2gityfdw]My AnimationBlogSpot[/url:2gityfdw]
macton
Posts: 93
Joined: Thu Aug 18, 2005 6:29 am
Location: San Diego

Update

Post by macton »

* Added modification of 7feet´s sf_curvature script to allow selection of individual curves.
Post Reply