No worries - i solved it with a call command in the end. It would be good to know how to commit xref materials to the scene as well though.
Im looking to make a simple script that commits all xrefs to the scene before sending it off to render. I have this working so far (it's still WIP) and is almost doing what i need - I just need to figure out how to get the materials to commit to the file too.
Im basically trying to emulate what happens if you select and xref and hit 'c'
Any / all info much appreciated!
from c4d import gui, utils
#Welcome to the world of Python
if op==None: return None
while not op.GetNext() and op.GetUp():
op = op.GetUp()
# Main function
obj = doc.GetFirstObject()
allobjs = 
allXrefs = 
xRef = 1025766
# Gets all objs and stores them in a list
obj = GetNextObj(obj)
for i in allobjs:
if i.GetType() == 1025766:
res = utils.SendModelingCommand(command=c4d.MCOMMAND_MAKEEDITABLE,
for i in res:
#for i in res:
#for i in allXrefs:
for i in allXrefs: