Skip to content

Commit 1fb73ac

Browse files
committed
fix exporting with seperate_materials=False
1 parent 6a25768 commit 1fb73ac

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

io_ogre/ogre/material.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import logging
1212
from itertools import chain
1313

14-
def dot_materials(materials, path=None, separate_files=True):
14+
def dot_materials(materials, path=None, separate_files=True, prefix='mats', **kwargs):
1515
"""
1616
generate material files, or copy them into a single file
1717
@@ -29,6 +29,7 @@ def dot_materials(materials, path=None, separate_files=True):
2929
for mat in materials:
3030
dot_material(mat, path)
3131
else:
32+
mat_file_name = prefix
3233
target_file = os.path.join(path, '%s.material' % mat_file_name)
3334
with open(target_file, 'wb') as fd:
3435
fd.write(bytes(MISSING_MATERIAL + "\n",'utf-8'))

io_ogre/ogre/scene.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def _flatten( _c, _f ):
135135
if config.get("MATERIALS"):
136136
print (" Processing Materials")
137137
materials = util.objects_merge_materials(meshes)
138-
dot_materials(materials, path, separate_files=config.get('SEP_MATS'))
138+
dot_materials(materials, path, separate_files=config.get('SEP_MATS'), prefix=prefix)
139139

140140
doc = ogre_document(materials)
141141

0 commit comments

Comments
 (0)