Skip to content

Commit

Permalink
fix exporting with seperate_materials=False
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Nov 17, 2017
1 parent 6a25768 commit 1fb73ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion io_ogre/ogre/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import logging
from itertools import chain

def dot_materials(materials, path=None, separate_files=True):
def dot_materials(materials, path=None, separate_files=True, prefix='mats', **kwargs):
"""
generate material files, or copy them into a single file
Expand All @@ -29,6 +29,7 @@ def dot_materials(materials, path=None, separate_files=True):
for mat in materials:
dot_material(mat, path)
else:
mat_file_name = prefix
target_file = os.path.join(path, '%s.material' % mat_file_name)
with open(target_file, 'wb') as fd:
fd.write(bytes(MISSING_MATERIAL + "\n",'utf-8'))
Expand Down
2 changes: 1 addition & 1 deletion io_ogre/ogre/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def _flatten( _c, _f ):
if config.get("MATERIALS"):
print (" Processing Materials")
materials = util.objects_merge_materials(meshes)
dot_materials(materials, path, separate_files=config.get('SEP_MATS'))
dot_materials(materials, path, separate_files=config.get('SEP_MATS'), prefix=prefix)

doc = ogre_document(materials)

Expand Down

0 comments on commit 1fb73ac

Please sign in to comment.