- if self.textures!='NONE':
- diffuse_tex = None
- for slot in image_texture_slots:
- if slot.use_map_color_diffuse:
- diffuse_tex = slot.texture
- break
-
- if diffuse_tex:
- ss = Statement("texunit", 0)
- if self.textures=='INLINE':
- tex_res = resources[slot.texture.name+".tex2d"]
- ss.sub.append(tech_res.create_embed_statement("texture2d", tex_res))
- elif tex.image:
- ss.sub.append(Statement("texture", image_name(tex.image)))
- st.sub.append(ss)
+ if "diffuse_map" in textures:
+ diffuse_tex = textures["diffuse_map"]
+ ss = Statement("texunit", 0)
+ if self.textures=='INLINE':
+ ss.sub.append(tech_res.create_embed_statement("texture2d", resources[diffuse_tex.name+".tex2d"]))
+ else:
+ ss.sub.append(Statement("texture", image_name(diffuse_tex.image)))
+ st.sub.append(ss)