Skip to content

Commit

Permalink
Adds test that you can't use a particle emitter without specifying so…
Browse files Browse the repository at this point in the history
…me .pss file.
  • Loading branch information
tngreene committed Aug 23, 2018
1 parent 3786ae9 commit 23510d2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions io_xplane2blender/xplane_types/xplane_empty.py
Expand Up @@ -27,6 +27,11 @@ def write(self):
if (int(bpy.context.scene.xplane.version) >= 1130 and
(special_empty_props.special_type == EMPTY_USAGE_EMITTER_PARTICLE or
special_empty_props.special_type == EMPTY_USAGE_EMITTER_SOUND)):
if not self.xplaneBone.xplaneFile.options.particle_system_file.endswith(".pss"):
logger.error("Particle emitter {} is used, despite no .pss file being set"
.format(self.blenderObject.name))
return ''

bake_matrix = self.xplaneBone.getBakeMatrixForAttached()
em_location = xplane_helpers.vec_b_to_x(bake_matrix.to_translation())
#yaw,pitch,roll
Expand Down
Binary file modified tests/particles/particle_pss_file.test.blend
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/particles/particle_pss_file.test.py
Expand Up @@ -35,6 +35,9 @@ def test_file_pss_and_real(self):
filterLines
)

def test_empties_without_pss_fails(self):
out = self.exportLayer(3)
self.assertLoggerErrors(1)

#TI Class name above
runTestCases([TestParticlePssFile])

0 comments on commit 23510d2

Please sign in to comment.