-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #595, with unit test, code, and all that fun!
- Loading branch information
Showing
7 changed files
with
130 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import inspect | ||
import os | ||
import sys | ||
from typing import Tuple | ||
|
||
import bpy | ||
|
||
from io_xplane2blender import xplane_config | ||
from io_xplane2blender.tests import * | ||
from io_xplane2blender.tests import test_creation_helpers | ||
|
||
__dirname__ = os.path.dirname(__file__) | ||
|
||
|
||
class TestCockpitLitOnly(XPlaneTestCase): | ||
def test_Scene_1100(self) -> None: | ||
bpy.context.window.scene = bpy.data.scenes["Scene_1100"] | ||
|
||
out = self.exportExportableRoot("05_cockpit_lit_only_no_export_wrong_version") | ||
self.assertNotIn("ATTR_cockpit_lit_only", out) | ||
|
||
def test_Scene_1110(self) -> None: | ||
bpy.context.window.scene = bpy.data.scenes["Scene_1110"] | ||
|
||
out = self.exportExportableRoot("01_cockpit_lit_only_exported") | ||
self.assertIn("ATTR_cockpit_lit_only", out) | ||
for root in [ | ||
c | ||
for c in bpy.context.scene.collection.children | ||
if not c.name.startswith("01") | ||
]: | ||
with self.subTest(f"Exporting {root.name}", root=root): | ||
out = self.exportExportableRoot(root) | ||
self.assertNotIn("ATTR_cockpit_lit_only", out) | ||
|
||
def test_Scene_default_version(self) -> None: | ||
bpy.context.window.scene = bpy.data.scenes["Scene_default_version"] | ||
filename = "test_06_cockpit_lit_only_exported" | ||
self.assertExportableRootExportEqualsFixture( | ||
filename[5:], | ||
os.path.join(__dirname__, "fixtures", f"{filename}.obj"), | ||
{"ATTR_cockpit_lit_only"}, | ||
filename, | ||
) | ||
|
||
|
||
runTestCases([TestCockpitLitOnly]) |
59 changes: 59 additions & 0 deletions
59
tests/features/fixtures/test_06_cockpit_lit_only_exported.obj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
I | ||
800 | ||
OBJ | ||
|
||
GLOBAL_cockpit_lit | ||
ATTR_cockpit_lit_only | ||
POINT_COUNTS 36 0 0 36 | ||
|
||
VT -1 1 1 0 1 -0 0.625 0.25 | ||
VT -1 1 -1 0 1 -0 0.625 0 | ||
VT 1 1 -1 0 1 -0 0.375 0 | ||
VT 1 1 1 0 1 0 0.375 0.25 | ||
VT -1 1 1 0 1 0 0.625 0.25 | ||
VT 1 1 -1 0 1 0 0.375 0 | ||
VT -1 1 1 0 0 1 0.625 0.5 | ||
VT 1 1 1 0 0 1 0.625 0.25 | ||
VT 1 -1 1 0 0 1 0.375 0.25 | ||
VT -1 -1 1 0 0 1 0.375 0.5 | ||
VT -1 1 1 0 0 1 0.625 0.5 | ||
VT 1 -1 1 0 0 1 0.375 0.25 | ||
VT -1 1 -1 -1 -0 0 0.625 0.75 | ||
VT -1 1 1 -1 -0 0 0.625 0.5 | ||
VT -1 -1 1 -1 -0 0 0.375 0.5 | ||
VT -1 -1 -1 -1 0 0 0.375 0.75 | ||
VT -1 1 -1 -1 0 0 0.625 0.75 | ||
VT -1 -1 1 -1 0 0 0.375 0.5 | ||
VT 1 -1 1 0 -1 -0 0.625 1 | ||
VT 1 -1 -1 0 -1 -0 0.625 0.75 | ||
VT -1 -1 -1 0 -1 -0 0.375 0.75 | ||
VT -1 -1 1 0 -1 -0 0.375 1 | ||
VT 1 -1 1 0 -1 -0 0.625 1 | ||
VT -1 -1 -1 0 -1 -0 0.375 0.75 | ||
VT 1 1 1 1 0 0 0.375 0.75 | ||
VT 1 1 -1 1 0 0 0.375 0.5 | ||
VT 1 -1 -1 1 0 0 0.125 0.5 | ||
VT 1 -1 1 1 0 0 0.125 0.75 | ||
VT 1 1 1 1 0 0 0.375 0.75 | ||
VT 1 -1 -1 1 0 0 0.125 0.5 | ||
VT 1 1 -1 0 0 -1 0.875 0.75 | ||
VT -1 1 -1 0 0 -1 0.875 0.5 | ||
VT -1 -1 -1 0 0 -1 0.625 0.5 | ||
VT 1 -1 -1 0 -0 -1 0.625 0.75 | ||
VT 1 1 -1 0 -0 -1 0.875 0.75 | ||
VT -1 -1 -1 0 -0 -1 0.625 0.5 | ||
|
||
IDX10 0 1 2 3 4 5 6 7 8 9 | ||
IDX10 10 11 12 13 14 15 16 17 18 19 | ||
IDX10 20 21 22 23 24 25 26 27 28 29 | ||
IDX 30 | ||
IDX 31 | ||
IDX 32 | ||
IDX 33 | ||
IDX 34 | ||
IDX 35 | ||
|
||
ATTR_shiny_rat 0.5 | ||
TRIS 0 36 | ||
|
||
# Build with Blender 2.80 (sub 75) (build b'f6cb5f54494e'). Exported with XPlane2Blender 4.1.0-dev.0+93.NO_BUILD_NUMBR |