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
diff options
context:
space:
mode:
authorAlejandro Conty Estevez <conty@yafray.org>2004-01-10 00:15:08 +0300
committerAlejandro Conty Estevez <conty@yafray.org>2004-01-10 00:15:08 +0300
commitb430cd167f6d0694783bf76adc8cd7852c75ae11 (patch)
treefbc6922f74e68946d730b80a8437ed1468b8f033 /source/blender/yafray/intern
parent4f398031b86c6f7c7661cd8cc7c6bb7231b3b6b5 (diff)
Eeshlo's fix for the unit problem with texture paths exporting to yafray
Diffstat (limited to 'source/blender/yafray/intern')
-rwxr-xr-xsource/blender/yafray/intern/export_File.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp
index ed43216f0f3..45640f0f722 100755
--- a/source/blender/yafray/intern/export_File.cpp
+++ b/source/blender/yafray/intern/export_File.cpp
@@ -294,7 +294,21 @@ void yafrayFileRender_t::writeTextures()
ostr << "<shader type=\"image\" name=\"" << blendtex->first << "\" >\n";
ostr << "\t<attributes>\n";
// image->name is full path
- ostr << "\t\t<filename value=\"" << ima->name << "\" />\n";
+#ifdef WIN32
+ // add drive character if not in texpath, using blender executable location as reference
+ string texpath = ima->name;
+ int sp = texpath.find_first_of(":");
+ if (sp==-1) {
+ extern char bprogname[];
+ string blpath = bprogname;
+ sp = blpath.find_first_of(":");
+ if (sp!=-1) texpath = blpath.substr(0, sp+1) + texpath;
+ }
+#else
+ string texpath = ima->name;
+#endif
+
+ ostr << "\t\t<filename value=\"" << texpath << "\" />\n";
ostr << "\t</attributes>\n";
ostr << "</shader>\n\n";
xmlfile << ostr.str();