+ if obj.inherit_tech and (obj.override_material or mesh.materials[0].texture_slots):
+ out_file.begin("technique")
+ out_file.begin("inherit", '"{}"'.format(obj.technique))
+ for slot in mesh.materials[0].texture_slots:
+ if slot and slot.texture.type=="IMAGE":
+ name = image_name(slot.texture.image)
+ if slot.use_map_color_diffuse:
+ out_file.write("texture", '"diffuse_map"', '"{}"'.format(name))
+ elif slot.use_map_normal:
+ out_file.write("texture", '"normal_map"', '"{}"'.format(name))
+ if obj.override_material:
+ mat_name = mesh.materials[0].name+".mat"
+ mat_out = open_output(os.path.join(path, mat_name))
+ self.export_material(mesh.materials[0], mat_out)
+ out_file.write("material", '""', '"{}"'.format(mat_name))
+ out_file.end()
+ out_file.end()
+ else:
+ out_file.write("technique", '"{}"'.format(obj.technique))