constrain layer to camera

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
mattmos
Posts: 5
Joined: Fri Jun 02, 2023 12:54 pm

constrain layer to camera

Post by mattmos »

Hey mohos,

is there a way to constrain a layer to the camera? I have an animated image seq which was rendered out from blender, and want to pin that layer to the camera so that i can animate the camera and match the movement (roughly) of the 3d camera.

Or would it be possible to import animation from a 3d camera into moho?

Cheers,
Matt
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: constrain layer to camera

Post by Lukas »

In the layer settings there is a checkbox to set a layer “immune to camera movements”. It has to be in the root of the document. So not in a group.
mattmos
Posts: 5
Joined: Fri Jun 02, 2023 12:54 pm

Re: constrain layer to camera

Post by mattmos »

Ah brilliant, thank you so much!

One last question, is it possible to copy keyframes from a layer to a camera? I'm tryin in the motion graph but don't seem to be able to paste frames onto the camera channels, even after seperating into each axis.
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: constrain layer to camera

Post by Lukas »

You can only copy camera keys to the camera channels. If you want to do it any other way you need to use custom scripts.
User avatar
hayasidist
Posts: 3526
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: constrain layer to camera

Post by hayasidist »

If you get to the point of wanting to script a solution, this (nearly 10 years old and untouched since) might at least steer. https://www.mediafire.com/file/upewb49h ... 0.zip/file

It was originally designed to unload camera keys from one moho doc and load them into another; but native moho functionality took over (copy / paste between docs). However, it could form the basis of unloading from one group of channels to create a data file that could be loaded into the camera channels.

e,g. Export takes a "source" layer and creates its output file in which

translation becomes camera position
x/y rotation become tilt / pan
z rotation becomes roll
z scale becomes zoom

Then import works as before.

All, ofc, with updates to support whatever has changed in AS/Moho since then...
mattmos
Posts: 5
Joined: Fri Jun 02, 2023 12:54 pm

Re: constrain layer to camera

Post by mattmos »

cool, thank you for the quick help.

And thanks for the script idea, I'll take a look but right now its probably just one shot that i need to replicate the movement so it might be overkill. Will save it for later though :)
Post Reply