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:
authorCampbell Barton <ideasman42@gmail.com>2011-07-20 12:10:59 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-07-20 12:10:59 +0400
commit70254c0c5e656ed5d0282d946b8e85b5ed85efb9 (patch)
tree90741fb5addb3bb92fae20cec878a9588b33dd5c
parent246277c4670bedc3b064238708bbaac4396290ce (diff)
fix [#28028] 3ds export fails due to relative paths in windows
-rw-r--r--io_export_directx_x.py2
-rw-r--r--io_scene_3ds/export_3ds.py2
-rw-r--r--io_scene_fbx/export_fbx.py4
-rw-r--r--io_scene_map/export_map.py4
-rw-r--r--io_scene_x3d/export_x3d.py4
5 files changed, 8 insertions, 8 deletions
diff --git a/io_export_directx_x.py b/io_export_directx_x.py
index 7b36afa9..eaa4cbe2 100644
--- a/io_export_directx_x.py
+++ b/io_export_directx_x.py
@@ -199,7 +199,7 @@ def GetMaterialTexture(Material):
#Create a list of Textures that have type "IMAGE"
ImageTextures = [Material.texture_slots[TextureSlot].texture for TextureSlot in Material.texture_slots.keys() if Material.texture_slots[TextureSlot].texture.type == "IMAGE"]
#Refine a new list with only image textures that have a file source
- ImageFiles = [os.path.basename(Texture.image.filepath[2:]) for Texture in ImageTextures if Texture.image.source == "FILE"]
+ ImageFiles = [bpy.path.basename(Texture.image.filepath) for Texture in ImageTextures if getattr(Texture.image, "source", "") == "FILE"]
if ImageFiles:
return ImageFiles[0]
return None
diff --git a/io_scene_3ds/export_3ds.py b/io_scene_3ds/export_3ds.py
index 8264c18d..d25672ef 100644
--- a/io_scene_3ds/export_3ds.py
+++ b/io_scene_3ds/export_3ds.py
@@ -448,7 +448,7 @@ def make_material_texture_chunk(id, images):
def add_image(img):
import os
- filename = os.path.basename(image.filepath)
+ filename = bpy.path.basename(image.filepath)
mat_sub_file = _3ds_chunk(MATMAPFILE)
mat_sub_file.add_variable("mapfile", _3ds_string(sane_name(filename)))
mat_sub.add_subchunk(mat_sub_file)
diff --git a/io_scene_fbx/export_fbx.py b/io_scene_fbx/export_fbx.py
index 7f0246e7..8e34d45d 100644
--- a/io_scene_fbx/export_fbx.py
+++ b/io_scene_fbx/export_fbx.py
@@ -1090,7 +1090,7 @@ def save_single(operator, scene, filepath="",
Property: "Height", "int", "",0''')
if tex:
fname_rel = bpy_extras.io_utils.path_reference(tex.filepath, base_src, base_dst, path_mode, "", copy_set)
- fname_strip = os.path.basename(fname_rel)
+ fname_strip = bpy.path.basename(fname_rel)
else:
fname_strip = fname_rel = ""
@@ -1149,7 +1149,7 @@ def save_single(operator, scene, filepath="",
if tex:
fname_rel = bpy_extras.io_utils.path_reference(tex.filepath, base_src, base_dst, path_mode, "", copy_set)
- fname_strip = os.path.basename(fname_rel)
+ fname_strip = bpy.path.basename(bpy.path.abspath(fname_rel))
else:
fname_strip = fname_rel = ""
diff --git a/io_scene_map/export_map.py b/io_scene_map/export_map.py
index 0ed01c8d..8feb2cc8 100644
--- a/io_scene_map/export_map.py
+++ b/io_scene_map/export_map.py
@@ -75,7 +75,7 @@ def write_cube2brush(file, faces):
image = uf.image if uf else None
if image:
- file.write(os.path.splitext(os.path.basename(image.filepath))[0])
+ file.write(os.path.splitext(bpy.path.basename(image.filepath))[0])
else:
file.write(PREF_NULL_TEX)
@@ -112,7 +112,7 @@ def write_face2brush(file, face):
image = uf.image if uf else None
if image:
- image_text = os.path.splitext(os.path.basename(image.filepath))[0]
+ image_text = os.path.splitext(bpy.path.basename(image.filepath))[0]
# reuse face vertices
_v = face.id_data.vertices # XXX25
diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py
index 823b8ff4..a9e87587 100644
--- a/io_scene_x3d/export_x3d.py
+++ b/io_scene_x3d/export_x3d.py
@@ -1084,7 +1084,7 @@ def export(file,
filepath = image.filepath
filepath_full = bpy.path.abspath(filepath)
filepath_ref = bpy_extras.io_utils.path_reference(filepath_full, base_src, base_dst, path_mode, "textures", copy_set)
- filepath_base = os.path.basename(filepath_ref)
+ filepath_base = os.path.basename(filepath_full)
images = [
filepath_base,
@@ -1150,7 +1150,7 @@ def export(file,
if tex.type == 'IMAGE' and tex.image:
namemat = tex.name
pic = tex.image
- basename = os.path.basename(bpy.path.abspath(pic.filepath))
+ basename = bpy.path.basename(pic.filepath)
if namemat == 'back':
fw(ident_step + 'backUrl="%s"\n' % basename)