MSG_MULTI_CLEARSUGGESTEDFOLDER not called for TeamRender
-
Hello,
I have some questions about the messages sent for TeamRendering. I already found these topics, but those don't fully answer my question:
- Changing Asset References to Absolute
- Set preference parameters
- Weird filenames when using make project
- MSG_GETALLASSETS calls?
- TeamRender&MSG_MULTI_CLEARSUGGESTEDFOLDER
- questions about network rendering.
When TeamRendering is used (
Add to Render Queue...
andTeamRender to Picture Viewer...
)MSG_GETALLASSETS
is emmited and the Resources are transferred to the render client(s). ButMSG_MULTI_CLEARSUGGESTEDFOLDER
does not seem to be emitted (ForSave Project with Assets...
it is). Due to that, the paths on the render client are absolute referring to the file on the PC initiating TeamRendering.Should one expect that this message is not sent? And if so is that due to the possibility to request assets on-demand from the server for which the absolute path would be required? Is there a case for which
MSG_MULTI_CLEARSUGGESTEDFOLDER
would be sent whenTeamRendering is used?Kind regards,
Till -
This post is deleted! -
fixed
-
Hi,
When you ask for a teamrender, all asset are copied to a temporary directory on the server. TeamRender do not use MSG_MULTI_CLEARSUGGESTEDFOLDER but when loading the scene, clients will check the assets by only taking the filename into account. If they need to be renamed, the message MSG_RENAMETEXTURES will be broadcast. This message will be forward with RenameTextureMessage data structure. If something was changed, changecnt must be updated.
So to support teamrender and saveproject command, your plugin should add both message support
else if (type == MSG_MULTI_CLEARSUGGESTEDFOLDER || type == MSG_RENAMETEXTURES) // update the file name
cheers,
Manuel -
@m_magalhaes Thank you for your response.
So on the client-side, I always have to assume that I might get absolute paths that refer to the files on the server (
MSG_MULTI_CLEARSUGGESTEDFOLDER
is not called andMSG_RENAMETEXTURES
is only called in case of name conflicts)?If I'm confident that a file that is found on the client-side at such an absolute path matches the one on the server I could use it, but if I want to avoid mismatches of the assets between client and server I should check if net rendering is active for the document and if so only use the file part (
Filename::GetFile
) of the file to check if the Asset is in the project directory and if not request it using only that file part throughNetRenderGetFileFromServer
?So a possible implementation of the Asset lookup in the plugin code would look like this?
Filename filename = /* retrieved e.g. from HyperFile */ // Check if net rendering is active for document NetRenderDocumentContent * const context = doc->GetNetRenderDocumentContext(); if (context != nullptr) { // net rendering: check if file is missing in project directory if (!GeFExists( doc->GetDocumentPath() + filename.GetFile() ) { Filename fnNet; // request file from the server if (NetRenderGetFileFromServer(context->_service, filename.GetFile(), fnNet) { // use path returned by NetRenderGetFileFromServer filename = fnNet; } else { // handle error case } } else { // use the file in the project directory filename = doc->GetDocumentPath() + filename.GetFile(); } } else { // no net rendering: regular check if asset exists at path + error handling }
-
hi,
if I'm correct, you are trying to implement a NodeData plugin right?
On this node, you are doing some action based on files that you store inside your own structure and not any baselink? Those files must be considered as assets.
When you start a teamrender render, MSG_GETALLASSETS will broadcast to retrieve all the assets. You must react to the message so your assets will be collected. See this manual for more information.
While collecting those assets, it can happen that assets have to be renamed if those assets share the same name but are in different directories. This will be done using MSG_RENAMETEXTURES. In that case, RenameTextureMessage will be sent as data and you will have to update the assets filename of your NodeData, either the baselink or your structure.Once collected, all the assets will be in the same directory as the .c4d file.
Now the client will open the project and will try to retrieve the asset, it could happen that the message MSG_RENAMETEXTURES will be triggered again.
Your code should work if the filename you retrieve from the hyperfile is updated.
Cheers,
Manuel