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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorGaia Clary <gaia.clary@machinimatrix.org>2012-09-12 19:41:58 +0400
committerGaia Clary <gaia.clary@machinimatrix.org>2012-09-12 19:41:58 +0400
commit26260ffc74bd847d96f53b7db71e498f5249094d (patch)
tree05c9f32639953b9ab22629a1803bb81a9dc7ee7b /source
parent7ed5d19c24df532aa6d6638687da150bfa0c2f4f (diff)
#31682: partial fix (the export): Avoid to copy exported image into itself
Diffstat (limited to 'source')
-rw-r--r--source/blender/collada/ImageExporter.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/collada/ImageExporter.cpp b/source/blender/collada/ImageExporter.cpp
index ef714f2561f..64bc05eeed2 100644
--- a/source/blender/collada/ImageExporter.cpp
+++ b/source/blender/collada/ImageExporter.cpp
@@ -119,12 +119,15 @@ void ImagesExporter::export_UV_Image(Image *image, bool use_copies)
// This image is already located on the file system.
// But we want to create copies here.
- // To avoid overwroting images with same file name but
- // differenet source locations
-
- if (BLI_copy(source_path, export_path) != 0) {
- fprintf(stderr, "Collada export: Cannot copy image:\n source:%s\ndest :%s\n", source_path, export_path);
- return;
+ // To move images into the same export directory.
+ // Note: If an image is already located in the exprot folder,
+ // skip the copy (as it would result in a file copy error
+
+ if (BLI_path_cmp(source_path, export_path) != 0) {
+ if (BLI_copy(source_path, export_path) != 0) {
+ fprintf(stderr, "Collada export: Cannot copy image:\n source:%s\ndest :%s\n", source_path, export_path);
+ return;
+ }
}
BLI_strncpy(export_path, export_file, sizeof(export_path));
@@ -132,7 +135,7 @@ void ImagesExporter::export_UV_Image(Image *image, bool use_copies)
}
else {
- // Do not make any vopies, but use the source path directly as reference
+ // Do not make any copies, but use the source path directly as reference
// to the original image
BLI_strncpy(export_path, source_path, sizeof(export_path));