My goal is to quickly replace high poly models with low poly versions. The high poly models are being pulled from a library by architects, so the names are complex and always the same. I have started building a document in Cinema with low poly versions of these with correct UV and textures that I saved to the content browser. My thinking is that when I import their model, I run a script that
1 - Creates a list of all the active objects in the current scene
2 - Opens the document that holds the low poly versions
3 - Copy any objects in the low poly document that match the list of objects from the architect's model
4 - Paste those objects in to the document that has the architect's model
5 - Replace the high poly models with the low poly version
The part I'm stuck on is opening and then working with the document from the content library. This is my code so far:
def main():
#Make list of selection
Object_List = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_CHILDREN)
#Open low poly library file from content browser
c4d.documents.LoadFile("preset://Optimized_Assets.lib4d/Asset_Library.c4d")
#This is where I would compare the objects in the scene to the Object_List
print c4d.documents.BaseDocument.GetObjects(doc)
The console prints out a list of objects in the architects model, so I'm wondering why that stays as doc and not the file that was just loaded and how to switch between the files I want to work with in python?