Commit: 0a71eea5f124875f3f9aacbbb007c80c748849d2
Author: Lukas Tönne
Date:   Wed Mar 11 12:43:46 2015 +0100
Branches: alembic_pointcache
https://developer.blender.org/rB0a71eea5f124875f3f9aacbbb007c80c748849d2

Nicer info printing support for instances in Alembic files.

This now avoids repetition of internal instance structure.

===================================================================

M       source/blender/pointcache/alembic/abc_info.cpp

===================================================================

diff --git a/source/blender/pointcache/alembic/abc_info.cpp 
b/source/blender/pointcache/alembic/abc_info.cpp
index b937197..4abc7b2 100644
--- a/source/blender/pointcache/alembic/abc_info.cpp
+++ b/source/blender/pointcache/alembic/abc_info.cpp
@@ -190,17 +190,30 @@ static void visitObject(std::stringstream &ss, IObject 
iObj, std::string iIndent
        // and then it has a compound property full of properties.
        std::string path = iObj.getFullName();
        
-       if (path != "/") {
-               ss << "Object " << "name=" << path << std::endl;
+       if (iObj.isInstanceRoot()) {
+               if (path != "/") {
+                       ss << "Object " << "name=" << path
+                          << " [Instance " << iObj.instanceSourcePath() << "]"
+                          << std::endl;
+               }
        }
-       
-       // Get the properties.
-       ICompoundProperty props = iObj.getProperties();
-       visitProperties(ss, props, iIndent);
-       
-       // now the child objects
-       for (size_t i = 0 ; i < iObj.getNumChildren() ; i++) {
-               visitObject(ss, IObject(iObj, 
iObj.getChildHeader(i).getName()), iIndent);
+       else if (iObj.isInstanceDescendant()) {
+               /* skip non-root instances to avoid repetition */
+               return;
+       }
+       else {
+               if (path != "/") {
+                       ss << "Object " << "name=" << path << std::endl;
+               }
+               
+               // Get the properties.
+               ICompoundProperty props = iObj.getProperties();
+               visitProperties(ss, props, iIndent);
+               
+               // now the child objects
+               for (size_t i = 0 ; i < iObj.getNumChildren() ; i++) {
+                       visitObject(ss, IObject(iObj, 
iObj.getChildHeader(i).getName()), iIndent);
+               }
        }
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to