Blenderfarm

Hi JA-forreal, any updates would probably just to remove image splitting and just share frames.
Image splitting into tiles is tricky but not that usefull (unless your doing print res raytracing)
Most people just want to seperate frames of an animation over multiple PC’s

Sounds great. I will keep an eye out for your updates. Again, thanks!

hi! has any of you see improvement on rendering speed with the script? I cant try myself for the moment as i have some problems with my hardware.

also does it work with yafray?

This script wont be updated (unless someone else wants to)
Best focus on getting commend line args for border rendering and render out tiles from that. - for splitting an image across multiple PC’s

Only bad side to that it it has to load the blend for each tile.

I tried rendering over 2 p4 @ 2.8gh and an amd 4400x2 and I think it is great and it works ok with Yafray. how can I see the whole render as a single image, i can see only the tiles. also after rendering i get a file “(scenename).done”

I hope I’m not bothering with my questions

To view the whole image, the script offers a “view rendered tiles” menu topic. Then the tiles will be composed to the final image. (This may take a while.)

The RenderManiac

does this script work with 2.42? if so I might take a poke at it… and make some updates

It seems to work also with 2.42, although I have just rendered a quick test (just a single scene). I don`t know if it is a special problem of 2.42 or a windows-python problem, but I had to adjust the script as the “view rendered tiles” option had a path problem.

Updates would be for sure a great idea (the compositing of the final image is quite slow[on my pc ;)]), but I have doubts that it is possible with python to integrate the script deeper in blender. Please see also my thread:
http://blenderartists.org/forum/showthread.php?t=72927
and
http://www.blender3d.org/forum/viewtopic.php?t=9336&sid=da3b3f1f2bd40d2efcddb0b7849d232f

The RenderManiac

RenderManiac could you post the adjusted script?

BTW- is anyone else keen on maintaining this script? - it has its uses but not somthing Im interested in at the moment.

Well i’ll give a try to convince my sister :smiley: to have a look to the script but she has exams for the moment so there is no free time. Unfortunatly i have no idea about programming so it will be to difficult for me to do anything alone except if there was explanatory text next to each code line:D.
any resources about how this script works for blender would be very helpfull.

Ok, here is the modification to the script:
(But you should use it only if you have path problems when trying to view the final image, btw, use it on your own risk). As the whole script seems to be too big, I have just pasted the part which I modified:


#=======================================================#
# General composite function, could be used anywhere    #
# allows us to view all the tiles without any           #
# external libs such as PIL or Imlib, tho it would be   #
# A goog idea if it tried to use these first.           #
#=======================================================#
def composite(imgList, outImage, size):
    oldscene = Scene.GetCurrent()
    oldcam = oldscene.getCurrentCamera()
    
    # Make an image list from imgList with blender images in it.
    blender_imgList = []
    for imagefile in imgList:
        imagefile = sys.expandpath(imagefile)
        # Load images or reload images if they are alredy loaded.
        exists = 0
        for i in Image.Get():
            if sys.expandpath(i.filename) == imagefile:
                exists = 1
                i.reload()
                image = i
                break
        if exists == 0:
            image = Image.Load(imagefile)
        
        blender_imgList.append(image)
        
    # Use the first image size if none given.
    if None in size:
        size = blender_imgList[0].getSize()
    
    scene = Scene.New('BlnederFarm')
    #Window.CameraView(1)
    # Setup the render context
    context = scene.getRenderingContext()
    
    xaspect = yaspect = 1 # we need to set the aspect
    if size[0] == size[1]:
        pass # x and y aspects are the same.
    elif size[0] > size[1]:
        # Width greater then height
        yaspect = size[1] / float(size[0])
    else: # size[0] < size[1]:
        # Height greater then width
        xaspect = size[0] / float(size[1])
    
    context.enableRGBAColor() # Save RGBA
    context.setImageType(Scene.Render.PNG) # Save RGBA 
    context.enableExtensions(1)
    context.setRenderPath(outImage) # // is the currentdir
    context.partsX(1)
    context.partsY(1)
    # context.setRenderPath("C:/myRenderdir/")
    
    #frame = Blender.Get( 'curframe') 
    context.startFrame(1)
    context.endFrame(1)
    
    context.imageSizeX(size[0])
    context.imageSizeY(size[1])
    
    Vec = Blender.Mathutils.Vector
    
    print 'compositing', len(imgList), 'images'
    for image in blender_imgList:
        # Make a new mesh
        ob = Object.New('Mesh')
        me = Mesh.New()
        ob.link(me)
        scene.link(ob)
        
        mat = Material.New('alphamat') # each alphamat must be unique. dont try re-use alphamat.
        
        mat.mode |= Material.Modes.ZTRANSP
        mat.mode |= Material.Modes.SHADELESS
        mat.setAlpha(0.0)
        
        
        # Texture
        tex = Texture.New()
        tex.setType('Image')
        tex.image = image
        tex.imageFlags |= Texture.ImageFlags['USEALPHA']
        
        # Should be faster without these.
        tex.imageFlags &=~Texture.ImageFlags['INTERPOL']
        tex.imageFlags &=~Texture.ImageFlags['MIPMAP']
        
        mat.setTexture(0, tex)
        mtex = mat.getTextures()[0] # we know theres only one.
        mtex.mapto |= Texture.MapTo['ALPHA']
        
        me.materials = [mat]
        
        me.verts.extend([\
        Vec( xaspect,-yaspect,0),
        Vec( xaspect, yaspect,0),
        Vec(-xaspect, yaspect,0),
        Vec(-xaspect,-yaspect,0)])
        me.faces.extend( me.verts[0], me.verts[1], me.verts[2], me.verts[3] )
        me.faceUV = 1
        me.faces[0].uv = (Vec(0,0),Vec(1,0),Vec(1,1),Vec(0,1))
    
    

The one and only modification I have done, is to delete a “//” in the line:
context.setRenderPath(’//’ + outImage) # // is the currentdir

But there are still some path problems: If the scene is called for example “xxxx_xx.V1.2.blend” then there is a different path error.
Also I have noticed some crashes if I try to view/composite the picture immediatly after a rendering on the same (master) node. And there are problems with image maps (they are missing in the rendered image).

The script is quite nice, but I think we need a seamless network rendering feature!

The RenderManiac

Hey, just a note that Iv updated for blender 2.43, sombody requested recently.
http://members.optusnet.com.au/cjbarton/blenderfarm.py

has anyone tested this with blender 2.45 ?

Sorry to bump, but I’d really love to be able to use this seemingly awesome script. But I get an error (mac os X leopard, blender 245):

File “<string>”, line 695
renderFiles.extend(ff for ff in renderFiles if ff.startswith(key))
^
SyntaxError: invalid syntax

Anyone?:eyebrowlift2:

Hi Blenditall, fixed the problem with python 2.3 and did some updates for blender 2.45

http://peach.blender.org/wp-content/uploads/movies/blenderfarm.py

Sweet! The script runs :slight_smile:

Another problem though (I don’t know much about networks, since I only have two computers as of 2 weeks).
I have a mac and a pc connected via router. I need all the rendered files stored on the mac, so I have a directory created. But how would I go about navigating to this directory from blender on the pc?
I’m awfully confused atm… I have a feeling I’ll have learned a lot by the time this ‘farm’ is set up (I’ll try to add more pcs later).

Thanks in advance for any insight.

Its pretty simple, as long as both computers can access the same filesystem you just point them to the same directory - so samba or nfs would work fine.

Thank you ideasman42
I have just finished getting your script running on a couple of my computers, running 2.49, and it works! I literally started jumping and singing with joy when I saw my scene rendering on the other computer. Very Exciting! Now i can work on my ibook and send jobs to my farm pc’s. I’m still learning blender so I’m still playing with the lighting effects and how things look rendered, so its very helpful to be able to use this script.

I have one question though, and that is:
Is there a setting in the code I can change in order to keep the background from being made transparent in the final image??

I get the anti-aliased edge around the object fading to blue so it’s like a blue border against a black (transparent) background in the composited image. I noticed when rendering, the pieces are rendered properly with the blue background, so I think the background alpha is being neglected during composite?. Instead of having to turn off anti-aliasing or putting the render in a big box, I’d like to be able to maintain my background in the final render. Can someone or the master ideasman42 himself please help? I know everyone’s busy with 2.5 but this script is close to being perfect for me. Seem’s like a simple enough fix to keep the background alpha.

Thanks!
/Tim