Hello,
I like to know the path to the document when the user does a "Save With Assets" command.
class MyObject : public ObjectData
{
Bool MyObject::Message(GeListNode* node, Int32 type, void* data)
{
if (type == MSG_GETALLASSETS)
{
BaseDocument* pDoc = node->GetDocument(); // modified after initial post
Filename fullDocPath = pDoc->GetDocumentPath() + pDoc->GetDocumentName();
}
}
}
Saving with assets the first time reports the correct path. Saving with assets a second time reports the previous path, which is wrong.
The doc says:
When “Save Project with Assets” is invoked, everything is moved to the new target directory. In this case all absolute paths must be converted to just filenames because the files are next to the document and the absolute paths are not needed anymore.
MSG_GETALLASSETS
and MSG_MULTI_CLEARSUGGESTEDFOLDER
AssetData *assetData = static_cast<AssetData*>(data);
Filename myAsset = ...
assetData->Add(myAsset.GetFile());
So I removed the path before adding assets to the assetData. But then the assets are not written to disk and Cinema4D pops up a message box complaining the assets cannot be found (IDS_PAI_CONSOLIDATE_QUESTION_LOCATION
or IDS_TEXLACK
). Why? What is my understanding is that the handler for MSG_MULTI_CLEARSUGGESTEDFOLDER
should add the new path to my asset, not remove it because this was already done in MSG_GETALLASSETS
?
I am using Cinema4D R21, but can also test on R23.
Kind Regards,
Chris