Custom Tokens with Team Render Server
-
Hello,
our Cinema 4D plug-in is using custom tokens to generate the render path dynamically. When using Team Render Server for rendering, our tokens are not translated.
This is the render path we set in "Edit Render Settings":
/$collectionid/$layoutid/$cameraid/$itemidsThis is the path, where the rendering is put to:
results/$collectionid/$layoutid/$cameraid/$itemids.0001.pngWe expect the rendering to be put into the following path:
results/52/1/1/12345_54321.0001.pngIf we use "Render To Picture Viewer" in Cinema 4D, our custom tokens are translated correctly.
Also, if we use standard tokens (e.g. /$take/$res) in our project and render with Team Render Server.All machines have installed the necessary plug-ins installed correctly.
How can we use Team Render Server with our own tokens?
Thank you for your help.
Regards,
Janosch -
Hi @Janosch
Thanks for reaching us normally they should just work as a normal token, in fact, Cinema 4D ones are built the same way 3rd party does, so normally no difference should happen.
- Are they Python Or C++ Token?
- Are you sure your tokens are correctly registered even in Team Render Client by printing/logging the result of RegisterToken?
- Does your token is executed?
- Are you sure your token has everything it needs to works (I guess $layoutid work only on your custom scene)?
Thanks in advance,
Cheers,
Maxie. -
Hi,
I'll just chime in here, as I'm involved in that project, too.So the token hook needs to access certain elements of the scene to get their values, and the problem (thankfully) is easily reproducible.
I wrote a sample plugin that recreates the behaviour by simply returning data from the first object in the scene. Download it from our dropbox: tokenhookbug.zip
Here is the code:
This is the render setting in my example scene (which just contains a Cube):
Here is the render result in the Picture Viewer, notice the correct file name:
Uploading and rendering the file on TeamRender produces this:
The debugger clearly shows that
doc->GetFirstObject()
returnsnullptr
.Cheers,
Frank -
Hi, unfortunately, there is an issue in the Team Render Server that prevents your script to work were to speed up things on the team render side only render data are loaded first to setup stuff like filename.
Nothing that you can fix on your side.
I've opened a bug report about it.
I will keep you in touch.
Cheers,
Maxime -
Thanks for your reply! Too bad there's nothing we can do on our side to fix this. Is at least the document container loaded, so we could maybe store some information there before exporting saving the scene for TR use?
Cheers,
Frank -
@fwilleke80 Yes or the RenderData but that means the data needs to be there before the token evaluation which is done before any scene execution render wise.
Cheers,
Maxime