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:
authorAlfredo de Greef <eeshlo@yahoo.com>2006-06-06 20:56:47 +0400
committerAlfredo de Greef <eeshlo@yahoo.com>2006-06-06 20:56:47 +0400
commitf82ffb2e1e0ad80ddd2c0686b5985a4ce8453c9a (patch)
tree9aa834eb274342a201754be36de130f415d9bb27 /source/blender/yafray/intern/export_File.cpp
parent8741e7d06d9825a625a9146fab0bdf94da1c33d6 (diff)
Updated the 'library linked data' code to use the render object table as
suggested by Ton.
Diffstat (limited to 'source/blender/yafray/intern/export_File.cpp')
-rwxr-xr-xsource/blender/yafray/intern/export_File.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp
index 740431dd3a0..ba76a110606 100755
--- a/source/blender/yafray/intern/export_File.cpp
+++ b/source/blender/yafray/intern/export_File.cpp
@@ -1177,10 +1177,24 @@ void yafrayFileRender_t::writeObject(Object* obj, const vector<VlakRen*> &VLR_li
xmlfile << ostr.str();
ostr.str("");
- // 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'
+
+ // using the ObjectRen database, contruct a new name if object has a parent.
+ // This is done to prevent name clashes (group/library link related)
string obname(obj->id.name);
- if (obj->id.flag & (LIB_EXTERN|LIB_INDIRECT))obname = "lib_" + obname;
+ // previous implementation, keep around, in case this is still useful
+ //if (obj->id.flag & (LIB_EXTERN|LIB_INDIRECT))obname = "lib_" + obname;
+ ObjectRen *obren;
+ for (obren = static_cast<ObjectRen*>(re->objecttable.first);
+ obren; obren=static_cast<ObjectRen*>(obren->next))
+ {
+ Object *db_ob = obren->ob, *db_par = obren->par;
+ if (db_ob==obj)
+ if ((db_ob!=NULL) && (db_par!=NULL)) {
+ obname += "_" + string(db_par->id.name);
+ break;
+ }
+ }
+
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.