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:
Diffstat (limited to 'source/blender/yafray/intern/export_File.cpp')
-rwxr-xr-xsource/blender/yafray/intern/export_File.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp
index 25e51a1b0bb..740431dd3a0 100755
--- a/source/blender/yafray/intern/export_File.cpp
+++ b/source/blender/yafray/intern/export_File.cpp
@@ -1177,7 +1177,11 @@ void yafrayFileRender_t::writeObject(Object* obj, const vector<VlakRen*> &VLR_li
xmlfile << ostr.str();
ostr.str("");
- ostr << "<object name=\"" << obj->id.name << "\"";
+ // if objects are externally linked from a library, they could have a name that is already
+ // defined locally, so to prevent name clashes, prefix name with 'lib'
+ string obname(obj->id.name);
+ if (obj->id.flag & (LIB_EXTERN|LIB_INDIRECT))obname = "lib_" + obname;
+ ostr << "<object name=\"" << obname << "\"";
// Yafray still needs default shader name in object def.,
// since we write a shader with every face, simply use the material of the first face.
// If this is an empty string, assume default material.