I tried "GetAllAssets()" and "GetAllTextures()", but I can't get realpath...
this is my test code:
# -*- coding: utf-8 -*-
"""
该模块用于解析场景使用,
无论插件提交,还是客户端提交,
解析方面的工作都在这个模块实现
"""
import c4d
class Parse:
# Override
def __init__(self, doc):
"""
parameters::
doc ==> 当前C4D场景
"""
self.doc = doc
def assetParse(self):
"""
资源解析,解析场景中所有资源,
是否存在,路径等信息
"""
assets = c4d.documents.GetAllAssets(self.doc, False, "")
if not assets:
assets = self.doc.GetAllTextures()
self.assets = assets
def test(self):
self.doc.SendInfo(
c4d.MSG_DOCUMENTINFO_TYPE_MAKEPROJECT,
c4d.FORMAT_C4DEXPORT,
self.doc.GetDocumentName()
)
if __name__ == "__main__":
c4d.CallCommand(13957) # Clear Console
doc = c4d.documents.GetActiveDocument()
doc_parsed = Parse(doc)
doc_parsed.assetParse()
# for i in doc_parsed.assets[0]:
# print i
for i in doc_parsed.assets:
print i