How to get assets by python in C4Dr19?


#1

this it my code:

…………………………………………………………………………………………………………………………………………
myDoc = c4d.documents.GetActiveDocument()
myPath = ‘D:\test_project\assets’

assets = c4d.documents.GetAllAssets(myDoc, False, myPath)
print assets # result is None
…………………………………………………………………………………………………………………………………………

I have a missing asset .
so , the function return None .
what should i do ?


#2

(Gleaning info from documentation, I didn’t try this…) You are not allowing dialogs to open, so the system cannot show the file dialog with myPath for the user to select an (alternative) asset. Try passing True as 2nd argument.