SkillAgentSearch skills...

Pycgfx

A program for converting glTF models into the Nintendo 3DS's CGFX format.

Install / Use

/learn @skyfloogle/Pycgfx
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

pycgfx

pycgfx is a tool for converting glTF models into the CGFX (aka BCRES) format supported by the Nintendo 3DS's home menu banners, as well as the Python library backing it.

Normal texture demo <br> The Compare Normal sample model

Skinned mesh animation demo <br> The Cesium Man sample model

The tool supports a number of glTF features:

  • .gltf and .glb files
  • Diffuse and normal textures
  • Constant roughness factor, for specular lighting
  • Double-sided materials and alpha blend settings
  • Animations and skinning
  • Diffuse colour animation using KHR_animation_pointer

All animations are played at once.

Usage

The gltflib and pillow libraries are required. They can be installed via pip, or by running pipenv sync.

Following this, simply run the main.py script through the command line, with your input file as an argument:

# With pipenv
pipenv run python main.py input.glb
# Windows, no pipenv
python main.py input.glb
# macOS / Linux, no pipenv
python3 main.py input.glb

CGFX files larger than 512KB are not supported by the 3DS, and this tool will print a warning if one is generated.

Some features useful for banners, such as billboarding (useful for logos), are not supported by the glTF specification. These can be enabled after processing using ImHex (see below), or by modifying the script. If there is demand, I'm open to working with users to figure out some kind of config file for configuring lights or marking bones as billboards.

Additional assets

Also included in the repository is an ImHex pattern (cgfx.hexpat), with which CGFX files can be viewed and edited. Be warned that reading it uses several gigabytes of RAM.

There is also a small glTF (banner.gltf) specifying the camera used in the 3DS home menu, for use during creation of banner models.

View on GitHub
GitHub Stars27
CategoryDevelopment
Updated19d ago
Forks1

Languages

Python

Security Score

75/100

Audited on Mar 12, 2026

No findings