Collada plugin for After Effects

More info here
Collada Import/Export Plugin for After Effects - Geometry

AECollada Geometry Import:

Version 1.1x of the AECollada plugin introduces an experimental geometry import feature.  Development was halted because even a relatively simple mesh object can slow After Effects to a crawl. 1 polygon translates into 2 layers using this system and is a big part of the poor performance. Despite it's failure to perform it was released as a perk for paying customers who may find it useful.  It only works with very simple geometry and in most cases some adjustment will be needed.

Works best when geometry is composed of one square face, with a texture applied, facing the positive Z axis with no rotations. Translated, scale and rotate into position and the face will match up in After Effects.  This has only been tested in a Z-up 3D application(trueSpace).

The Good.:

lw10.1 scene

lw10.1 wireframe minimum

ae imported from lw

When it works it works great.  This series of images show the original Lightwave LiveSet scene, "SciTech", imported to After Effects.  The scene was reduced down to the curved wall composed of 90 4 sided polygons and a single polygon for the floating video screen.  The special LiveSet materials were replaced with simple textures, one from the LiveSet package and a still from the 3DBuzz Maya Fundamentals course done in Lightwave.  The result in AE is 90 layers for the 2 images and 90 solid layers that are used as alpha track mattes for the footage layers.  The solid track matte layers determine the size and shape of each polygon.  With automatic scale this scene imported at scale=1.  This gave a chunky result because of the small polygons, so autoscale was turned off and the scene was re-imported using a scale of 10.  No other adjustments were needed to get a good result.

The Bad.:

After Effects runs very slowly even with just this simple geometry.  It's best for small polygon counts.  It does not work with triangles.  Only very simple shapes work properly.  Shapes that are composed of faces made of all right angles facing in the world x,y,or z direction with uv edges that run primarily in horizontal or vertical directions but not diagonally. Boxes, cylinders and their variations will work or can be made to work.  The plugin will guess the orientation of the polygons and it will often guess incorrectly.  If the faces of the mesh are not made up of right angles, a mask will be created roughly in the shape of the face, but it will not be accurate.  This model import "feature" is not being pursued.  It was basically a failed experiment so this is as good as it gets.

The Ugly.:

torus mesh bad torus

It doesn't always work properly.  These images show the absolute worst outcome possible.  It's a torus shaped mesh with standard uv mapping applied.  When imported to AE the polygons are all twisted around.  They all face in the correct direction, but need to be rotated around their Z axis.  But that's not all.  The UV projection must be in the same shape as the polygon in 3D space.  All the polygons are trapezoid shapes but their UV's are rectangular.

trapezoid mesh square uv  trapezoid mesh square uv result
trapezoid poly trapezoid uv  trap poly trap uv result

This series of images shows the importance of the UV projection shape matching the 3D shape.  The polygon in trueSpace has a trapezoidal shape.  The rectangular uv resulted in a rectangular shape in After Effects.  A trapezoidal uv shape gives a good result for the shape.  The final image also shows how any shape that is not rectangular will have a mask applied to the solid layer to produce the desired shape.  One of the problems with the ugly case above is that the faces of the torus are not rectangular but are trapezoidal in shape with rectangular uv.  So even if the faces are all untwisted it would still not look good. 

Only faces made of right angles can be aligned to each other properly.

book 3d
book imported
book fixed

This series shows a more typical box mesh case with rectangular faces, aligned with the world coordinates.  The top image shows the mesh in the 3D viewport inside of the trueSpace application.  The middle image shows the imported mesh inside After Effects.  The front and top faces are off by 180 degrees and the side faces are off by 90 degrees.  Bottom is the result of manually rotating the faces around their Z axis.  There is an expression on the orientation so they were twisted in z using rotation instead of orientation.

Each face of the mesh will create 2 layers.  A footage layer or solid color if no image was defined in the collada file and a solid layer that defines the shape of the face and acts as a track matte and a parent for the layer.

cylinder 3d

imported cylinder

This series of images show the steps used to fix the polygon twist problem of a cylinder shape.  A cylinder shape may come in perfectly or not.  It depends on the general orientation in 3D space.  In this case it came in all wrong.  If the cylinder had been created upright and then rotated onto it's side it would have imported without the twisting.  The vertex option was selected to create nulls to help align the faces.  I don't recommend removing the redundant vertices at this point since it can be helpful for each face have it's own set of vertex nulls.  It looks like a jumbled mess but the only thing off is the twist about the z axis.

imported layers

Each face of the mesh will create 2 layers.  A footage layer or solid if no image was defined in the collada file and a solid layer that defines the shape of the face and acts as a track matte and a parent for the other layer.  This is the appearance from a fresh import.  "Cylinder_F_12" is the track matte/polygon and parent of the import png footage.  The "Cylinder_F_12V" are the vertex null layers. 

Images below show the Shy It script used to help isolate layers for selection.

shy it png

First select all the layers that have the TrkMat alpha set.  These layers provide the color information for the face in the form of imported footage or a solid color layer.  Lock those layers so they cannot be selected. 

shy it face

Make the track matte layers visible so that they can be selected and change the transfer mode to something like soft light. Now the image shows through and the matte layers can be selected in the viewport without the footage layers getting in the way.  At this point the face layers can be rotated about z to their proper values using Rotation(not Orientation) method.

lookat expression

The Orientation for each layer is locked by a lookat expression.  The lookAt expression can be removed from the mesh face layers.  Select all the solid layers used as track mattes for the faces.  The Shy_It script has a preset for  isolating the face layers.  Choose the faces preset from the drop down, click the Preserve button if needed to save the current shy state then press Go to isolate the face layers.  Leave the Shy It panel open if restoration of the shy states is needed.

shyit faces

fixed import

This image shows the cylinder partially fixed.  It only has 12 faces so it doesn't take long to rotate them into position.  The final steps would be to remove the vertex null layers, set the TrkMat layers to invisible and change their transfer mode back to normal.  You can see that the the cylinder has a faceted appearance.  This is because it is made of individual layers, not a single mesh that can be set to smooth like in a 3D application.

December 17, 2011