Blender to Apple Motion export script

Thank you Andrew! Do I change the transform to Local on all the Nulls for them to face correctly. I will test out the new script. :slight_smile:

The switch to local is just changing which rotation axis is being shown in the Blender UI. If it’s set to global, when you select an object, it shows you which way the global axis is pointing (which is fixed). If you set it to local, it shows the object’s own axis, which is located at the object’s pivot point (orange dot).

If you have a default cube, the global axis should be blue(z) up, green(y) sideways, red(x) into the screen. Switching to local will show the same thing by default. However, if you now rotate round x by 90 (by typing r,x,90 and hit return), the local axes will now be blue(z) sideways, green(y) up, red(x) into the screen. If you switch back to global, the global axis is unchanged as this is the fixed world axis.

You’d use the local axis view to rotate the nulls so that your drop zones are up the right way based on the x-axis and y-axis. Whichever way the green arrow points in local axis mode is the dropzone pointing down and it will be flat against red and green with blue pointing away from it. If you wanted the drop zone upright, the green arrow would be pointing down.

You can of course sort the rotations in Motion if it’s faster but it saves doing it each time for multiple exports if it’s set in Blender.

Thank you Andrew! :slight_smile:

Hi guys. It’s been about 7-8 years since I visited here (good to still see you here Andrew, waving the OSX flag) but I’ve recently discovered Motion and FCPX and it looks like I’ll be getting back into a bit of Blender now too.

I’ve downloaded the excellent script and had a quick go and can see it will be very useful once I remember how to use Blender :slight_smile: I watched Deyson’s tutorial (thanks) and managed to animate the camera, export and then attach an image in Motion to a Blender empty. Nice.

One quick and boring question - how do I get Blender meshes to show in Motion? The Cube is in the Layers list in Motion, but isn’t visible. All I can see is the grid. I assume I’m missing something obvious.

Thanks - and good to be back.

EDIT: After further thought, I guess I bring in such elements as a rendered movie - with alpha if required?

EDIT AGAIN: After a few more minutes experimenting - I like this a lot already. I cleaned up the curves using Motions “Reduce Keyframes” option and this gave me smooth adjustable curves to tweak as desired in Motion.

The exported keyframes shouldn’t be adjusted inside Motion because they are set to match what’s been done in Blender. The script is to allow you to add objects in Motion and mix them with a 3D scene from Blender without rendering again in Blender.

You would setup a 3D animation or scene in Blender and have all sorts of objects in the scene, maybe a series of picture frames in a hallway and have a camera moving down the hallway. Say that the animation render of the hallway takes an hour. If the pictures in the frames (say graduation photos) were chosen at render time and you changed your mind after seeing the animation, you’d have to render the animation again for another hour.

With this setup, you can render the hallway animation with no pictures in the frames, just the hallway itself and some alpha masks for the pictures. You’d then export the animation data to Motion so that Motion knows more details about the scene. This data allows you to insert objects into the render in real-time without having to render the main animation again but the keyframe data has to stay the same so that everything aligns properly.

This setup is used for motion graphics on TV. You’ll have seen animated 3D graphics in news programs, talk shows etc but certain elements change like a different video clip, image or text. Rather than render the 3D each time there’s a change, it just happens once and the image, video or text is updated.

Say you were making a home movie in Final Cut Pro and you wanted to have an animated 3D transition, you could render the 3D template in Blender. But the footage on each side of the transition will change throughout the movie each time you use the transition so this allows you to insert different footage while only rendering one time in Blender.

You’ll have seen templates for Final Cut and in the past for iDVD with drop zones. Like the 3D curtains where they swoosh open and show the movie behind it. You can just drop your own footage into those. For 2D effects, this can be done with just a flat alpha mask. If you had any complex movement though like sweeping the camera over and then zooming into the footage, you’d need 3D data and that’s what this script does.

Blender has an internal compositor now so this is an alternative option to that and it’s a bit easier for using in Final Cut Pro.

