Skip to content

Repository files navigation

GNM Head Generator for 3ds Max

Donate ❤️ 3dsmax Python PyQt6 License Version

A parametric 3D human head generator plugin for 3ds Max 2025 / 2026 / 2027, powered by Google's GNM (Generative Neural Mesh) model.

Generate, randomize, and animate realistic human head meshes directly in 3ds Max using identity sliders, expression controls, pose controls, and a gender slider — all in real time.


Screenshots

screenshot


Features

Tab What it does
Shape 15 identity sliders (face width, jaw, brow, cheekbones, nose, etc.) + Gender slider (Female ↔ Male)
Expression 78 expression sliders in 5 anatomical groups: Lower Face / Mouth / Jaw, Left Eye, Right Eye, Tongue, Pupils
Expression — Pose 8 pose controls: Head nod/turn/tilt, Neck, Left eye up/down/left/right, Right eye up/down/left/right
Presets Save/load presets with categories and viewport thumbnail previews. Double-click to load, right-click for options
Population Batch-generate a grid of random heads with configurable count, columns, spacing, and random seed

Additional features:

  • Live mesh update with 400 ms debounce — move a slider, the mesh updates automatically
  • UV texture coordinates (channel 1) applied to all generated meshes
  • Z-up coordinate system (native 3ds Max convention)
  • Scale: GNM metres → 3ds Max centimetres (×100)
  • "Use Selected" — pick an existing GNM mesh in the viewport and edit it with the sliders
  • Preset viewport thumbnails captured automatically on save
  • All UI in English

Requirements

  • 3ds Max 2025, 2026, or 2027
  • Internet connection (first run only, to download GNM ~15 MB)
  • ~200 MB disk space

Installation

Copy the plugin

Place the GNM folder anywhere on your machine. Example:

C:\3ds max python\GNM\

Tip: Save this snippet as a MAXScript macro or toolbar button so you can open the tool with one click on every session.

3. First-time setup

The Setup page appears on first run. Click Install & Setup GNM to:

  1. Download the GNM repository from GitHub (~15 MB)
  2. Extract it to GNM/vendor/
  3. Install all required Python packages into 3ds Max's Python
  4. Register GNM on sys.path

This takes 2–5 minutes depending on your internet speed. After completion the tool switches to the ready state automatically.


Compatibility

3ds Max Python NumPy installed
2025 3.11 numpy < 2 (1.x)
2026 3.12 numpy < 2 (1.x)
2027 3.13 numpy >= 2 (2.x)

The installer detects your Python version and installs the correct NumPy version automatically.


Usage

Shape tab

Move the identity sliders to sculpt the head shape. Each slider corresponds to a principal component of GNM's identity space.

  • Reset All — return all identity sliders to zero
  • Randomize — fill with random identity values
  • Gender slider — blend between a statistically average female and male face (requires h5py, installed automatically)
  • Create New Mesh — generate a new mesh in the scene with the current settings
  • Use Selected — select an existing GNM mesh in the viewport, then click to load its identity into the sliders

screenshot

Expression tab

Five collapsible groups of expression sliders control facial expressions. Lower Face is open by default; the other groups start collapsed.

Pose controls at the top let you rotate the head, neck, and eyes.

screenshot

Presets tab

  1. Set a Name and optional Category
  2. Click Save Preset — the current slider values and a viewport thumbnail are saved
  3. Browse presets in the gallery (3 per row)
  4. Double-click a preset to load it
  5. Right-click for: Load / Rename / Set Category / Delete

Category headers can be renamed by right-clicking the category name.

screenshot

Animation tab

Animate GNM head parameters over the Max timeline using keyframes and live scrubbing.

Basic keyframe workflow

  1. Set slider values for frame 0 → click Add Keyframe
  2. Move the Max timeline to another frame, adjust sliders → click Add Keyframe again
  3. Repeat for as many keyframes as needed
  4. Click Arm Animation — scrubbing the Max timeline now updates the mesh live (linear interpolation)
  5. Click Bake to Timeline to bake all keyframes as a Morpher modifier with real timeline keys

Lip Sync from Audio

  1. Browse a WAV file
  2. Choose Generate Lip Sync (Rhubarb) or Wav2Vec2 Lip Sync (Offline AI)
  3. Keyframes are applied automatically — use Strength to scale mouth movement intensity
  4. Clear Lip Sync removes only lip-sync keyframes
Control Description
Arm / Disarm Toggle live timeline scrubbing
Add Keyframe Snapshot current sliders at current frame
Go To Frame Jump timeline to selected keyframe
Delete / Clear All Remove keyframes
Bake to Timeline Create Morpher modifier with real Max keys
Save / Load JSON Persist keyframe list to GNM/animation/
Strength Scale phoneme expression intensity (0.1 – 3.0)

