Exporter Instructions (written for Stellaris)
Version xx.xx Officially supported for Maya 2015/2016. Errors in use with earlier versions might occur.
Instructions on how to install and use paradox Maya exporter and Photoshop texture assembler. Feel free to comment on hard to understand or missing information in this document.
- Autodesk Maya.
- Adobe Photoshop.
First download the Clausewitz Maya Exporter here: https://accounts.paradoxplaza.com/profile/downloads
The installer will install two things:
- The "Clausewitz Maya Exporter" which exports settings for Autodesk Maya to create .mesh files for the game.
- 2 Photoshop plugins for texture development.
To set up the Maya exporter, follow these steps:
- Run the “PdxExporterInstall.exe” AS ADMINISTRATOR.
- Go through the setup process. --In this guide, when spoken about "C:/Users/YOUR_USER/pdx_exporter/", it is referred to the directory you selected during this process.
- Before clicking finish, make sure you've enabled the "Run Maya Exporter Deploy Wizard".
- Click Finish.
NOTE: The Clausewitz "Maya Exporter Deploy Wizard" unfortunately exports files to your Windows drive, therefore C:/Users/YOUR_USER/Documents/ in this guide, will always refer to YOURWINDOWSDRIVE:/Users/YOUR_USER/Documents/. Even if you setup "My Documents" to be in a different directory or drive. It might be easier to remember that when this guide shows a directory with /Documents/ in it, it will be on your windows drive. When it doesn't, it's in the directory you installed it.
- Run Maya and make the below commands into a shortcut, most easily done by following these instructions:
- Go into your plugin manager (At the top menu in Maya navigate trough Windows > Settings/Preferences > Plug-in Manager) and enable the “pdx_exporter.mll” plugin.
- If it's not there you need to click Browse and search for it, in the directory where you installed PdxExporterInstall.exe to (default C:/Users/YOUR_USER/pdx_exporter/maya/maya_20xx_sdk_x64 (Don't ask me why it doesn't defaultly installed in /documents/ there)). Make sure you've selected the right exporter according to the version of Autodesk Maya you have installed.
- Paste the following in the MEL input area at the bottom of your screen: rehash; source pdx_export_ui.mel; showPdxExport;
- // Error: Line 1.33: Cannot find file "pdx_export_ui.mel" for source statement. -> Just add the directory. (e.g. rehash; source "C:/Users/YOUR_USER/Documents/maya/scripts/pdx_export_ui.mel"; showPdxExport;)
- Select the entire command string that you've just entered in the MEL field, and while pressing the middle mouse button, you can drag the command string to your shelf (top bar, you will notice when there's a [+] sign at your pointer) in Maya.
- Click on "MEL" when it says "Save script to shelf as type:".
- Your game directory will have to be manually assigned before the exporter can be used. By default, the file where this has to be is “C:/Users/YOUR_USER/Documents/Paradox Interactive/PdxExporter/settings/clausewitz.txt”.
- Below to [Terra], edit "s 1" so it points to the root directory of the game folder (X:/Steam/steamapps/common/Stellaris)
- Edit "target_exe s 1" to be pointing at the exe file (X:/Steam/steamapps/common/Stellaris/stellaris.exe)
- (optional) You can change [Terra] to [Stellaris].
- If you did not find this file in the given default directory, you can copy it from the "Clausewitz Maya Exporter" directory (default C:/Users/YOUR_USER/pdx_exporter/) into the right place (C:/Users/YOUR_USER/Documents/Paradox Interactive/PdxExporter/settings/)
- Clicking the exporter on your shelf in Maya should now be possible, but before an object can be exported, we will have to set up the necessary materials using photoshop.
Once you have run the installer, there will be two new plugins under File > Scripts
- TextureExporter (save textures as .TGA, and assembles textures to .dds files to game folder)
- GuiExporter (batch save tool)
The first time you run the script, it will ask you to specify where you have located the games. Locate each games root folder (where the exe is). If you later wish to change the path. The paths are stored in: “Documents\Paradox Interactive\PdxExporter\settings\texture_exporter.txt” . It is advisable to specify not the root game directory, but the home directory of your mod.
- "No document open!" -> You didn't open or create an empty file... (Personally I don't know if there is a recommendation on the dimensions it should have, if you create a new one)
- "Could not read ~/Documents/Paradox Interactive/pdxExporter/settings/texture_exporter.txt" -> (I wish I knew...)
Photoshop texture creation
In Photoshop, you will have multiple layers for each type of texture you want to export. You will need to create at least three layers, named "diffuse", "normal" and "specular". Additionally, you can create a layer for metal, gloss, emissive, opacity and color if you so choose. These layers are commonly referred as "maps". The diffuse map is the usual texture you would expect to see. The normal map use the values of the colours (RGB) as component of vector in space. The specular map is a black/white map where black is "no reflection" and white is "100% reflection" Other maps are used for special effects.
Follow these steps to create the basic maps:
- The diffuse map is probably what you already have.
- Duplicate the layer and apply the built-in Photoshop filter or better you can use the Nvidia plugin (Filter -> Nvidia filters -> create normal maps) . Name the new layer "normal"
- Duplicate the diffuse layer and call it "specular". Create a specular map it's not an easy task, but you can start changing the channel to "blue" and reduce the saturation a little. Merge the filter with the specular layer when it's done.
As stated above, in Photoshop, you must to have at least 3 layers ("diffuse", "normal" and "specular"). You can create and export additional ( metal, gloss, emissive, opacity and color) layers.
- Under the files -> scripts menu you’ll find “texture exporter”.
- Clicking this allows you to export the textures to where you want them using your preferred settings, that is the layers you want to export.
- The output directory should be the “gfx\models” map of your Stellaris mod directory
- Clicking OK will start the export.
The channels of each layer are exported to the following channels in the generated files (Not all channels are exported! See Notes):
|[texturename]_diffuse.dds||DiffuseR||DiffuseG||DiffuseB||OpacityR||OpacityGB are ignored|
|[texturename]_normal.dds||NormalR||NormalR||EmissiveR||NormalG||NormalB is ignored.
EmissiveGB are ignored
|[texturename]_specular.dds||Mask (various)||SpecularB||MetalB||GlossB||ColorRGB are ignored
SpecularRG are ignored.
Gloss RG are ignored.
Forums post by Iarre. link
Diffuse 512x512, DXT1 RGB 4 bpp no alpha.
The normalmap is a little bit special, we have the normalmaps red channel copied to green channel as well, so red and green are the same. The green channel is placed in alpha(before copying).
Blue channel is black.
This is due to normalmaps needing more quality and I wish that "in the future" some normalmaps would be 16 bits.
Texture is saved as DXT5 ARGB 8 bpp interpolated alpha
Specmaps 256x256, DXT5 ARGB 8 bpp interpolated alpha
Red channel is a masking layer for planet city lights or ship country color, or not used.
Green channel is specular.
Blue channel is metalness
Alpha is glossiness
We have quite clean values for these, not a lot of noise. We think it looks best that way with not much noise on the characters.
Exporting in Maya
Only objects with a shader assigned to it, which has the "shader attribute", will be exported. (This is good, since then you can keep other things in your scene, which will not be exported)
After having modeled your object in Maya and having made the materials for it in Photoshop, the following applies:
- Apply a phong shader to your mesh (for instance by right clicking the object and accessing the materials menus).
- Assign your generated diffuse texture to the color slot. Should be named "<asset_name>_diffuse.dds"
- Assign your generated normal texture to the bump slot. Should be named "<asset_name>_normal.dds"
- Assign your generated specular texture to specular color slot. Should be named "<asset_name>_specular.dds"
- Click the exporter in your shelf.
- Select the shader (hypershade tool is a good way to do it) and press “apply shader attr”.
- For the first time you export, make sure the "Create .gfx and .asset" checkbox is ticked. This can be unticked after the first time.
At this point you should be able to enter the game and spawn your created object. The name of your object will be visible through the .asset file created in your models folder and will be the name you’ve chosen for your object when exporting it but with “_entity" added to it. E.g. “name = "test_object_entity".
To check that everything has worked as planned, launch the game and start a single player session as any nation.
- Using the console (§), spawn your object with the command “spawnentity ” + “YOUR_ENTITY_NAME”, e.g. "test_object_entity".
- The object will spawn at your cursor position.