Just as OS X had said. The layers have to be rendered out of Blender as movie files or Still sequences and imported into Motion and if you want each layer to be separate then you would have to render each layer out of Blender as individual movies with alpha channels or render their Luma Mattes.

Also, when you import the rendered layers into Motion you will want to create a new group for them and make that layer 2d as they are flat renders of your animation. The placeholders and the things you will want to recreate in Motion you leave as a 3D layer.

One trick I use is to render everything in mid gray tone and then add color inside of Motion so I can have more control in my templates.

I highly recommend you download my free 3D templates so you can see how I was able to create them. Also I would not make any changes to the keyframes inside of Motion as you want the animation to match the rendered movies.

I have 2 Free 3D templates to download called Polaroid Play and Holiday Cheer: https://motion-master-templates.com/category/free-templates/

Please let me know if you have any further questions and have an amazing day! :slight_smile:

Thanks guys - not smoothing keyframes makes sense for compositing with Blender objects. It’s early days for me with Motion but I think I will find this useful. I’ll take a look at Deyson’s work to see what I can learn.

Best of luck and keep us posted with your progress! :slight_smile:

Hello and good day! Just wanted to share my latest creation. With this I did not render out of Blender I just used Blender great key framing tools to give this box a nice bouncy animation. Plus it was a great way to test this new script. So far so good :slight_smile:

Thank you so much for taking the time to create this script.
Here you can download the Blender 2.8 version of the script.
motion_camera_tracking.py.zip (4.5 KB)

2 Likes

Thanks a lot!!

Hello! It has been a while and I hope all is well.

I had a question. Is it possible to export multiple cameras? When I do, I see the camera appears a layer and not a camera inside of Motion.

Thank you and have an amazing day! :slight_smile:

Hi, good to hear from you, I think I set the additional cameras to export as layers by default because exporting all the cameras made it hard to remember which one was the render camera in Motion. I figured there would generally only be a single render camera per sequence. But all the properties get exported so it’s easy to convert the layer to a camera in the .motn file. Where it says something like:

<layer name="Camera_001" id="10003">

that just needs changed to:

<scenenode name="Camera_001" id="10003" factoryID="4" version="5">

and change the </layer> that matches to </scenenode>. Save and open.

I’ll have a look at adding that as an option. I also need to update the latest script to 2.8. The one above seems to be an older version that is missing the Euler filtering (to correct the axis flips), duplicate keyframe removal, drop zones etc.

1 Like

Awesome. Thank you for the code.

What I did was use a Link Behavior to the Camera Layer to the actual Camera and it worked.

However, for more advanced work like focus and advanced camera camera settings then we may need the camera settings. :slight_smile:

I am happy to see that you are still active in the community.

I will share what I am creating soon. :slight_smile:

I forgot I already had fixed this but that script for 2.8 was based on an old version, which didn’t have it. I have uploaded a new version here:

http://www.dev-art.co.uk/files/motion_camera_tracking.py.zip

This has the additional things that were added too like the animation and keyframe filtering, drop zones (in the n-key panel in the 3D view) and camera exports.

Layer visibility might be broken in this because the layer system was changed to collections.

I had wondered what happened to the Drop Zone. :slight_smile:

Is this script still part of Blender or not anymore?

Also, do you know if Motion Blurs and Camera Depth of Fields will also be the same in the Motion File as it is in the the Blender file?

Thank you and have an amazing day! :slight_smile:

The script still installs the same way as before like other external add-ons. Once it’s installed, it behaves the same as a bundled add-on.

Motion blur should be the same as Blender, the Euler filtering was added to help with that. Mainly the blur comes from the camera movement, which matches Blender’s movement exactly.

Depth of field should match too but I’m not certain about that one. The aperture and aspect settings are matched for accurate tracking so having the correct camera properties should mean the depth of field works the same. However, the depth of field effects are likely processed differently in Blender and Motion so visually they might not match.

1 Like

Thank you :slight_smile:

They updated Motion to 5.4.6 and its now support 3d models .usdz only, all texturing must be done in the host 3d program, but animation is definitely supported.

1 Like

Very useful script, thanks for sharing!