Skip to content

Format (x86 and x64)

marika edited this page Dec 22, 2020 · 7 revisions

AEP Format (x86 and x64)

Project

Projects are a set of assets which can be used by layers within them.

If you are familiar with After Effects, this is a project that you would open.

Each AEP file is one project which is placed immediately at the beginning of the file, without a header.

Offset (x86) Offset (x64) Type Description
0x0 0x0 None Assets array (16-byte null-terminated)
End of assets terminator + 0x0 End of assets terminator + 0x0 Pointer Pointer to start of layers section
End of assets terminator + 0x4 None U32 Padding (0x0)
End of assets terminator + 0x8 End of assets terminator + 0x8 U64 Padding (0x0)

Asset

Assets are individual textures and compositions which can be used by other assets, dynamically loaded at runtime, and displayed on screen.

If you are familiar with After Effects, these are the assets that would appear in the project panel.

Offset (x86) Offset (x64) Type Description
0x4 0x0 String Name
0x0 0x8 U16 Size, in bytes (always 20 in x86 and 32 in x64)
0x2 0xa U16 Type
0x8 0xc U16 Width, in pixels
0xa 0xe U16 Height, in pixels
0x10 0x10 Pointer Composition layers array pointer
0xc 0x18 Count Number of composition layers

For texture assets, the name is also the case-insensitive name of the texture that the asset uses, within the game's texture store.

Type

Value Description
0x0 Texture
0x1 Composition

Layer

Layers define visual content within the scene graph, being contained within an asset. Each layer's contents can be a texture asset, a solid colour, or a composition asset.

If you are familiar with After Effects, these are the layers that would appear in the timeline panel.

Offset (x86) Offset (x64) Type Description
0x0 0x0 U16 Size, in bytes (always 56 in x86 and 112 in x64)
(0x2 >> 4) & 0xf (0x2 >> 4) & 0xf U8 Type
0x2 & 0xf 0x2 & 0xf U8 Blend mode
0x3 0x3 U8 Padding (0x0)
None 0x4 U32 Padding (0x0)
0x4 0x8 String Name
0x8 0x10 Pointer Timeline pointer
0xc 0x18 Pointer Position keyframe set pointer
0x10 0x20 Pointer Anchor point keyframe set pointer
0x14 0x28 Pointer Colour keyframe set pointer
0x18 0x30 Pointer Scale keyframe set pointer
0x1c 0x38 Pointer Alpha keyframe set pointer
0x20 0x40 Pointer Unknown keyframe set, unused pointer
0x24 0x48 Pointer Rotation X keyframe set pointer
0x28 0x50 Pointer Rotation Y keyframe set pointer
0x2c 0x58 Pointer Rotation Z keyframe set pointer
0x30 0x60 Pointer Size keyframe set pointer
0x34 0x68 Pointer Marker keyframe set pointer

If a layer is a nested composition or texture then its name is the name of the asset that it uses. If this name contains a -, then only the part after it is considered the asset name. This is done to allow multiple layers of the same asset within the same composition to be uniquely identified when navigating the graph.

Type

Values Description
0x4 Nested composition
0x6 Colour
0x7 Texture

Blend mode

Values Description
0x2 Normal
0x4 Additive
0x5 Multiply?

Timeline

Defines properties of a layer's self-contained timeline.

Offset (x86) Offset (x64) Type Description
0x0 0x0 U16 Size, in bytes (always 12)
0x2 0x2 U16 Start frame number
0x4 0x4 U16 Unknown frame number (commonly 0)
0x6 0x6 U16 Duration, in frames
0x8 0x8 U32 Unknown (always 0x00100000)

Timeline frame numbers are absolute, not relative to any parent layers.

The frame number of each keyframe within a layer is relative to the start frame number of said layer's timeline, and are always within the timeline's duration. When a layer's current frame is outside of its timeline's range it is hidden.

Note that it is possible for a layer to not have timeline properties, in which case the start frame number defaults to zero and the layer is always shown.

Keyframe set

Keyframe sets are an array of keyframes for a single property of a layer, terminated by a keyframe with frame number 0xffff. The value between two keyframes is linearly interpolated from the first keyframe's value to the second over the course of their frames.

Note that any frame before the frame number of the first keyframe within a set uses the first keyframe's value.

Keyframe

Keyframes contain arbitrary timed data within a layer's timeline. A keyframe is unaware of the format of its data, only the size of it and the frame number at which it is placed.

Offset (x86) Offset (x64) Type Description
0x0 0x0 U16 Size, in bytes
0x2 0x2 U16 Frame number
0x4 0x4 Undefined Data

Keyframe data

All offsets are relative to the beginning of the keyframe's data.

Position

Size is always 16, defaults to 0,0,0. Each coordinate is in pixels from the top-left corner of the containing composition's local coordinate system.

Offset (x86) Offset (x64) Type Description
0x0 0x0 F32 X
0x4 0x4 F32 Y
0x8 0x8 F32 Z

Anchor point

Anchor points are used to define the origin point of a layer's local coordinate system. See the appropriate After Effects documentation for further details on how anchor points affect layout.

Size is always 16, defaults to 50,50,0. Each coordinate is in normalized percentage of the layer's size from 0 to 100, from the top-left corner of the layer.

Offset (x86) Offset (x64) Type Description
0x0 0x0 F32 X
0x4 0x4 F32 Y
0x8 0x8 F32 Z

Colour

Size is always 8 or 20, defaults to #ffffffff.

  • If 8:
Offset (x86) Offset (x64) Type Description
0x0 0x0 U8 Red
0x1 0x1 U8 Green
0x2 0x2 U8 Blue
0x3 0x3 U8 Alpha
  • If 20:
Offset (x86) Offset (x64) Type Description
0x0 0x0 F32 Red
0x4 0x4 F32 Green
0x8 0x8 F32 Blue
0xc 0xc F32 Alpha

Note that, although colour can be keyframed, libaep will only use the first keyframe's value.

Scale

Size is always 12, defaults to 100,100. Each coordinate is in normalized percentage from 0 to 100 around the anchor point.

Offset (x86) Offset (x64) Type Description
0x0 0x0 F32 X
0x4 0x4 F32 Y

Alpha

Size is always 8, defaults to 100.

Offset (x86) Offset (x64) Type Description
0x0 0x0 F32 Value, in normalized percentage from 0 to 100

Rotation

Size is always 8, defaults to 0.

Offset (x86) Offset (x64) Type Description
0x0 0x0 F32 Degrees, around the anchor point

Size

Size is always 8, defaults to 0,0. Each dimension is in pixels.

Offset (x86) Offset (x64) Type Description
0x0 0x0 U16 Width
0x2 0x2 U16 Height

Marker

Markers are points on a layer's timeline that the program should be made aware of. Generally markers are used to mark different animations, such as an in and end markers marking the beginning and end of a transition animation. These can also be used to perform actions within the program, such as an se marker being used to indicate to the program that a sound effect should be played when the marker is reached.

Size is always 12 (x86) or 16 (x64).

Offset (x86) Offset (x64) Type Description
0x0 0x0 U32 Unknown (commonly 0x00000000 and 0xffffffff)
0x4 0x4 String Name