Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKalle-Samuli Riihikoski <haikalle@gmail.com>2011-09-03 17:54:19 +0400
committerKalle-Samuli Riihikoski <haikalle@gmail.com>2011-09-03 17:54:19 +0400
commitcb43d89a378797e1a4a277198258678126061688 (patch)
tree02c2e652a26fd0d3d2a6bfa4d81712367578be1d /io_coat3D/tex.py
parenta09b0fea14bf6aa8d03cd32ef8d354dda9bed2e8 (diff)
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.
Diffstat (limited to 'io_coat3D/tex.py')
-rw-r--r--io_coat3D/tex.py5
1 files changed, 5 insertions, 0 deletions
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'