4
$\begingroup$

I am trying to setup network render with cycles as the rendering engine. My use involves rendering hundreds of images and I have already written logic for it in python which is working fine on single pc. Now I have bought 6 more pc's and I need to utilize their capacities as well.

I have setup master, client and slaves already. I am changing the material and texture from script directly. But these changes are not working when doing network render. When I ran it the first time, there was no error but all the rendered images have same texture (the one I applied last using script). The subsequent renders were giving me the following error

Traceback (most recent call last):
  File "<blender_console>", line 55, in <module>
  File "C:\Program Files\Blender Foundation\Blender\2.74\scripts\modules\bpy\ops.py", line 189, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: timed out

Then I cleared the blender temp directory, and the error changed to the following

Traceback (most recent call last):
  File "<blender_console>", line 55, in <module>
  File "C:\Program Files\Blender Foundation\Blender\2.74\scripts\modules\bpy\ops.py", line 189, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Error: RE_result_rect_from_file: failed to load 'C:\Users\Admin\Desktop\gse\output.exr'

Changing the temp directory also didn't help and same error occurred. Closing all slaves, client and master instances and starting them again only removes the error, but then again all outputs are same. I don't know what to do. I would be glad if someone could point out the issue, my script is pasted below

    import bpy, sys, os ,mathutils, glob
    from math import radians

parentFolder = "Z:/networkRenderTest/"
baseFolder = "Y:/"

#bpy.context.scene.render.engine = 'CYCLES'
bpy.context.scene.render.resolution_x = 1280
bpy.context.scene.render.resolution_y = 720
bpy.context.scene.render.resolution_percentage = 100
bpy.context.scene.cycles.samples = 500
bpy.context.scene.cycles.device = 'CPU'     # make it ‘CPU’ for cpu and 'GPU' for gpu
bpy.context.scene.file_format = 'JPEG'
bpy.context.scene.color_mode = 'RGB'
bpy.context.scene.quality=95

materials = ["Material1", "Material2"]
outBaseFolder = parentFolder+"Renders/"

subFolders = ["Material1Folder/", "Material2Folder/"]
textureFolders = [[904,906,907,909,912], [803,807,809,810,812,814,815,831]]

config = '1'
category = 'test'

cushion = bpy.data.objects["cushion"]

for subfolder in subFolders:
    outFolder = outBaseFolder+subfolder
    if not os.path.exists(outFolder):
        os.makedirs(outFolder)
    if(subfolder == subFolders[0]):
        material = bpy.data.materials[materials[0]]
        textureFolder = textureFolders[0]
    elif(subfolder == subFolders[1]):
        material = bpy.data.materials[materials[1]]
        textureFolder = textureFolders[1]
    cushion.material_slots[0].material=material
    files = [os.path.basename(x) for x in glob.glob(baseFolder+subfolder+"*.jpg")]
    for texture in textureFolder:
            outImageName = outFolder+config+"_"+category+"_"+str(texture)+".jpg"        
            if os.path.isfile(outImageName):
                pass
            else:
                imgColor = bpy.data.images.load(filepath = baseFolder+subfolder+str(texture)+"/"+str(texture)+'_COLOR.png')
                imgNormal = bpy.data.images.load(filepath = baseFolder+subfolder+str(texture)+"/"+str(texture)+'_NRM.png')
                imgOcc = bpy.data.images.load(filepath = baseFolder+subfolder+str(texture)+"/"+str(texture)+'_OCC.png')
                imgSpec = bpy.data.images.load(filepath = baseFolder+subfolder+str(texture)+"/"+str(texture)+'_SPEC.png')
                material.node_tree.nodes["Color"].image = imgColor
                material.node_tree.nodes["Normal"].image = imgNormal
                material.node_tree.nodes["Oclusion"].image = imgOcc
                material.node_tree.nodes["Specular"].image = imgSpec
                bpy.context.scene.render.filepath = outImageName
                print(bpy.context.scene.render.filepath)
                bpy.ops.render.render(write_still=True)
#               bpy.ops.render.netclientsendframe()
$\endgroup$
  • $\begingroup$ no error messages? $\endgroup$ – zeffii Jun 6 '15 at 12:28
  • $\begingroup$ @zeffii I edited the question with error details $\endgroup$ – Anurag Jun 8 '15 at 13:44
  • $\begingroup$ consider using os.path.join() more for creating long paths, the manual concatenation of strings and slashes is prone to errors.. I question if 'C:\Users\Admin\Desktop\gse\output.exr' is even a valid filepath. See the path wiki for more info $\endgroup$ – zeffii Jun 10 '15 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.