Netrender texture path

On 04/09/2013 at 06:28, xxxxxxxx wrote:

Hey guys,

I'm working on a plugin that automatically uploads c4d files to netrender which works fine. It uploads the same file multiple times with different settings.

Since On the netrender it needs one Tex folder for each file, the plugin has to upload all the textures for each version of the file all over again. If I have 6 gigabytes of textures and 5 versions of the same file to be rendered, the plugin uploads 30 gigs worth of textures, 5 duplicats of each texture.

To solve this problem i thought about only uploading the textures into the folder of the first version of the .c4d file on the netrender. I then upload following versions of the .c4d file and i change all the texturepaths so its nolonger just

fabric.jpg  (since its in the "tex" folder)


\\MACMINI\Macintosh HD\Netrender\user\administrator\filenameVersionOne ex\fabric.jpg

This way, all the different versions to be rendered refer to the same texture folder.

The problem is, that i can't find any way of formulating a path, that works on all the machines in the network. The machine hosting the administrator folder cant find \\MACMINI\Macintosh HD\Netrender\... since it's itself.

Does anyone have any ideas how to solve this or has someone even solved this before?

Help is always much appreciated!



On 04/09/2013 at 08:07, xxxxxxxx wrote:

1. I do not really understand your path problem, if you do change all bitmapshader file name 
paths to absolute paths instead of relative paths it would be just \\TEX_SERVER\...\filename.ext

2. But there is a more fundamental problem for python. DescLevel of DTYPE_FILENMAE are sort 
of broken in python (at least they were the last time I did check 2-3 month ago for R14). If you 
do try to iterate over a BaseShaders BaseContainder provided by GetData(), the interpreter will
raise NotImplemented exceptions for DTYPE_FILENAME DescLevels (and DTYPE_BUTTON too) 
which will stop the code execution.

To avoid that problem you will have to step manually through the container, instead of using the 
native python iterator approach (for item in bc:).  Using then exception safe code (try/except) 
allows you then to step over these problematic DescLevels. But as you want to replace those 
DTYPE_FILENAME levels you might be facing an unsolvable problem here. I cannot say for sure, 
as I was targeting BaseLinks and not file names.

I think the problem is BaseContainer instance specific and does not occur when you try to access
the BaseContainer with the BaseList2D itself (MyNode[SOMEID] = SOMEVALUE). So there might be a 
way around it using the BaseShader itself.

On 04/09/2013 at 11:43, xxxxxxxx wrote:

Hey littledevil,

Thanks once again 😉

I change all the paths like this:

  def recursiveShaderFinder(self, firstShader) :  
      if firstShader == None:  
          return []  
      shaderList = []  
      shaderList = shaderList + self.recursiveShaderFinder(firstShader.GetDown())  
      shaderList = shaderList + self.recursiveShaderFinder(firstShader.GetNext())  
   return shaderList  
   for material in materials:  
       firstShader = material.GetFirstShader()  
       shaderList = shaderList + self.recursiveShaderFinder(firstShader)  

My problem is however a different one.

Let's say you have 5 versions of the same .c4d file except a few little changes (e.g. different lighting or framgerange or tags)
You want to render all 5 with netrender.
You upload all five to netrender with save project with assets.  --> This works

BUT: You uploaded all the textures five times, once for each .c4d file. This is unnessecary.

I want to upload the textures only with the first c4d file. The following files should know, that the textures were allready uploaded and where to find them. If i can find a way to alter the texture path in the files that DO NOT have their own texture folder, so that no matter which machine renders the file it always works, it would save space on the server.

But such a way to write down a path doesn't exist i guess.

My second idea was this: Whenever a document is being opened that uses my plugin, the plugin is being initialized. if i can correct the wrong paths during the initialisation i can solve the problem as well. This works perfectly if i open the file with cinema 4d. But when i render with netrender the initialisation doesn't seem to work, or the netrenderclient doesn't initialize the plugin. Any ideas why this is the case?