Skip to content

Commit

Permalink
Merge branch 'v3-4' into 267-clean-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
tngreene committed Aug 29, 2017
2 parents b684720 + e4f7820 commit ac5c05f
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 19 deletions.
46 changes: 33 additions & 13 deletions README.md
@@ -1,24 +1,44 @@
[![Build Status](https://travis-ci.org/der-On/XPlane2Blender.svg?branch=v3-3)](https://travis-ci.org/der-On/XPlane2Blender)

This addon for Blender 2.6x makes it possible to export Objects to the X-Plane object format (.obj).
# Introduction
This addon for Blender 2.72 and up makes it possible to export models made in Blender to the X-Plane object format (.obj). Despite the name "XPlane2Blender", there is no import feature.

## General Requirements
- Blender 2.72 or higher
- XPlane2Blender 3.3.10 or higher

Requirements:
-------------
People wishing to develop the plugin should the tutorial on Plugin Development in the manual.

- Blender 2.69 or higher
- Python 3.1 or higher
## Automatic Installation
**Note: This process will override an existing copy of the plugin!** This is probably what you want anyway, however, just in case you want, write down or copy the previous version of the plugin.

1. Download the latest **non-pre-release** ``.zip`` version of the plugin from the [releases page](https://github.com/der-On/XPlane2Blender/releases). Look for files that don't have ``-alpha``, ``-beta``, ``-rc`` in the name, such as ``io_xplane2blender_3_4_0+20170828124634.zip``. Do **NOT** unzip the file
2. In Blender, open up the User Preferences, go to the Addons tab, and click at the bottom "Install From File..."
3. Using the file picker, find the .zip file and click "Install From File...". This will automatically unzip to the addons folder, and enable it.
4. Restart Blender even if you see the UI change and begin using XPlane2Blender!

How to use:
-----------
Make backups of your work. Newer versions may have introduced backwards compatibility issues. Check the release notes between your current version (if you have one) and the version you're downloading for details.

All documentation is located here: https://github.com/der-On/XPlane2Blender/wiki/docs-3.2x-main
For a more detailed installation guide including, including manual installation, please read the [manual](https://der-on.gitbooks.io/xplane2blender-docs/content/v3.4/34_installation.html).

## Documentation Sources
Be aware, documentation for XPlane2Blender may not be up to date. **This is being worked on heavily because someone told us it was important to them!** Lessons learned: Read with an eye on dates published and version numbers, ask the devs for help, and tell us what you need! __We do reply back eventually.__

Run Tests:
----------
- [XPlane2Blender Manual](https://der-on.gitbooks.io/xplane2blender-docs/content/)
- [Dan Klaue's "Using Blender With PlaneMaker" Playlist](https://www.youtube.com/playlist?list=PLDB0F4B925CF9169C)
- [X-Plane Scenery File Formats](http://developer.x-plane.com/docs/specs/)
- [X-Plane.org's 3d Modeling board](https://forums.x-plane.org/index.php?/forums/forum/45-3d-modeling/)
- [X-Plane Scenery Developer Blog/Knowledge Base](http://developer.x-plane.com/)
- [X-Plane Modeling Tutorials](http://developer.x-plane.com/docs/modeling/)

```bash
$ python tests.py
```
## Contact Us
The best way to contact us is through [a bug report](https://github.com/der-On/XPlane2Blender/issues). Otherwise, e-mail ted at x-plane dot com, especially if you're worried about the security of your payware models while debugging them.

## Test Suite
**The average user does not need the test suite.** Before releasing a build to the public we test the code many many many times! This is only useful for developers and power user who make changes to the source code.

If you have Python installed (hopefully matching Blender's internal interpreter for maximum stability) and the **full source code** downloaded, you can run the test suite. It will attempt to export sample .blend files that utilize various features of the exporter and print the results (see the contents of the ``test`` folder). All passing means XPlane2Blender is safe to use. In the XPlane2Blender folder, open up a command line and run

``python tests.py --print-fails``

This will run all tests until the end or a failure occurs. Only detailed logs will be printed for the failed test. See ``--help`` to show all flags and what they do.
4 changes: 2 additions & 2 deletions io_xplane2blender/xplane_types/xplane_file.py
Expand Up @@ -430,7 +430,7 @@ def writeFooter(self):
else:
build = bpy.app.build_revision

return "# Build with Blender %s (build %s) Exported with XPlane2Blender %d.%d.%d" % (bpy.app.version_string,build, version[0], version[1], version[2])
return "# Build with Blender %s (build %s) Exported with XPlane2Blender %d.%d.%d.beta.3" % (bpy.app.version_string,build, version[0], version[1], version[2])

# Method: write
# Returns OBJ file code
Expand Down Expand Up @@ -458,7 +458,7 @@ def write(self):
# retrieve reference materials
# and compare all materials against reference materials
if self.options.autodetectTextures == False:
logger.info('Autodetect textures overriden for file %s: not fully checking manually entered textures against Blender-based reference materials\' textures' % (self.filename))
logger.info('Autodetect textures overridden for file %s: not fully checking manually entered textures against Blender-based reference materials\' textures' % (self.filename))

if not self.compareMaterials(self.referenceMaterials):
return ''
Expand Down
6 changes: 3 additions & 3 deletions io_xplane2blender/xplane_types/xplane_material_utils.py
Expand Up @@ -14,7 +14,7 @@ def compare(refMat, mat, exportType, autodetectTextures):
elif exportType == EXPORT_TYPE_INSTANCED_SCENERY:
return compareInstanced(refMat, mat, autodetectTextures)
elif exportType == EXPORT_TYPE_COCKPIT or exportType == EXPORT_TYPE_AIRCRAFT:
return compareAircraft(refMat, mat)
return compareAircraft(refMat, mat, autodetectTextures)

def compareScenery(refMat, mat, autodetectTextures):
errors = []
Expand Down Expand Up @@ -67,11 +67,11 @@ def compareInstanced(refMat, mat, autodetectTextures):

return errors

def compareAircraft(refMat, mat):
def compareAircraft(refMat, mat, autodetectTextures):
errors = []
if mat.options.draw:
# panel parts can have anything
if not mat.options.panel and not refMat.options.panel:
if not mat.options.panel and not refMat.options.panel and autodetectTextures:
if mat.texture != refMat.texture:
errors.append('Texture must be "%s".' % refMat.texture)

Expand Down
2 changes: 1 addition & 1 deletion io_xplane2blender/xplane_updater.py
Expand Up @@ -70,7 +70,7 @@ def update(fromVersion):
for arm in bpy.data.armatures:
for bone in arm.bones:
#Thanks to Python's duck typing and Blender's PointerProperties, this works
__upgradeLocRot(bone)
__updateLocRot(bone)

for object in bpy.data.objects:
__updateLocRot(object)
Expand Down
Binary file not shown.
22 changes: 22 additions & 0 deletions tests/features/autodetect/autodetect_textures_5.test.py
@@ -0,0 +1,22 @@
import bpy
import os
import sys
from io_xplane2blender.tests import *
from io_xplane2blender.xplane_config import getDebug
from io_xplane2blender.xplane_types import xplane_file

__dirname__ = os.path.dirname(__file__)

class TestAutodetectTextures5(XPlaneTestCase):
expected_logger_errors = 0
def test_autodetect_textures_export(self):
def filterLines(line):
return isinstance(line[0], str) and \
line[0].find('TEXTURE') == 0

xplaneFile = xplane_file.createFileFromBlenderLayerIndex(0)
out = xplaneFile.write()

self.assertEquals(len(logger.findErrors()),self.expected_logger_errors)

runTestCases([TestAutodetectTextures5])

0 comments on commit ac5c05f

Please sign in to comment.