/
ReadMe-XPlane2Blender.html
502 lines (462 loc) · 42.9 KB
/
ReadMe-XPlane2Blender.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<meta name="description" content="X-Plane import/export scripts for Blender 3D">
<meta name="keywords" content="X-Plane, simulator, scenery, Blender, Blender3D">
<title>XPlane2Blender</title>
<meta name="author" content="Jonathan Harris">
<style type="text/css">
.banner { font-family: Arial,Helvetica,sans-serif; background-color: lightskyblue; text-align: left; height: 32px; }
.dnl { font-family: Arial,Helvetica,sans-serif; font-size: small; background-color: lightskyblue; }
samp { font-family: Arial,Helvetica,sans-serif; }
h2 { font-family: Arial,Helvetica,sans-serif; }
h3 { font-family: Arial,Helvetica,sans-serif; }
h4 { font-family: Arial,Helvetica,sans-serif; }
h5 { font-family: Arial,Helvetica,sans-serif; }
ul { margin: 0; }
kbd {font-family: sans-serif; color: black; background-color: white; border: 1px solid black; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius: 5px; padding: 1px 1px 0px; }
pre { border: 1px solid; padding: 8px; width: 75%; }
blockquote { font-family: monospace; }
em { font-style:normal; color:FireBrick; }
</style>
</head>
<body>
<table style="width: 100%;" border="0" cellpadding="2">
<tbody>
<tr>
<td class="banner">Marginal → <a href="http://marginal.org.uk/x-planescenery/">X-Plane Scenery</a> → <a href="http://marginal.org.uk/x-planescenery/tools.html">Tools</a> → XPlane2Blender</td>
</tr>
</tbody>
</table>
<hr>
<h1>Scenery & Cockpit import/export scripts for Blender 2.49</h1>
<h2>Overview</h2>
<p><a href="http://www.blender.org/">Blender</a> is an open source 3D object editor for Windows, Mac and UNIX.</p>
<p>These Blender scripts export models created in Blender 2.49 to X-Plane v8, v9, v10 or CSL <code>.obj</code> format.</p>
<p>The scripts also import existing X-Plane v6, v7, v8, v9, v10 and CSL <code>.obj</code> files and X-Plane v7, v8, v9 and v10 <code>.acf</code> airplanes.</p>
<h2>Requirements</h2>
<p>Runs on Windows 2000 or later, Mac OS 10.4 or later, and Linux.</p>
<p>Requires Blender 2.49:</p>
<table style="width: 100%; text-align: left;" border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top; text-align: center;">Windows: </td>
<td>Download and run this <a href="http://download.blender.org/release/Blender2.49b/blender-2.49b-windows.exe">Blender installer</a>. When presented with options, use the default choices.<br>
Some scripts also require you to install <a href="http://www.python.org/ftp/python/2.6.6/python-2.6.6.msi">Python 2.6</a>.<br>
<br>
</td>
</tr>
<tr>
<td style="vertical-align: top; text-align: center;">Mac OS<br>10.5 - 10.8: </td>
<td>Download and open this <a target="_blank" href="http://download.blender.org/release/Blender2.49b/blender-2.49b-OSX-10.5-py2.5-intel.zip">Blender archive</a>.<br>
Copy the <samp>Blender</samp> application out of the archive <i>e.g.</i> to your <code>/Applications</code> folder.<br>
<br>
</td>
</tr>
<tr>
<td style="vertical-align: top; text-align: center;">Mac OS<br>10.4 (Intel): </td>
<td>Download and open this <a target="_blank" href="http://download.blender.org/release/Blender2.49b/blender-2.49b-OSX-10.4-py2.3-intel.zip">Blender archive</a>.<br>
Copy the <samp>Blender</samp> application out of the archive <i>e.g.</i> to your <code>/Applications</code> folder.<br>
<br>
</td>
</tr>
<tr>
<td style="vertical-align: top; text-align: center;">Linux: </td>
<td>If Blender <b>2.49</b> is offered in your distro's package manager then download and install it from there.<br>
Otherwise download for <a href="http://download.blender.org/release/Blender2.49b/blender-2.49b-linux-glibc236-py26-i386.tar.bz2">x86</a> or <a href="http://download.blender.org/release/Blender2.49b/blender-2.49b-linux-glibc236-py26-x86_64.tar.bz2">x86_64</a> and unpack it to <i>e.g.</i> your desktop.<br>
You will also need to obtain a copy of Python <b>2.6</b> for your distro.<br>
</td>
</tr>
</tbody>
</table>
<h2>Tutorials</h2>
<p>This document is a reference and assumes basic familiarity with Blender. You may find it easier to get started using the following tutorials, and come back to this document later:</p>
<ul>
<li><a target="_blank" href="http://marginal.org.uk/x-planescenery/tutorials.html">Using Blender to create X-Plane scenery</a></li>
<li><a target="_blank" href="http://wiki.blender.org/index.php/Doc:2.4/Manual">The Blender Manual</a></li>
</ul>
<h2>Installation</h2>
<p>Run Blender to check that it is installed correctly. If the Blender window appears “blurry” turn off anti-aliasing in your video card's OpenGL settings and re-start Blender.</p>
<p>Now close Blender.</p>
<table style="text-align: left; width: 100%;" border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top; text-align: center;">Windows: <br>
</td>
<td>Extract the contents of this zip file to a new (temporary) folder.<br>
Double-click on the file <code>install.cmd</code> to install the scripts.<br>
<small>(Unless when installing Blender you chose to place your data files in a system-owned location, in which case right-click on <code>install.cmd</code> and choose <samp>Run as administrator</samp> instead).</small><br>
<br>
</td>
</tr>
<tr>
<td style="vertical-align: top; text-align: center;">Mac OS: </td>
<td>Double-click on the file <code>install.command</code> to install the scripts in all compatibile copies of the Blender application that the Finder knows about.<br>
You may be prompted for your password if you installed Blender into a system-owned location such as <code>/Applications</code>.<br>
<br>
</td>
</tr>
<tr>
<td style="vertical-align: top; text-align: center;">Linux:</td>
<td>If you obtained your copy of Blender from your distro's package manager, then extract the contents of this zip file to <code>~/.blender/scripts</code> .<br>
If you downloaded Blender from the links above, then extract the contents of this zip file to the (hidden) folder <code>.blender/scripts</code> within the folder where you unpacked the archive.<br>
</td>
</tr>
</tbody>
</table>
<p>(Re)start Blender. Check that this file can be viewed by choosing <samp>Help → X-Plane</samp> in Blender.</p>
<h2>Importing</h2>
<p>First, move the 3D Cursor to where you want the imported object to be placed. Usually you'll want the object to be placed at the origin so just press <kbd>Shift</kbd> <kbd>C</kbd> to centre the 3D Cursor at the origin.</p>
<h3>Importing X-Plane objects</h3>
<p>Choose <samp>File → Import → X-Plane Object</samp>, select a <code>.obj</code> file and press <samp>Import OBJ</samp>.</p>
<p>You can import multiple <code>.obj</code> files and re-export them as a single file. But note that the X-Plane <code>.obj</code> file format only supports the use of one texture file, so you'll have to create a single larger file containing all required textures - see <a href="#resize">below</a>. Or you can have Blender create this single file automatically by selecting all the objects and, in a <samp>UV/Image Editor</samp> window, choosing <samp>Image → Consolidate into one image</samp>.</p>
<h3>Importing FS9 & FSX models</h3>
<p>Choose <samp>File → Import → FS9/FSX Model</samp>, select a <code>.mdl</code> file and press <samp>Import MDL</samp>.</p>
<p>MSFS models usually use multiple textures, but the X-Plane <code>.obj</code> file format only supports the use of one texture file, so you'll have to create a single larger file containing all required textures - see <a href="#resize">below</a>. Or you can have Blender create this single file automatically by selecting all the objects and, in a <samp>UV/Image Editor</samp> window, choosing <samp>Image → Consolidate into one image</samp>.</p>
<h3>Importing X-Plane planes</h3>
<p>Choose <samp>File → Import → X-Plane Plane or Weapon</samp> and choose whether to import the plane or weapon so that the “reference point” is located at the 3D Cursor (for making cockpit & misc objects) or so that the “centre of gravity” is located at the 3D Cursor (for making CSLs and static scenery).</p>
<p>Then select a <code>.acf</code> or <code>.wpn</code> file and press <samp>Import ACF or WPN</samp>.</p>
<p>The script creates up to three versions of the plane or weapon in Blender, one in each of layers 1, 2 and 3. The versions in layers 2 and 3 use approximately <small><sup>1</sup></small>/<small><sub>10</sub><sup>th</sup></small> and <small><sup>1</sup></small>/<small><sub>100</sub><sup>th</sup></small> of the number of faces compared to the version in layer 1. See <a href="#Level_Of_Detail">Level of Detail</a> below for an explanation of why it does this.</p>
<p>Imported planes need some tweaking before you can export them as scenery or as a CSL object; see <a href="./XPlaneImportPlane.html">Tweaking Planes</a>.</p>
<h2>Exporting</h2>
<p>First, choose <samp>File → Save As…</samp> and save the <code>.blend</code> file in the aircraft or scenery folder where you want the exported object(s) to end up.<p>
<h3>Exporting objects</h3>
<p>Choose <samp>File → Export → X-Plane Object</samp></p>
<p>The object is exported in the same folder and with the same name as the current Blender file, but with a <code>.obj</code> extension. Blender may display some informational messages - click on one of these messages to see which object(s) the message refers to.</p>
<p>If there is an error then the scripts will attempt to identify and highlight the offending Blender object(s).</p>
<h3>Exporting facades</h3>
<p>TBD</p>
<h3>Exporting autogen blocks</h3>
<p>TBD</p>
<h2>Creating X-Plane objects</h2>
<p>X-Plane objects are made using the techniques described below whether the object is intended as a scenery object, an aircraft “Misc” object, an aircraft cockpit object, or a “CSL” object for use with multi-user plugins such as <a href="http://www.xsquawkbox.net/xsb/">XSquawkBox</a> or <a href="http://www.ivao.aero/softdev/X-IvAp/">X-IvAp</a>. Only Lamps and Meshes are exported to X-Plane. You can use other Blender object types, <i>e.g.</i> Curves and Surfaces, to construct your scenery as long as you convert them to meshes before exporting to X-Plane.</p>
<p>Cockpit objects support additional functionality described <a href="./XPlane3DCockpits.html">here</a>, and CSL objects have some limitations described <a href="./XPlaneExportCSL.html">here</a>.
<h3>Textures</h3>
<p>X-Plane objects support only one primary texture; in an image editor application create one texture file that is like a “<a href="http://en.wikipedia.org/wiki/Collage" target="_blank">collage</a>” of all of the textures that you need in your model. The height and width of the texture file must be powers of two <i>e.g.</i> 128, 256, 512, 1024, 2048 (X-Plane v9 only) or 4096 (X-Plane v10 only) but it doesn't have to be square. If you later find that you run out of space in your texture file you can use <a href="#resize">this technique</a> to increase the size.</p>
<p>Export the texture file to 32bit or 24bit PNG format (<i>i.e.</i> with or without an “Alpha” channel) or DXT1, DXT3 or DXT5 DDS format in the aircraft or scenery folder where you want the X-Plane <code>.obj</code> file to end up.</p>
<p>X-Plane objects support a number of secondary textures. These use the same UV mappings as the primary texture:</p>
<dl>
<dt>An emissive map texture to control night-time brightness.</dt>
<dd>Save your emissive texture in the same folder as your primary texture file, and with the same name but with <code>_LIT</code> appended; <i>e.g.</i> <i>primarytexture</i><code>_LIT.png</code> or <i>primarytexture</i><code>_LIT.dds</code>.</dd>
<dt>A normal map texture to control “bumpiness” and shinyness.</dt>
<dd>Save your normal map texture in the format described <a target="_blank" href="http://wiki.blender.org/index.php/Doc:2.4/Manual/Textures/Influence/Material/Bump_and_Normal">here</a> and <a target="_blank" href="http://wiki.x-plane.com/Normal_Maps">here</a> in the same folder as your primary texture file, and with the same name but with <code>_NML</code> appended; <i>e.g.</i> <i>primarytexture</i><code>_NML.png</code>.</dd>
<dt>The cockpit panel texture (aircraft cockpit objects only).</dt>
<dd>Described <a href="./XPlane3DCockpits.html">here</a>.</dd>
</dl>
<h3><a name="lamps">Lamps</a></h3>
<p>Only Lamp objects of type “Lamp” and “Spot” are exported to X-Plane. Lamp objects of types “Area”, “Semi” and “Hemi” are ignored (and so can be used to illuminate your model in Blender). Lamp objects with certain words in their names have special behaviours when exported to an X-Plane object:</p>
<dl>
<dd><code>Lamp</code> - Normal (legacy) light. The colour is determined by the <samp>R</samp>,<samp>G</samp>,<samp>B</samp> sliders on the <samp>Lamp</samp> panel <kbd>F5</kbd>.</dd>
<dd><code>Flash</code> - Flashing (legacy) light. The colour is determined by the <samp>R</samp>,<samp>G</samp>,<samp>B</samp> sliders on the <samp>Lamp</samp> panel <kbd>F5</kbd>.</dd>
<dd><code>Traffic</code> - Traffic (legacy) light; cycles red, orange, green. (R,G,B settings are ignored).</dd>
<dd><code>smoke_black</code> or <code>smoke_white</code> - Not really a light; emits smoke. The size of the smoke puffs is determined by the Energy slider on the <samp>Lamp</samp> panel <kbd>F5</kbd> (R,G,B settings are ignored).</dd>
<dd><i>other</i> - X-Plane pre-defined “named” or “parameterized” light:
<ul>
<li>The name of the X-Plane light is taken from the value of a <a href="#properties">property</a> named <code>name</code> if this exists, otherwise from the name of the lamp object.</li>
<li>Additional parameters are taken from the value of a <a href="#properties">property</a> named <code>params</code>.</li>
<li>R,G,B settings are ignored.</li>
</ul>
</dd>
</dl>
<p>Custom lights are created using the vertices from a rectangular “Plane” Mesh object:</p>
<ul>
<li>In the <samp>Material buttons</samp> panels <kbd>F5</kbd>:
<ul>
<li>On the <samp>Links and Pipeline</samp> panel press <samp>Add New</samp> to create a new material, or choose an existing material (if any) from the drop-down list.<br>
Press the <samp>Halo</samp> button on this panel.</li>
<li>On the <samp>Material</samp> panel the <samp>Halo</samp> button and the <samp>R</samp>,<samp>G</samp>,<samp>B</samp>,<samp>A</samp> sliders control the light's R,G,B and A values.<br>
Alternatively you can create <a href="#properties">properties</a> named <code>R</code>, <code>G</code>, <code>B</code> and/or <code>A</code> to set these values.</li>
<li>On the <samp>Shaders</samp> panel the <samp>HaloSize</samp> slider controls the light's S value.<br>
Press the <samp>HaloTex</samp> button in this panel to make Blender render the light correctly.</li>
</ul>
</li>
<li>In the <samp>Texture buttons</samp> panels <kbd>F6</kbd>:
<ul>
<li>On the <samp>Texture</samp> panel press <samp>Add New</samp> to create a new texture for the mesh, or choose an existing texture (if any) from the drop-down list. You should use just one texture.<br>
Change the <samp>Texture Type</samp> to <samp>Image</samp>.</li>
<li>On the <samp>Image</samp> panel load the texture file that contains the light that you want to use.</li>
<li>On the <samp>Map Image</samp> panel press the <samp>UseAlpha</samp> button.<br>
Use the <samp>MinX</samp>, <samp>MinX</samp>, <samp>MaxX</samp>, <samp>MaxY</samp> settings to select a subset of the texture.</li>
</ul>
</li>
<li>To drive the custom light using a dataref add a String <a href="#properties">property</a> named <code>name</code>.</li>
</ul>
<p>Spill lights (X-Plane v10 only) are created using Lamp objects of type “Spot”:</p>
<ul>
<li>In the <samp>Lamp buttons</samp> panels <kbd>F5</kbd>:
<ul>
<li>On the <samp>Preview</samp> panel press the <samp>Spot</samp> button.</li>
<li>On the <samp>Lamp</samp> panel the <samp>Energy</samp>,<samp>R</samp>,<samp>G</samp>,<samp>B</samp> sliders control the light's intensity and R,G,B values, and the <samp>Dist</samp> slider controls the light cone's length.</li>
<li>On the <samp>Shadow and Spot</samp> panel the <samp>SpotSi</samp> slider controls the light cone's width.</li>
</ul>
</li>
<li>Rotate the Lamp object to change the light cone's direction.</li>
<li>To drive the spill light using a dataref add a String <a href="#properties">property</a> named <code>dataref</code>.</li>
</ul>
<h3><a name="Meshes"></a>Meshes</h3>
<p>Create meshes consisting of triangular and/or rectangular faces:</p>
<ul>
<li>In the <samp>Mesh</samp> Editing panel <kbd>F9</kbd>:
<ul>
<li>Press the <samp>New</samp> UV Texture button once (X-Plane objects support only one primary texture).</li>
<li>Use the <samp>UV/Image Editor</samp> window to open this texture and control mapping of the texture to the mesh faces.</li>
</ul>
</li>
<li>In the <samp>Texture Face</samp> Editing panel <kbd>F9</kbd> available in <samp>Edit Mode</samp>:
<ul>
<li><samp>Tex</samp> button controls whether the face has a texture.</li>
<li><samp>Tiles</samp> button controls whether the face is rendered with “polygon offsetting” (<code>ATTR_poly_os</code>) in X-Plane. Press this button for faces that lie flat on the ground to prevent Z-buffer thrashing in X-Plane. Don't press this button for other faces.
<li><samp>Collision</samp> button indicates that the face is <u>not</u> “hard” (ie not “landable on”) in X-Plane. Making faces hard is very expensive, so this button should normally be pressed. Unpress this button only for things like helicopter landing pads.<br>
You can control whether it is possible to fly under this hard face in X-Plane v9 and later; add a Bool <a href="#properties">property</a> named <code>deck</code> and give it the value <code>True</code>.<br>
You can specify the surface type; add a String <a href="#properties">property</a> named <code>surface</code> and give it the value<code> water</code>, <code>concrete</code>, <code>asphalt</code>, <code>grass</code>, <code>dirt</code>, <code>gravel</code>, <code>lakebed</code>, <code>snow</code>, <code>shoulder</code> or <code>blastpad</code>.</li>
<li><samp>Twoside</samp> button controls whether one or both sides of the face are displayed. Unless you have a lot of double-sided faces it is cheaper to avoid this button and to use two single-sided faces back-to-back instead.</li>
<li><samp>Alpha</samp> button is a hint to Blender and to X-Plane that the face is transparent or translucent. Use this for outwards-facing transparent or translucent faces to instruct X-Plane to draw these faces last so that you can see other faces through them. Don't press this button for opaque (normal) faces.<br>
See <a href="#order">drawing order</a> for more fine-grained control over drawing order.</li>
</ul>
</li>
<li>In the <samp>Link and Materials</samp> Editing panel <kbd>F9</kbd> available in <samp>Edit Mode</samp>:
<ul>
<li><samp>Set Smooth</samp> and <samp>Set Solid</samp> control whether to smooth edges of faces in a mesh. The effect is only visible in Blender <samp>3D View</samp> windows when the <samp>Viewport Shading</samp> button is set to <samp>Solid</samp> or <samp>Shaded</samp>, but the effect is always visible in X-Plane.<br>
In <samp>Object Mode</samp> these buttons affect the entire mesh. In <samp>Edit Mode</samp> these buttons affect the selected face(s).<br>
You can add an <samp>EdgeSplit</samp> modifier in the <samp>Modifiers</samp> Editing panel <kbd>F9</kbd> to get Blender to automatically sharpen edges on a smoothed mesh based on the angle between faces.</li>
</ul>
</li>
<li>In the <samp>Material buttons</samp> panels <kbd>F5</kbd> you can change the way that the mesh reacts to light by specifying a material. Changing between materials in X-Plane is expensive so you should ensure that you use at most a few materials in your model.<br>
Press <samp>Add New</samp> to create a new material, or choose an existing material (if any) from the drop-down list.<br>
Only a few of Blender's many material buttons affect X-Plane:
<ul>
<li>On the <samp>Material</samp> panel the <samp>Col</samp> button and the <samp>R</samp>,<samp>G</samp>,<samp>B</samp> sliders control the diffuse colour of the faces. X-Plane combines the colours that are specified by the texture (if any) with this setting.<br>
The default X-Plane setting is <code>1</code>, <code>1</code>, <code>1</code> (white). However the default setting of a new material in Blender is <code>0.8</code>, <code>0.8</code>, <code>0.8</code>.<br>
You should normally set this to <code>1</code>, <code>1</code>, <code>1</code> and control the diffuse colour of the faces by editing the texture file instead.</li>
<li>On the <samp>Shaders</samp> panel the <samp>Spec</samp> slider controls the specularity (shininess) of the faces.<br>
The default X-Plane setting is 0 (matt). However the default setting of a new material in Blender is 0.5.</li>
<li>On the <samp>Shaders</samp> panel the <samp>Emit</samp> slider controls the emissive brightness of the faces. Emissive faces give off light so the effects of this setting are most obvious at night. It is usually cheaper and easy to use <code>_LIT</code> textures to control night-time brightness instead of using this setting. However using this setting allows you to create faces that also give off light during the daytime, <i>e.g.</i> on overcast days, which <code>_LIT</code> textures do not.<br>
The default X-Plane and Blender setting is 0 (not emissive).<br>
On the <samp>Material</samp> panel <samp>Mir</samp> button and the <samp>R</samp>,<samp>G</samp>,<samp>B</samp> sliders control the emissive colour of the faces.</li>
</ul>
</li>
</ul>
<p>Use <a href="http://marginal.org.uk/x-planescenery/normalise.txt">this</a> script if you need to reset all faces in the scene to standard settings <small>(<i>i.e.</i> no polygon offsetting, not hard, single sided, not transparent)</small>.</p>
<p>You can add “modifiers” in the <samp>Modifiers</samp> Editing panel <kbd>F9</kbd> to change the way that the Mesh appers. Some useful modifiers when modelling for X-Plane are:</p>
<ul>
<li><samp>EdgeSplit</samp> - automatically sharpen edges between mesh faces <small>(this only has an effect if you've used the <samp>Set Smooth</samp> button)</small>.</li>
<li><samp>Subsurf</samp> - produce a more detailed version of the mesh by subdividing faces.</li>
<li><samp>Curve</samp> - bend the mesh along a curved path.</li>
</ul>
<h3><a name="animation">Animation</a></h3>
<p>You can make lamps, meshes and lines animate in X-Plane according to the value of any of the simulator datarefs
listed <a href="http://www.xsquawkbox.net/xpsdk/docs/DataRefs.html">here</a> that have type “int”, “float” or “double”.</p>
<h4><a name="basic_animation">Basic animation</a></h4>
<p>Create an “Armature” object. Make the lamps and/or meshes that you want to animate the children of the armature's “bone”:</p>
<ul>
<li>Click on the lamps and/or meshes (the “children”)</li>
<li>Shift-click on the armature</li>
<li><b>Choose <samp>Pose Mode</samp> from the Mode menu in the <samp>3D View</samp> window's toolbar</b></li>
<li>Click on the bone (the “parent”)</li>
<li>Press <kbd>Ctrl</kbd> <kbd>P</kbd> and select <samp>Bone</samp> from the popup menu</li>
</ul>
<p>Once you have assigned a parent bone to your lamps/meshes, you can specify the simulator <a href="http://www.xsquawkbox.net/xpsdk/docs/DataRefs.html">dataref</a> that will drive the animation:</p>
<ul>
<li>Choose <samp>Object Mode</samp> from the Mode menu in the <samp>3D View</samp> window's toolbar</li>
<li>Select the child lamp or mesh</li>
<li>From the <samp>3D View</samp> window's menubar choose <samp>Object → Scripts → X-Plane Animation</samp></li>
<li>In the <samp>Parent Bone</samp> panel, use the pop-up menu to select the <a href="http://www.xsquawkbox.net/xpsdk/docs/DataRefs.html">dataref</a><br>
<small>(or you can type in just the “leaf” name of the dataref into the text field, or the full name of a custom dataref)</small>
<li>Some datarefs require you to specify a “Part number”;<br> <i>e.g.</i> the dataref <code>sim/flightmodel/engine/ENGN_thro</code> represents the engine throttle settings, so you need to specify which engine you're referring to. Press the <samp>Part number</samp> button and specify <code>0</code> for the first engine, <code>1</code> for the second engine etc.</li>
<li>Press the <samp>Apply</samp> button
</ul>
<p>Use frames to represent the desired position of the lamps/meshes at various dataref values - X-Plane will <a href="http://en.wikipedia.org/wiki/Linear_interpolation">interpolate</a> linearly between the positions:</p>
<ul>
<li>In the Animation Frame field, in the <samp>Buttons</samp> window's menubar, select frame 1</li>
<li>Click on the armature</li>
<li>Choose <samp>Pose Mode</samp> from the Mode menu in the <samp>3D View</samp> window's toolbar</li>
<li>Click on a bone</li>
<li>Move and/or rotate the bone</li>
<li>Press <kbd> i </kbd> and specify a <samp>LocRot</samp> key (<i>i.e.</i> location and rotation)</li>
<li>Repeat for any other bones in the armature</li>
<li>Select animation frame 2 and repeat</li>
</ul>
<p><small>(Note: X-Plane's animation syntax is quite simple; so don't use IPOcurves, Vertex Groups, Deformations, Shape Keys or any other advanced Blender animation techniques since these will be ignored by the exporter - only the positions specified by keys in the first <i>n</i> frames are significant to X-Plane.)</small></p>
<p>X-Plane v8 only supports two frames, so if you want your <code>.obj</code> file to work in X-Plane v8 then you
should insert “LocRot” keys only in frames 1 and 2.</p>
<p> X-Plane v9 and later supports multiple key frames. Also, X-Plane will <a href="http://en.wikipedia.org/wiki/Extrapolation">extrapolate</a> your animation when the dataref has a value outside of the range that you specified in the <samp>Frame #<i>n</i></samp> fields.
You can stop the extrapolation and “clamp” your animation's position by repeating the poses and <samp>Frame #<i>n</i></samp> values in the first two and/or the last two frames. Or you can cause your animation to loop back to frame 1 when the dataref value exceeds a certain number by specifying this number in the <samp>Loop</samp> field.</p>
<p>The X-Plane Animation dialog renames the parent bone to the “leaf” name of the dataref. So pressing the <samp>Draw Names</samp> button in the <samp>Armature</samp> panel can be helpful to see what's going on when you have lots of animations.</p>
<p>Use the <samp>Action Editor</samp> window to get an overview of which bones in the selected armature have keys inserted into which frames.</p>
<h4>Controlling animation response to dataref values</h4>
<p>By default, X-Plane will display the meshes in the frame 1 position when the dataref has a value of 0, and in the last frame position when the dataref has a value of 1. You can change these values:</p>
<ul>
<li>Choose <samp>Object Mode</samp> from the Mode menu in the <samp>3D View</samp> window's toolbar</li>
<li>Select the child lamp or mesh</li>
<li>From the <samp>3D View</samp> window's menubar choose <samp>Object → Scripts → X-Plane Animation</samp></li>
<li>Specify in the <samp>Frame #<i>n</i></samp> fields the dataref values that correspend to each frame;<br>
<i>e.g.</i> the yoke pitch dataref <code>yolk_pitch_ratio</code> takes values between -1 (forward) and +1 (back) in X-Plane. So, to make X-Plane display the position in frame 1 when the yoke is pushed fully forward specify <code>-1</code> in the <samp>Frame #1</samp> field</li>
<li>Press the <samp>Apply</samp> button
</ul>
<h4>Using multiple datarefs</h4>
<p>You can animate your lamps/meshes using multiple bones, each bone representing a different dataref:</p>
<ul>
<li>In <samp>Edit Mode</samp> add additional bones to the armature.</li>
<li>Still in Edit Mode, in the <samp>Armature Bones</samp> panel, create parent/child relationships between each bone.
<small>(Note: This panel also lets you rename bones. Don't do this - use the X-Plane Animation dialog to name the bones after the datarefs that they represent).</small></li>
<li>Use the technique described <a href="#basic_animation">above</a> to make your lamps/meshes the children of the “youngest” bone in the chain.</li>
<li>Insert <samp>LocRot</samp> keys for every bone in the chain (each bone can have a different number of keys).</li>
</ul>
<p>The X-Plane Animation dialog displays the settings for the lamp/mesh's parent bone, gandparent bone etc. <small>(Note: Don't change the parent/child relationships between your lamps/meshes and their parent bones while the X-Plane Animation dialog is being displayed).</small></p>
<h4>Hiding lamps and meshes</h4>
<p>You can make all of the lamps and meshes in an animation disappear when a dataref is within a certain range:</p>
<ul>
<li>Use the technique described <a href="#basic_animation">above</a> to make your lamps/meshes the children of an armature bone<br>
<small>(If you don't want to animate your lamps/meshes then don't insert any animation keys for this bone, and the bone doesn't have to be a valid dataref)</small></li>
<li>Choose <samp>Object Mode</samp> from the Mode menu in the <samp>3D View</samp> window's toolbar</li>
<li>Select a lamp or mesh that you want to hide</li>
<li>From the <samp>3D View</samp> window's menubar choose <samp>Object → Scripts → X-Plane Animation</samp></li>
<li>In the last panel, press the <samp>Add New</samp> button</li>
<li>Specify the dataref and the range of values (it's OK to use datarefs that are not otherwise used in the animation)</li>
</ul>
<p>You can make hidden lamps/meshes re-appear when a dataref value is within a certain range by adding another entry, and changing the type from <samp>Hide</samp> to <samp>Show</samp>. The dataref that you use to “show” the animation can be the same or different than the datarefs that you used to “hide” the animation. (The animation is always shown by default, so you only need to use a Show entry if you have used one or more Hide entries and you want to override them).</p>
<p>The order of Hide and Show entries is significant; the animation will be hidden if any of the Hide dataref values are in range, unless a subsequent Show dataref value is also in range. You can use the Up and Down arrow buttons to change the order of the entries.</p>
<p>Note that the Hide and Show entries apply to all children of all bones in the armature. You can make an armature the child of a bone in a different armature; in which case all children are affected by any Hide and Show entries in parent armatures.</p>
<h3><a name="order">Drawing order</a></h3>
<p>The order in which X-Plane draws the animations, lights, lines and triangles in your scenery or cockpit object usually has no effect on the appearance. So the exporter optimises the order of animations, lights, lines and triangles in your object to minimise the number of OpenGL state changes and therefore maximise X-Plane's framerate.</p>
<p>However drawing order does become important if you use transparent and/or translucent textures on some of your faces - transparent and translucent faces must be drawn last, otherwise other faces and lights will not be visible through them.
You should therefore tell Blender which faces are transparent/translucent using the <samp>Alpha</samp> button in the <samp>Texture Face</samp> Editing panel <kbd>F9</kbd> in <samp>UV Face Select</samp> mode. The exporter will ensure that X-Plane
draws these faces last.</p>
<p>But sometimes you need even more control over the drawing order - <i>e.g.</i> modelling a cockpit with a transparent HUD and (obviously) a transparent canopy; the HUD must be drawn after the canopy.</p>
<p>You can specify the relative order in which lamps, meshes etc should be drawn by assigning them to “Groups” on the <samp>Object and links</samp> panel <kbd>F7</kbd>:</p>
<ul>
<li>Objects that don't belong to a group are drawn first.</li>
<li>The groups are sorted by alphabetical order, and then
<ul>
<li>objects that belong to the first group are drawn next.<br>
…</li>
<li>objects that belong to the last group are drawn last.</li>
</ul>
</li>
</ul>
<p><i>e.g.</i> in the case of the cockpit with transparent canopy and HUD, we could put the canopy and HUD into separate groups named <code>GroupA</code> and <code>GroupB</code> respectively. Since <code>A</code> is before <code>B</code> in the alphabet, the canopy would be drawn before the HUD (and both would be drawn after the rest of the cockpit).</p>
<p>To add objects to a new group:</p>
<ul>
<li>Select the meshes that you want to be drawn late.</li>
<li>Press the <samp>Add to Group</samp> button on the <samp>Object and links</samp> panel <kbd>F7</kbd> (or press <kbd>Ctrl</kbd> <kbd>G</kbd>).</li>
<li>Choose <samp>ADD NEW</samp>.</li>
<li>Give the new group a name.</li>
</ul>
<p>Objects that belong to a group are highlighted in green instead of pink so that you can easily distinguish them.</p>
<h3><a name="group">Drawing group</a></h3>
<p>You can specify when X-Plane should draw your scenery object relative to other scenery elements:</p>
<ul>
<li>Add a Blender object of type “Empty” to your scene.</li>
<li>Add a <a href="#properties">property</a> to the Empty object named <code>group_terrain</code>, <code>group_beaches</code>, <code>group_shoulders</code>, <code>group_taxiways</code>, <code>group_runways</code>, <code>group_markings</code>, <code>group_airports</code>, <code>group_roads</code>, <code>group_objects</code>, <code>group_light_objects</code> or <code>group_cars</code>.</li>
<li>Give the property a value between <code>-1</code> and <code>-5</code> to make X-Plane draw your object before this group, <code>0</code> to draw your object with this group, or between <code>1</code> and <code>5</code> to draw your object after this group.</li>
</ul>
<p><i>e.g.</i> to make X-Plane draw your object at the same time that it draws runway markings add a property named <code>group_markings</code> to an Empty object and give it the value <code>0</code>.</p>
<h3>Slung load weight</h3>
<p>You can specify the weight of an object for use in X-Plane's physics engine if the object is being carried by a plane or helicopter:</p>
<ul>
<li>Add a Blender object of type “Empty” to your scene.</li>
<li>Add a <a href="#properties">property</a> to the Empty object named <code>slung_load_weight</code> and specify the weight in pounds.</li>
</ul>
<h3><a name="Level_Of_Detail"></a>Level Of Detail</h3>
<p>X-Plane has borrowed the concept of <a href="http://en.wikipedia.org/wiki/Level_of_detail">Level Of Detail</a> from 3D games. This works on the principle that when you're viewing an object from a large distance it can be displayed with reduced detail without you noticing the difference. By displaying distant objects with reduced detail we can simulate a more complex scene than would be possible if all objects were drawn at maximum detail.</p>
<p>Use Layers to create objects (but not aircraft cockpit objects or, prior to X-Plane 10, Misc objects) with multiple Levels Of Detail. Objects in layers 1-3 are visible in X-Plane at the following distances:</p>
<div style="margin-left: 40px;">
<table style="text-align: left;" border="0">
<thead>
<tr>
<th style="text-decoration: underline;">Layer</th>
<th></th>
<th style="text-decoration: underline;">Distance</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;">1</td>
<td></td>
<td>< 1000m</td>
</tr>
<tr>
<td style="text-align: center;">2</td>
<td></td>
<td>1000-4000m</td>
</tr>
<tr>
<td style="text-align: center;">3</td>
<td></td>
<td>4000m-10000m</td>
</tr>
</tbody>
</table>
</div>
<h3><a name="resize">Changing the texture size</a></h3>
<p>If you run out of space in your texture file then you can increase the size. You should use the following procedure to ensure that your UV mappings and/or PlaneMaker instrument layouts are preserved:</p>
<p>
<ul>
<li>Create a new, larger, texture in an image editor application.</li>
<li>Panel texture: Paste the original texture into the lower left corner of the new texture.</li>
<li>Non-panel texture: Paste the original texture into one of the corners of the new texture, or aligned on a multiple of the original texture's width and height.</li>
<li>In Blender, in the <samp>UV/Image Editor</samp> window, select the original texture from the pop-up menu.</li>
<li>Choose <samp>Image → Replace and fixup UV mapping…</samp></li>
<li>Select the new image and press <samp>Replace image</samp>.
<li>In the <samp>Fixup UV mapping</samp> dialog, press the button in the cluster of buttons that represents where you placed the original texture in the new texture.</li>
</ul>
<p>You can also use this technique if you want to combine 3D models that use different texture files; paste all of the textures used by the 3D models into a single new texture file, then use <samp>Image → Replace and fixup UV mapping…</samp> on each of the original textures.</p>
<h3>Blender tips</h3>
<h4>Auto-saving</h4>
<p>Blender can automatically archive old copies of your <code>.blend</code> files when you save. This is useful if you later want to revert to an older version. In the <samp>User Preferences</samp> window, on the <samp>Auto Save</samp> tab, choose the number of <samp>Save Versions</samp>. The older versions of your file will be called <code>.blend1</code>, <code>.blend2</code> etc.</p>
<p>Blender can also periodically save a copy of your work in case Blender or your computer crashes, or in case you quit Blender without saving. On the <samp>Auto Save</samp> tab press <samp>Auto Save Temp Files</samp>. Also, on the <samp>File Paths</samp> tab, ensure that <samp>Temp</samp> is set to a folder that exists on your machine. This is where the auto-saved files will be created. (The default value of <code>/tmp</code> is fine for Mac and Linux, but <code>/tmp</code> doesn't exist on most Windows machines so you should change this setting).</p>
<h4><a name="properties">Properties</a></h4>
<p>“Properties” are used to specify <a href="#animation">animation</a> parameters, <a href="#lamps">“named” lights</a> and the <a href="#group">drawing group</a>. You can see an object's properties by selecting it and pressing <kbd>F4</kbd> to display the <samp>Logic</samp> panel. Press the <samp>Add Property</samp> to create a new property.</p>
<p>Each property has three fields; Type, Name and Value. If you want to supply a non-numeric value, <i>e.g.</i> the name of a “named” light, you'll first need to change the Type from <samp>Float</samp> to <samp>String</samp>.</p>
<h3>Limitations</h3>
<h4>Import object</h4>
<ul>
<li><code>smoke_black</code> and <code>smoke_white</code> X-Plane primitives are ignored.</li>
<li><code>ambient</code>, <code>blend</code> and <code>specular</code> attributes are ignored.</li>
<li>The importer usually can't work out which faces are partially or wholly transparent. You should tell Blender which faces are transparent using the <samp>Alpha</samp> button in <samp>UV Face Select</samp> mode after import.</li>
</ul>
<h4>Import plane</h4>
<ul>
<li>Wings are simplified to reduce polygon count. Any wing curvature <small>(<i>ie</i> the <samp>customize
chords</samp> option in PlaneMaker)</small> is ignored.</li>
<li>Adjacent wing segments may not be exactly joined-up. If not corrected manually this can create shadow effects in
XSquawkBox and X-IvAp.</li>
<li>Cockpit objects are ignored. You can use <samp>File → Import → X-Plane Object</samp>
to import cockpits.</li>
<li>Planes (and their weapons, misc objects and cockpit objects) use multiple texture files. These are not automagically merged into one file during the import.</li>
<li>The importer can't work out which faces are partially or wholly transparent. You should tell Blender which faces are transparent by pressing the <samp>Alpha</samp> button in <samp>UV Face Select</samp> mode after import.</li>
<li>LOD algorithm can be insufficiently aggressive in layer 2.</li>
</ul>
<h3>Problems</h3>
<p>Please email any questions, problems etc to the
<a href="mailto:Jonathan Harris <x-plane@marginal.org.uk>">author</a>.
If reporting a problem, please:</p>
<ul>
<li>First, check that you are using the
<a href="http://marginal.org.uk/x-planescenery/tools.html">latest</a>
version of the scripts.</li>
<li>Try to send me the the <code>.obj</code>, <code>.acf</code>
or <code>.blend</code> file (where relevant) and the
contents of the Console window. <small>(In Mac OS X, this is the
"Console" program. In Windows this the window titled "Blender" that
looks like a Command Prompt).</small></li>
</ul>
<h3>Acknowledgements</h3>
<p>“X-Plane” is a registered trademark of <a href="http://www.x-plane.com/">Laminar Research</a>.</p>
<p>Includes code © Ben Supnik 2012-2013, © Ben Russell 2010 and © Mike G 2010.</p>
<h3>License</h3>
<p>These tools are licensed under the GNU <a rel="license" target="_blank" href="http://www.gnu.org/licenses/gpl-2.0-standalone.html">GPL v2.0</a> license.</p>
<p>Use of these tools does not impose any requirement on you to license your work under the GPL. For the avoidance of doubt, this means that you can license any scenery that you make using these tools under commercial terms (subject to any licensing restrictions on any imported or library objects that you use).</p>
<p>The author would appreciate a courtesy copy of any commercial work that you make using these tools, but you are under no obligation.</p>
<hr>
<table style="width: 100%;" border="0" cellpadding="2">
<tbody>
<tr>
<td class="banner">Version 3.11 © 2004-2013 <a href="mailto:Jonathan Harris <x-plane@marginal.org.uk>">Jonathan Harris</a>
<a rel="license" target="_blank" href="http://www.gnu.org/licenses/gpl-2.0-standalone.html"><img style="border: 0px solid ; width: 88px; height: 62px; vertical-align: middle;" src="http://i.creativecommons.org/l/GPL/2.0/88x62.png" alt="GPLv2.0"></a></td>
</tr>
</tbody>
</table>
</body>
</html>