Hi, there is some documentation about khafiles here, although it’s not really verbose and somewhat incomplete.
1.
This line specifies where the source code of your project is. It is more or less equivalent to -cp
in Haxe’s .hxml files. For Armory, it’s the place where you normally write your Haxe traits and where the logic node Haxe sources and Main.hx (the game’s entry point) are generated.
You can use addSources()
multiple times in a project, it doesn’t have anything to do with root folders, it’s just a place where the Haxe compiler searches for source files (and Khamake potentially also does some smaller things with that path along the way, I don’t know).
2.
Imagine addLibrary()
as a slightly more specific addSource()
call, it’s basically another folder where Haxe searches for sources, and the particular lines you pasted are for the Armory and Iron source code that your game needs in order to work. addLibrary()
can also be used to reference haxelib libraries for example, although it is rather discouraged by the Kha developer.
3.
project.addAssets()
is used to add assets like images, sounds, fonts, etc. to the compilation. Depending on the target platform, Khamake may decide to convert the assets to file formats better suited for that platform. The specific lines you shared add assets required by some of Armory’s shaders. There should be more addAssets()
calls though in your file, pointing to project-specific assets and files containing information about the exported materials.
4.
The khafile is automatically generated by Armory when you build the game, so you shouldn’t remove or change any existing code from it as it might break your game. However, you can append more code to the end of the file by writing it to a text document inside Blender and then refer to that in Armory Project > Modules > Khafile
.
If you put your assets inside a /Bundled
folder in the project’s root directory, Armory will automatically add references to them in the khafile. Any folders inside of /Libraries
are automatically added as libraries, and folders inside of /Subprojects
are picked up as subprojects (libraries with their own khafile)