THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/08/2011 at 21:58, xxxxxxxx wrote:
Is there something more than textures and GI files ?
Copying the GI files and textures is no problem. It does also seem like cinema 4d does recognize when textures are suddenly relative and no more absolute.
Use this function to save as a project, It should work jsut fine.
import c4d
from c4d.documents import SaveDocument
from os.path import abspath, dirname, split, join, exists, basename, isabs
from os import makedirs, mkdir
from shutil import copytree, copy
def SaveProject(doc, path) :
pah = abspath(path)
ndir_, name = split(path)
ndir_ = join(ndir_, name[:name.rfind('.')])
if not exists(ndir_) :
makedirs(ndir_)
new_illum = join(ndir_, 'illum')
new_tex = join(ndir_, 'tex')
dir_ = doc.GetDocumentPath()
if dir_:
illum = join(dir_, 'illum')
if exists(illum) :
copytree(illum, new_illum)
tex = join(dir_, 'tex')
if exists(tex) :
copytree(tex, new_tex)
for i, texture in doc.GetAllTextures() :
if not isabs(texture) : continue
copy(texture, join(new_tex, basename(texture)))
SaveDocument(doc, join(ndir_, name), 0, c4d.FORMAT_C4DEXPORT)
return True
# example:
SaveProject(doc, 'C:\\foo.c4d')
Cheers,