diff options
author | Alejandro Conty Estevez <conty@yafray.org> | 2004-01-10 00:15:08 +0300 |
---|---|---|
committer | Alejandro Conty Estevez <conty@yafray.org> | 2004-01-10 00:15:08 +0300 |
commit | b430cd167f6d0694783bf76adc8cd7852c75ae11 (patch) | |
tree | fbc6922f74e68946d730b80a8437ed1468b8f033 /source/blender/yafray/intern | |
parent | 4f398031b86c6f7c7661cd8cc7c6bb7231b3b6b5 (diff) |
Eeshlo's fix for the unit problem with texture paths exporting to yafray
Diffstat (limited to 'source/blender/yafray/intern')
-rwxr-xr-x | source/blender/yafray/intern/export_File.cpp | 16 |
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(); |