st.sub.append(tech_res.create_embed_statement("material", mat_res))
if material.render_mode=='CUSTOM':
st.sub.append(tech_res.create_embed_statement("material", mat_res))
if material.render_mode=='CUSTOM':
- st.sub.append(Statement("shader", material.shader))
+ shader = material.shader
+ if shader.endswith(".glsl"):
+ shader += ".shader"
+ st.sub.append(Statement("shader", shader))
- for kw, p in material.properties.items():
- ss = self.create_property_statement(mat_res, p, kw, resources)
+ for p in material.properties:
+ ss = self.create_property_statement(mat_res, p, resources)
if first_tex and not first_tex.default_filter:
from .export_texture import SamplerExporter
sampler_export = SamplerExporter()
if first_tex and not first_tex.default_filter:
from .export_texture import SamplerExporter
sampler_export = SamplerExporter()
- def create_property_statement(self, mat_res, prop, keyword, resources):
+ def create_property_statement(self, mat_res, prop, resources):
from .datafile import Statement
if self.use_textures and prop.texture:
tex_res = resources[prop.texture.image.name+".tex2d"]
from .util import basename
fn = basename(prop.texture.image.filepath)
if prop.texture.default_filter and fn:
from .datafile import Statement
if self.use_textures and prop.texture:
tex_res = resources[prop.texture.image.name+".tex2d"]
from .util import basename
fn = basename(prop.texture.image.filepath)
if prop.texture.default_filter and fn: