1# pie-addon - Blender Import-Export for .pie file format
2
3**Blender** addon to **import and export** models in the **`.pie`** format, which is used in the game **Warzone 2100**
4
5Created by *John Wharton*
6
7## Installation
8
91. Download the most recent version at **(https://github.com/Warzone2100/warzone2100/tree/master/tools/blender/2.9x)**
102. Install the addon use one of these methods:
11* __Option A__ (automatic):
12    * From the Blender menu, navigate to `Edit -> Preferences -> Add-ons`.
13    * Click on the `Install` button and select the zipped folder containing the addon.
14* __Option B__ (manual):
15    * Extract the zipped files to `pie_addon` directory.
16    * Place the newly made folder into the following location (Adjust for the installed version of Blender):
17        * Windows:\
18            `%APPDATA%\Blender Foundation\Blender\2.9x\scripts\addons`
19        * Linux:\
20            `~/.config/blender/2.9x/scripts/addons`
21        * *(If the addon does not appear as a choice in Blender's preferences click the `Refresh` button or restart the application.)*
223. Activate the addon in Blender's preferences by toggling the checkbox for the `pie_addon` entry in the Add-ons tab.
23
24## Features
25
26The scripts in this addon currently support importing and exporting the following information:
27
28* PIE Type
29* PIE Texture
30* PIE Normal Map
31* PIE Specular Map
32* PIE Events
33* PIE Levels
34    * PIE Points
35    * PIE Polygons*
36        * PIE Textured Polygons
37        * PIE Animated Polygons*
38    * PIE Connectors
39    * PIE Anim Objects*
40    * PIE Shadow Points
41    * PIE Shadow Polygons
42
43*1: N-gons should not be used in exported meshes due to UV corruption. Quads will be triangulated correctly and are acceptable for export from Blender to PIE.
44
45*2: Mesh objects with active modifiers will not export this feature to new faces in the case of mirrored/arrayed geometry.
46
47*3: There may be some cases Blender will not interpret rotation keys in the same manner as the game.
48
49## Usage
50
51This addon adds the following panels to the Scene tab of the properties editor:
52
531. PIE Export
54    * Used for exporting models to the .pie format.
55    * Before exporting, you must select the root object (typically an armature) of the model which you desire to export.
56    * The output file will be located in the system path specified in the `Directory` property, with the name of the file being the name of the root object.
57    * You can export multiple objects at the same time by selecting all of them before executing the export operation.
582. PIE Import
59    * Used for importing .pie models into Blender.
60    * Specify the system path in the `Directory` property and the file name in the `.pie File` property. Be sure to include the file extension `.pie`.
61
62The following panel can be found in the Object tab of the properties editor:
63
64* PIE Object
65    * Objects can be assigned one of these `PIE Object Type` values.
66        1. `None`:
67            * Objects with this type will be ignored when exporting, but they may still be used in the Blender scene to manipulate objects which are eligable for PIE exporting.
68        2. `Root`:
69            * This type is used to define the generic values of a PIE model, such as its rendering flags, textures, and events.
70        3. `Level`:
71            * This type is used to define the mesh and animation properties which are specific to each level such as animation rate/cycles and texture animation data for particular sets of faces. These should always be mesh objects, and also should always be within the heirarchy of a `Root` PIE object.
72        4. `Shadow`:
73            * This type is used to define the shadow of a level. These should always be mesh objects, and should also be parented directly to a `Level` PIE object. The level's `Shadow Type` must be set to `Custom` in order to export PIE shadows.
74        5. `Connector`:
75            * This type is used to define the location of a connector on a level. These should be parented directly to a `Level` PIE object.