Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #312! This is the code for the LIGHT_SPILL_CUSTOM feature
- Loading branch information
Showing
11 changed files
with
254 additions
and
2 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
18 changes: 18 additions & 0 deletions
18
tests/lights/fixtures/light_spill_custom/test_light_spill_custom_dref.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,18 @@ | ||
I | ||
800 | ||
OBJ | ||
|
||
POINT_COUNTS 0 0 0 0 | ||
|
||
# 0 ROOT | ||
# 1 Light: Spot_blank | ||
# LIGHT: Spot_blank weight: 10000 | ||
LIGHT_SPILL_CUSTOM 0 1 -0 1 1 1 1 15 0 1 -0.00000015 0.92387953 | ||
# 1 Light: Spot_none | ||
# LIGHT: Spot_none weight: 10000 | ||
LIGHT_SPILL_CUSTOM 10 1 -0 1 1 1 1 15 0 1 -0.00000015 0.92387953 none | ||
# 1 Light: Spot_traffic_light | ||
# LIGHT: Spot_traffic_light weight: 10000 | ||
LIGHT_SPILL_CUSTOM 20 1 -0 1 1 1 1 15 0 1 -0.00000015 0.92387953 sim/graphics/animation/lights/traffic_light | ||
|
||
# Build with Blender 2.80 (sub 75) (build b'f6cb5f54494e'). Exported with XPlane2Blender 4.0.0-dev.0+90.NO_BUILD_NUMBR |
21 changes: 21 additions & 0 deletions
21
tests/lights/fixtures/light_spill_custom/test_light_spill_custom_dxyz.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,21 @@ | ||
I | ||
800 | ||
OBJ | ||
|
||
POINT_COUNTS 0 0 0 0 | ||
|
||
# 0 ROOT | ||
# 1 Light: Spot_aa_backish_68.5_-.907_0,087_-.413_pink | ||
# LIGHT: Spot_aa_backish_68.5_-.907_0,087_-.413_pink weight: 10000 | ||
LIGHT_SPILL_CUSTOM 0 10 5 1 0 1 1 35 -0.54601967 0.35867152 0.75711119 0.92387953 | ||
# 1 Light: Spot_down_0_0_0_red | ||
# LIGHT: Spot_down_0_0_0_red weight: 10000 | ||
LIGHT_SPILL_CUSTOM -20 10 -0 1 0 0 1 35 0 -1 -0 0.92387953 | ||
# 1 Light: Spot_forward_90_0_0_blue | ||
# LIGHT: Spot_forward_90_0_0_blue weight: 10000 | ||
LIGHT_SPILL_CUSTOM -10 10 -0 0 0 1 1 35 0 0.00000004 -1 0.92387953 | ||
# 1 Light: Spot_right_90_0_-90_green | ||
# LIGHT: Spot_right_90_0_-90_green weight: 10000 | ||
LIGHT_SPILL_CUSTOM 0 10 -0 0 1 0 1 35 1 0.00000004 0.00000004 0.92387953 | ||
|
||
# Build with Blender 2.80 (sub 75) (build b'f6cb5f54494e'). Exported with XPlane2Blender 4.0.0-dev.0+90.NO_BUILD_NUMBR |
15 changes: 15 additions & 0 deletions
15
tests/lights/fixtures/light_spill_custom/test_light_spill_custom_rgb.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,15 @@ | ||
I | ||
800 | ||
OBJ | ||
|
||
POINT_COUNTS 0 0 0 0 | ||
|
||
# 0 ROOT | ||
# 1 Light: Point_pink | ||
# LIGHT: Point_pink weight: 10000 | ||
LIGHT_SPILL_CUSTOM 5 5 -5 1 0.1 0.80000001 1 35 0 0 0 1 | ||
# 1 Light: Spot_green | ||
# LIGHT: Spot_green weight: 10000 | ||
LIGHT_SPILL_CUSTOM -4 5 4 0 1 0.25 1 35 0 -1 -0 0.92387953 | ||
|
||
# Build with Blender 2.80 (sub 75) (build b'f6cb5f54494e'). Exported with XPlane2Blender 4.0.0-dev.0+90.NO_BUILD_NUMBR |
24 changes: 24 additions & 0 deletions
24
tests/lights/fixtures/light_spill_custom/test_light_spill_custom_semi_point.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,24 @@ | ||
I | ||
800 | ||
OBJ | ||
|
||
POINT_COUNTS 0 0 0 0 | ||
|
||
# 0 ROOT | ||
# 1 Light: Point_1 | ||
# LIGHT: Point_1 weight: 10000 | ||
LIGHT_SPILL_CUSTOM -20 14 -0 1 1 1 1 35 0 0 0 1 | ||
# 1 Light: Point_180 | ||
# LIGHT: Point_180 weight: 10000 | ||
LIGHT_SPILL_CUSTOM 20 14 -0 1 1 1 1 35 0 0 0 1 | ||
# 1 Light: Point_35 | ||
# LIGHT: Point_35 weight: 10000 | ||
LIGHT_SPILL_CUSTOM -10 14 -0 1 1 1 1 35 0 0 0 1 | ||
# 1 Light: Point_45 | ||
# LIGHT: Point_45 weight: 10000 | ||
LIGHT_SPILL_CUSTOM 0 14 -0 1 1 1 1 35 0 0 0 1 | ||
# 1 Light: Pointt_120 | ||
# LIGHT: Pointt_120 weight: 10000 | ||
LIGHT_SPILL_CUSTOM 10 14 -0 1 1 1 1 35 0 0 0 1 | ||
|
||
# Build with Blender 2.80 (sub 75) (build b'f6cb5f54494e'). Exported with XPlane2Blender 4.0.0-dev.0+90.NO_BUILD_NUMBR |
24 changes: 24 additions & 0 deletions
24
tests/lights/fixtures/light_spill_custom/test_light_spill_custom_semi_spot.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,24 @@ | ||
I | ||
800 | ||
OBJ | ||
|
||
POINT_COUNTS 0 0 0 0 | ||
|
||
# 0 ROOT | ||
# 1 Light: Spot_1 | ||
# LIGHT: Spot_1 weight: 10000 | ||
LIGHT_SPILL_CUSTOM -20 14 -0 1 1 1 1 35 0 -1 -0 0.99996192 | ||
# 1 Light: Spot_120 | ||
# LIGHT: Spot_120 weight: 10000 | ||
LIGHT_SPILL_CUSTOM 10 14 -0 1 1 1 1 35 0 -1 -0 0.49999997 | ||
# 1 Light: Spot_180 | ||
# LIGHT: Spot_180 weight: 10000 | ||
LIGHT_SPILL_CUSTOM 20 14 -0 1 1 1 1 35 0 -1 -0 -0.00000004 | ||
# 1 Light: Spot_35 | ||
# LIGHT: Spot_35 weight: 10000 | ||
LIGHT_SPILL_CUSTOM -10 14 -0 1 1 1 1 35 0 -1 -0 0.95371695 | ||
# 1 Light: Spot_45 | ||
# LIGHT: Spot_45 weight: 10000 | ||
LIGHT_SPILL_CUSTOM 0 14 -0 1 1 1 1 35 0 -1 -0 0.92387953 | ||
|
||
# Build with Blender 2.80 (sub 75) (build b'f6cb5f54494e'). Exported with XPlane2Blender 4.0.0-dev.0+90.NO_BUILD_NUMBR |
15 changes: 15 additions & 0 deletions
15
tests/lights/fixtures/light_spill_custom/test_light_spill_custom_size.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,15 @@ | ||
I | ||
800 | ||
OBJ | ||
|
||
POINT_COUNTS 0 0 0 0 | ||
|
||
# 0 ROOT | ||
# 1 Light: Point_size_67.58 | ||
# LIGHT: Point_size_67.58 weight: 10000 | ||
LIGHT_SPILL_CUSTOM 5 5 -5 1 0.1 0.80000001 1 67.580002 0 0 0 1 | ||
# 1 Light: Spot_size_40 | ||
# LIGHT: Spot_size_40 weight: 10000 | ||
LIGHT_SPILL_CUSTOM -4 5 4 0 1 0.25 1 40 0 -1 -0 0.92387953 | ||
|
||
# Build with Blender 2.80 (sub 75) (build b'f6cb5f54494e'). Exported with XPlane2Blender 4.0.0-dev.0+90.NO_BUILD_NUMBR |
19 changes: 19 additions & 0 deletions
19
tests/lights/fixtures/light_spill_custom/test_light_spill_custom_xyz.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,19 @@ | ||
I | ||
800 | ||
OBJ | ||
|
||
POINT_COUNTS 0 0 0 0 | ||
|
||
# 0 ROOT | ||
# 1 Armature: Armature | ||
# ARMATURE: Armature weight: 0 | ||
# 2 Bone: Bone | ||
# 3 Bone: Bone.001 | ||
# 4 Light: Point_5_5_5 | ||
# LIGHT: Point_5_5_5 weight: 10000 | ||
LIGHT_SPILL_CUSTOM 1.3570218 14.714046 -5.7140455 1 0.82163 0.0033541408 1 35 0 0 0 1 | ||
# 4 Light: Spot_-4_-4_5 | ||
# LIGHT: Spot_-4_-4_5 weight: 10000 | ||
LIGHT_SPILL_CUSTOM -2.8856175 6.2287636 2.7712367 1 0.018346181 0.028602321 1 35 -0.66666675 -0.33333337 -0.66666663 0.92387953 | ||
|
||
# Build with Blender 2.80 (sub 75) (build b'f6cb5f54494e'). Exported with XPlane2Blender 4.0.0-dev.0+90.NO_BUILD_NUMBR |
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,39 @@ | ||
import inspect | ||
|
||
from typing import Tuple | ||
import os | ||
import sys | ||
|
||
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 TestLightSpillCustomAttributes(XPlaneTestCase): | ||
def test_light_attributes(self)->None: | ||
filenames = ["test_light_spill_custom_xyz", | ||
"test_light_spill_custom_rgb", | ||
"test_light_spill_custom_dxyz", | ||
"test_light_spill_custom_size", | ||
"test_light_spill_custom_semi_spot", | ||
"test_light_spill_custom_semi_point", | ||
"test_light_spill_custom_dref",] | ||
|
||
for filename in filenames: | ||
with self.subTest(filename=filename): | ||
self.assertExportableRootExportEqualsFixture( | ||
filename[5:], | ||
os.path.join(__dirname__, "fixtures", "light_spill_custom", f"{filename}.obj"), | ||
{"LIGHT_SPILL_CUSTOM"}, | ||
filename, | ||
) | ||
|
||
def test_incompatible_light_types(self): | ||
filename = inspect.stack()[0].function | ||
out = self.exportExportableRoot(filename[5:]) | ||
self.assertLoggerErrors(2) | ||
|
||
|
||
runTestCases([TestLightSpillCustomAttributes]) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.