Skip to content

Facial animation import/export tool for Mafia: The City of Lost Heaven and Hidden & Dangerous 2.

Notifications You must be signed in to change notification settings

kirill-mapper/LS3D_FaceAnim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

LS3D FaceAnim

Facial animation import/export tool for Mafia: The City of Lost Heaven and Hidden & Dangerous 2.

MAXScript utility for 3ds Max that works with .dat facial animation files used by the LS3D engine.

LS3D_FaceAnim

Features

  • Import/export .dat facial animation files
  • Real-time preview through Morpher modifier
  • 6 facial parameters: mouth, jaw, lips, eyelids, eyes, brows
  • Batch import multiple files sequentially
  • Replace or insert animation modes
  • Segment export with custom frame range

Requirements

  • 3ds Max (tested on 2014-2026+)
  • Max4dsTools (Import/Export Characters)
  • DTA Unpacker (Unpack TABLES/DAT /DABING)

Usage

  1. Set frame rate to 25 FPS(Mafia) or 50 FPS(H&D2) via Time Configuration
  2. Import a character model using Max4dsTools
  3. Run LS3D_FaceAnim.ms via Scripting → Run Script
  4. Select the mesh with Morpher modifier
  5. Click SETUP to configure face parameters
  6. Unpack TABLES/DAT or /DABING folder using DTA Unpacker
  7. Click IMPORT to load a .dat file

Format

Each .dat file contains per-frame facial animation data.
Engine playback rate:

  • Mafia 25 FPS (40ms/frame)
  • H&D2 50 FPS (20ms/frame)

All values are bytes (0–255).

Header: uint32 frameCount + uint32 soundEntries (8 bytes)
Frame: 6 parameter bytes + 2 unused bytes (8 bytes per frame)

Byte Parameter Description
B0 MouthExpr Mouth expression blend
B1 JawOpen Jaw open amount
B2 LipsMood Lip mood (frown/smile)
B3 Eyelids Eye openness
B4 EyesBrows Eyes/brows master influence
B5 BrowExpr Brow expression

Parameters control 10 morph channels across three groups (mouth, eyes, brows).
Weights within each group always sum to 1.0.
No separate left/right control.

Credits

  • kirill_mapper (komarovs_mappers)
  • Claude (Anthropic)

About

Facial animation import/export tool for Mafia: The City of Lost Heaven and Hidden & Dangerous 2.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published