Permalink
Browse files

fix exporting with seperate_materials=False

  • Loading branch information...
paroj committed Nov 17, 2017
1 parent 6a25768 commit 1fb73ac76b203f6d88f88b231366ab97b0bc33e1
Showing with 3 additions and 2 deletions.
  1. +2 −1 io_ogre/ogre/material.py
  2. +1 −1 io_ogre/ogre/scene.py
View
@@ -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
@@ -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'))
View
@@ -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)

0 comments on commit 1fb73ac

Please sign in to comment.