I always forget this, try to do it through the regular animation baking option and get frustrated that it doesn’t work…
When you want to bake an object’s Rigid Body physics simulation to regular Keyframes:
Select the wanted objects.
Press F3 to open the command search floater,
Begin typing: bake to keyframes to Locate the command: Rigid Body: Bake To Keyframes and select it. Note:
The command will appear only if objects with rigid body physics properties are selected.
Set a frame range for the bake and press OK:
The physically simulated motion is recorded to keyframes:
Select the 3D Camera layer and also Null layers if available.
Choose File > Scripts > Run Script File and locate the AE3D_Export script.
In the Script parameters highlight 3ds max.
Click Options and set the scale. * you might need to try and see the scale in 3ds max to set it right.
Set a name for the exported ms (MaxScript) file.
Click Export. The resulting MaxScript file will appear on the desktop named <your after effects project name>.ms Note: You may be prompted to check the Allow Scripts to Write Files and Access Network option in File > Preferences > Scripts & Expressions.
Drag the generated MaxScript file into the 3ds max viewport. The script will run and create an animated Camera and Dummy object, and also set the timeline range to fit the animation.
Create a new Point Helper object.
Align the new Point Helper to the Dummy object in both position and orientation.
Group the Camera and the Dummy objects together, and link the group to a new Point Helper. This will allow for easy orientation and scaling.
Set the Point Helper object’s rotation to default (0,0,0) , this will also reset the Dummy + Camera group’s orientation relative to the world. Scale the Point Helper object if needed, to scale the whole camera setup.
Display the original video sequence as viewport background to check how the camera motion fits the video. The center of your Point Helper should appear “glued” to a specific point in the background video.