Documentation Index
Fetch the complete documentation index at: https://mintlify.com/armory3d/armorpaint/llms.txt
Use this file to discover all available pages before exploring further.
project.js is the build manifest for ArmorPaint. When amake runs, it feeds this file to the embedded QuickJS engine, which evaluates it to assemble the full list of C source files, include directories, libraries, preprocessor defines, shaders, and assets that make up the final build. Every platform-specific difference — which GPU backend to compile, which system libraries to link, which defines to set — is expressed as ordinary JavaScript conditional logic inside project.js.
Project API
TheProject object is instantiated inside project.js and exposes the following methods:
project.add_cfiles(pattern)
project.add_cfiles(pattern)
Adds C source files matching the given glob pattern to the list of files to compile.
project.add_include_dir(path)
project.add_include_dir(path)
Adds a directory to the compiler’s include search path.
project.add_define(name)
project.add_define(name)
Adds a preprocessor
#define that is passed to the compiler for all source files.project.add_lib(name)
project.add_lib(name)
Links an external library into the final binary.
project.add_shaders(pattern)
project.add_shaders(pattern)
Registers
.kong shader files for compilation by ashader. These are compiled to the appropriate GPU API format at build time.project.add_assets(pattern, options)
project.add_assets(pattern, options)
Bundles asset files into the output
data/ directory. The options object accepts a destination template string using {name} as a placeholder for the original filename.project.add_project(path)
project.add_project(path)
Subprojects another
project.js file, merging its sources, defines, and assets into the current project.Platform Conditionals
Theplatform global variable is set by amake before evaluating project.js. Source files, defines, and libraries are added conditionally based on its value:
Graphics API Defines
Each platform sets exactly one graphics API define that gates the correct backend code throughout the engine sources:| Define | Platform | Backend File |
|---|---|---|
IRON_DIRECT3D12 | Windows | direct3d12_gpu.c |
IRON_VULKAN | Linux, Android | vulkan_gpu.c |
IRON_METAL | macOS, iOS | metal_gpu.m |
IRON_WEBGPU | WASM | webgpu_gpu.c |
Build Flags
Theflags object is populated by the paint-level project.js before being passed to base/project.js. Each flag gates optional features:
| Flag | Effect |
|---|---|
flags.with_audio | Enables the audio backend (platform-specific: dsound, asound, OpenSLES) |
flags.with_gamepad | Enables gamepad input (dinput8 on Windows, udev on Linux) |
flags.with_d3dcompiler | Enables runtime shader compilation on Windows (d3dcompiler, d3d11) |
flags.with_nfd | Enables the native file dialog library (nfd.c) |
flags.with_kong | Embeds the Kong shader compiler for runtime shader compilation |
flags.with_physics | Enables the physics simulation library (asim.c) |
flags.with_raytrace | Includes pre-compiled raytrace shader assets |
flags.with_bc7 | Enables BC7 texture compression (bc7enc.c) |
flags.with_eval | Enables the MiniC scripting evaluator |
flags.with_plugins | Enables the plugin subsystem |
flags.embed | Embeds data files directly into the binary using C23 #embed |
flags.idle_sleep | Enables sleeping when the application is idle |
Repository Structure: Two project.js Files
ArmorPaint uses twoproject.js files with a clear separation of concerns:
base/project.js — The Engine Layer
Defines the
Base project containing the iron 3D engine, all platform backends, GPU abstraction, and shared libraries. It does not know anything about ArmorPaint-specific features.paint/ directory:
The
get_version_code() function inside project.js generates a numeric version identifier in YYMMDD format derived from the current build date. This value is used for Android versionCode and iOS build/version fields in the generated project files.