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")
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)
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:
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):
if material.render_mode!='EXTERNAL':
tech_name = material.name+".tech"
if tech_name not in resources:
+ material = Material(material)
material_export.export_technique_resources(material, resources)
resources[tech_name] = material_export.export_technique(material, resources)
elif "stub.tech" not in resources:
self.render_mode = material.render_mode
self.technique = material.technique
self.render_methods = material.render_methods[:]
+ self.uniforms = material.uniforms[:]
self.receive_shadows = material.receive_shadows
self.cast_shadows = (material.shadow_method!='NONE')
self.image_based_lighting = material.image_based_lighting