screenshot

Note: Bake to Timeline generates one morph target mesh per keyframe, builds a Morpher modifier, then deletes the temporary meshes. The resulting Morpher keys can be exported with FBX or used with any Max renderer.

Population tab

Generate a grid of random heads in one click:

Setting Description
Count Total number of heads
Columns Heads per row
Spacing X / Y Distance between heads (cm)
Seed Random seed for reproducibility

File Structure

GNM/
├── launch.py               ← Entry point
├── core.py                 ← Main UI (QDockWidget, all tabs)
├── gnm_bridge.py           ← GNM model interface, mesh creation, lip sync
├── wav2vec2_worker.py      ← Isolated subprocess for Wav2Vec2 inference
├── setup_manager.py        ← Download, extract, install dependencies
├── constants.py            ← Version, colours, stylesheet, phoneme table
├── utils.py                ← QLogger helper
├── __init__.py
├── config.json             ← Installation state (auto-created)
├── phoneme_calibration.json ← Lip sync expression calibration (auto-created)
├── presets/                ← Saved presets (JSON + PNG thumbnail)
├── animation/              ← Saved animation keyframe files
└── vendor/
    ├── GNM-main/           ← Google GNM repository
    ├── rhubarb/            ← Rhubarb Lip Sync binary
    └── wav2vec2/           ← Wav2Vec2 model cache (~378 MB)

Resetting / Reinstalling

Click ⚙ → Reinstall in the tool, or manually delete:

GNM/vendor/       ← downloaded GNM repo and model data
GNM/config.json   ← installation state

Then reopen the tool — the Setup page will appear again.

Note: If you installed on 3ds Max 2026 first, reinstalling on 2027 will skip the download and only install packages — much faster.


Known Issues & Troubleshooting

NumPy version conflict on 3ds Max 2025

Symptom:

A module that was compiled using NumPy 1.x cannot be run in NumPy 2.x

Cause: Max 2025's compiled extensions (USD Tools, MAXtoA) require NumPy 1.x. If another tool installed NumPy 2.x, this conflict appears.

Fix — run once in the Max 2025 Python Listener:

import subprocess, sys
subprocess.run([sys.executable, "-m", "pip", "install",
                "--force-reinstall", "--user", "numpy<2"])

Then close and reopen 3ds Max 2025.

Prevention: When installing additional pip packages in Max 2025, always pin NumPy:

subprocess.run([sys.executable, "-m", "pip", "install",
                "--user", "your-package", "numpy<2"])

Setup stuck at 0% on 3ds Max 2027 (first run)

Cause: Max 2027's Python distribution does not include pip. The installer bootstraps it automatically via ensurepip, but this can take 30–60 seconds with no visible progress.

What to do: Wait. You will see pip not found — bootstrapping... in the log, followed by pip ready. when it completes.

If it still fails after 60 seconds:

  1. Close the GNM tool window (do not close 3ds Max itself)
  2. Rerun the launch script in the MAXScript Listener Python tab:
    import GNM.launch
    GNM.launch.launch()
  3. Click Install & Setup GNM again — pip is now bootstrapped, and the install will proceed normally

DirtyNotificationEventMonitor error

-- Error: DirtyNotificationEventMonitor call depth count < 0

Cause: Harmless Max internal warning that occasionally appears when a Qt dock widget is closed and reopened quickly. The tool continues to work normally. If it appears repeatedly, close and rerun GNM.launch.launch().



Dependencies

All installed automatically:

Package Purpose
numpy Array math (1.x for Max 2025/2026, 2.x for Max 2027)
h5py Read GNM decoder models without TensorFlow
scipy Scientific computing (GNM dependency)
trimesh Mesh utilities (GNM dependency)
requests HTTP downloads
torch PyTorch CPU — required for Wav2Vec2
transformers HuggingFace Transformers — Wav2Vec2 model
absl-py Google utilities (GNM dependency)
etils Google utilities (GNM dependency)
immutabledict Immutable dicts (GNM dependency)
importlib_resources Resource loading (GNM dependency)
opt-einsum Optimised einsum (GNM dependency)
rtree Spatial indexing (GNM dependency)
tqdm Progress bars (GNM dependency)
typeguard Runtime type checking (GNM dependency)
opencv-python Image processing (GNM dependency)

Credits

Note on the GNM model: The GNM was trained on datasets using binary gender categories and four broad demographic groups (Middle Eastern, Asian, White, Black). It does not represent all gender identities or the full diversity of the global population. See the GNM README for details.


License

This plugin is provided as-is for personal and professional use. The underlying GNM model is subject to Google's Apache 2.0 License.

About

Generate, randomize, and animate realistic human head meshes directly in 3ds Max using identity sliders, expression controls, pose controls, and a gender slider — all in real time.

Resources

Stars

13 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages