From cb43d89a378797e1a4a277198258678126061688 Mon Sep 17 00:00:00 2001 From: Kalle-Samuli Riihikoski Date: Sat, 3 Sep 2011 13:54:19 +0000 Subject: Fixed an error. It was asking image.filepath even if there was no image. Now make sure that image is always assing it before this call. --- io_coat3D/tex.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'io_coat3D') diff --git a/io_coat3D/tex.py b/io_coat3D/tex.py index 748d1aa0..d3b5f56d 100644 --- a/io_coat3D/tex.py +++ b/io_coat3D/tex.py @@ -199,10 +199,12 @@ def gettex(mat_list, objekti, scene,export): elif(useold != ''): objekti.active_material.texture_slots[index].texture = useold + objekti.active_material.texture_slots[index].texture.image = bpy.data.images[useold.name] objekti.active_material.texture_slots[index].texture.image.filepath = texcoat['color'][0] if(objekti.data.uv_textures.active): objekti.active_material.texture_slots[index].texture_coords = 'UV' objekti.active_material.texture_slots[index].uv_layer = objekti.data.uv_textures.active.name + if(bring_normal == 1 and texcoat['nmap']): name_tex ='Normal_' @@ -264,6 +266,7 @@ def gettex(mat_list, objekti, scene,export): elif(useold != ''): objekti.active_material.texture_slots[index].texture = useold + objekti.active_material.texture_slots[index].texture.image = bpy.data.images[useold.name] objekti.active_material.texture_slots[index].texture.image.filepath = texcoat['nmap'][0] if(objekti.data.uv_textures.active): objekti.active_material.texture_slots[index].texture_coords = 'UV' @@ -323,6 +326,7 @@ def gettex(mat_list, objekti, scene,export): elif(useold != ''): objekti.active_material.texture_slots[index].texture = useold + objekti.active_material.texture_slots[index].texture.image = bpy.data.images[useold.name] objekti.active_material.texture_slots[index].texture.image.filepath = texcoat['specular'][0] if(objekti.data.uv_textures.active): objekti.active_material.texture_slots[index].texture_coords = 'UV' @@ -381,6 +385,7 @@ def gettex(mat_list, objekti, scene,export): elif(useold != ''): objekti.active_material.texture_slots[index].texture = useold + objekti.active_material.texture_slots[index].texture.image = bpy.data.images[useold.name] objekti.active_material.texture_slots[index].texture.image.filepath = texcoat['disp'][0] if(objekti.data.uv_textures.active): objekti.active_material.texture_slots[index].texture_coords = 'UV' -- cgit v1.2.3