X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=blender%2Fio_mspgl%2Fexport_material.py;h=7e8f60660b4563eddc2e04f4f93ae2b3ff635e41;hb=2680cc0bf251db566753dbe9bf947ba6a4b083d2;hp=69782b64cbb4cd7c3edf4fb3ebcd8064313141d3;hpb=08942dd73918a51baefbe7344b62afc0cad42e55;p=libs%2Fgl.git diff --git a/blender/io_mspgl/export_material.py b/blender/io_mspgl/export_material.py index 69782b64..7e8f6066 100644 --- a/blender/io_mspgl/export_material.py +++ b/blender/io_mspgl/export_material.py @@ -1,7 +1,6 @@ import os def create_technique_resource(material, resources): - # This operates on a Blender material, not a custom object from .datafile import Resource, Statement tech_res = Resource(material.name+".tech", "technique") @@ -38,7 +37,7 @@ def create_technique_resource(material, resources): tech_res.statements.append(st) - if material.shadow_method!='NONE': + if material.cast_shadows: st = Statement("method", "shadow") st.sub.append(Statement("shader", "occluder.glsl.shader")) tech_res.statements.append(st) @@ -50,18 +49,14 @@ def create_technique_resource(material, resources): return tech_res class MaterialExporter: - def create_texture_exporter(self): - from .export_texture import TextureExporter - texture_export = TextureExporter() - return texture_export - def export_technique_resources(self, material, resources): - from .export_texture import SamplerExporter - texture_export = self.create_texture_exporter() + from .export_texture import SamplerExporter, TextureExporter + texture_export = TextureExporter() sampler_export = SamplerExporter() from .material import Material - material = Material(material) + if type(material)!=Material: + material = Material(material) for p in material.properties: if p.texture: @@ -81,6 +76,10 @@ class MaterialExporter: resources[mat_name] = None def export_technique(self, material, resources): + from .material import Material + if type(material)!=Material: + material = Material(material) + return create_technique_resource(material, resources) def export_material(self, material, resources):