From 1fb73ac76b203f6d88f88b231366ab97b0bc33e1 Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Fri, 17 Nov 2017 14:54:42 +0100 Subject: [PATCH] fix exporting with seperate_materials=False --- io_ogre/ogre/material.py | 3 ++- io_ogre/ogre/scene.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/io_ogre/ogre/material.py b/io_ogre/ogre/material.py index 755ae4e..5881059 100644 --- a/io_ogre/ogre/material.py +++ b/io_ogre/ogre/material.py @@ -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')) diff --git a/io_ogre/ogre/scene.py b/io_ogre/ogre/scene.py index a6e1de7..315475b 100644 --- a/io_ogre/ogre/scene.py +++ b/io_ogre/ogre/scene.py @@ -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)