diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-26 14:50:59 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-26 14:50:59 +0300 |
commit | 878d8b44ee24e1832a33a2c3388052b505bc4524 (patch) | |
tree | d11028bd4f53c5c34f805e060c47914eeef17640 /release | |
parent | 3ea627245b5a03db3010b16f2ef7edcafacbfc8e (diff) |
remove rna functions image.get_export_path() and image.get_abs_filename(), filename functions should not be spesific to images.
rename BKE_get_image_export_path() to BKE_rebase_path() and take a filename arg rather then an image.
obj export file copy was also not working because of a missing import.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/io/export_fbx.py | 16 | ||||
-rw-r--r-- | release/scripts/io/export_obj.py | 14 | ||||
-rw-r--r-- | release/scripts/io/export_x3d.py | 2 |
3 files changed, 19 insertions, 13 deletions
diff --git a/release/scripts/io/export_fbx.py b/release/scripts/io/export_fbx.py index 35ea4153e5c..e1c7f68c557 100644 --- a/release/scripts/io/export_fbx.py +++ b/release/scripts/io/export_fbx.py @@ -1293,16 +1293,18 @@ def write(filename, batch_objects = None, \ file.write('\n\t}') def copy_image(image): - - rel = image.get_export_path(basepath, True) - base = os.path.basename(rel) + fn = bpy.utils.expandpath(image.filename) + fn_strip = os.path.basename(fn) if EXP_IMAGE_COPY: - absp = image.get_export_path(basepath, False) - if not os.path.exists(absp): - shutil.copy(image.get_abs_filename(), absp) + rel = fn_strip + fn_abs_dest = os.path.join(basepath, fn_strip) + if not os.path.exists(fn_abs_dest): + shutil.copy(fn, fn_abs_dest) + else: + rel = os.path.relpath(fn, basepath) - return (rel, base) + return (rel, fn_strip) # tex is an Image (Arystan) def write_video(texname, tex): diff --git a/release/scripts/io/export_obj.py b/release/scripts/io/export_obj.py index e3b6715d288..2d039bfd45c 100644 --- a/release/scripts/io/export_obj.py +++ b/release/scripts/io/export_obj.py @@ -44,6 +44,7 @@ will be exported as mesh data. # import math import os import time +import shutil import bpy import Mathutils @@ -76,12 +77,15 @@ def write_mtl(scene, filename, copy_images): dest_dir = os.path.dirname(filename) def copy_image(image): - rel = image.get_export_path(dest_dir, True) - + fn = bpy.utils.expandpath(image.filename) + fn_strip = os.path.basename(fn) if copy_images: - abspath = image.get_export_path(dest_dir, False) - if not os.path.exists(abs_path): - shutil.copy(image.get_abs_filename(), abs_path) + rel = fn_strip + fn_abs_dest = os.path.join(dest_dir, fn_strip) + if not os.path.exists(fn_abs_dest): + shutil.copy(fn, fn_abs_dest) + else: + rel = fn return rel diff --git a/release/scripts/io/export_x3d.py b/release/scripts/io/export_x3d.py index 61a2e8220e2..f1ab8cd3de7 100644 --- a/release/scripts/io/export_x3d.py +++ b/release/scripts/io/export_x3d.py @@ -794,7 +794,7 @@ class x3d_class: pic = tex.image # using .expandpath just in case, os.path may not expect // - basename = os.path.basename(pic.get_abs_filename()) + basename = os.path.basename(bpy.utils.expandpath(pic.filename)) pic = alltextures[i].image # pic = alltextures[i].getImage() |