Skip to content

Commit 049490c

Browse files
committed
resolved #720: export ogf lod
1 parent 6d2916a commit 049490c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

io_scene_xray/formats/ogf/exp/main.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,15 @@ def _write_motions(xray, context, arm_obj, ogf_writer):
380380
ogf_writer.data.extend(motions_writer.data)
381381

382382

383+
def _write_lod(root_obj, ogf_writer):
384+
lod = root_obj.xray.lodref
385+
386+
if lod:
387+
lod_writer = rw.write.PackedWriter()
388+
lod_writer.puts(lod + '\r\n')
389+
ogf_writer.put(fmt.Chunks_v4.S_LODS, lod_writer)
390+
391+
383392
def _write_motion_refs(obj, context, ogf_writer):
384393
refs_collect = obj.xray.motionrefs_collection
385394

@@ -825,6 +834,7 @@ def _export_main(root_obj, ogf_writer, context):
825834
_write_userdata(root_obj, ogf_writer)
826835
_write_motion_refs(root_obj, context, ogf_writer)
827836
_write_motions(xray, context, arm_obj, ogf_writer)
837+
_write_lod(root_obj, ogf_writer)
828838

829839

830840
@log.with_context('export-ogf')

tests/cases/test_ogf_export.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ def test_export_selected_object(self):
2626
# Arrange
2727
bpy.ops.object.select_all(action='DESELECT')
2828
obj = self._create_object('test_object')
29+
30+
# test lod export
31+
obj.xray.lodref = 'test\\lod\\ref'
32+
2933
tests.utils.select_object(obj)
3034

3135
# Act

0 commit comments

Comments
 (0)