[AddOn] Monster Tile Renderer (update 15-Aug-'12)

update 15-Aug-'12
Download (most up to date).

Read the Monster Wiki for documentation and instructions on how to use the Addon and how to automatically stitch the output together! Including a quickly coded GIMP plugin to auto-composite. Enjoy.

similar scripts:
macouno’s Really Big Renderer (not 2.5x yet), Implements PIL to autostitch
krypt77’s Render Regions (2.57), implements ImageMagick to do autostitching

Attachments


removed old code

Will give this a shot later, thanks!

Looks good, but if you could make the interface simply calculate the Wide, High and Enlarge behind the scenes it might be more intuitive. Just allow the user to specify a width and height in pixels and DPI instead. Then the script would figure out how to translate 9,000x12,000@300DPI into the correct width, height, enlarge equivalent.

Thanks for sharing!

Yeah, that sounds reasonable… i’ll think about a neat way to do it.
i’ll probably end up giving the option to specify in

|cm/inch/px| + |DPI|

Then it calculates the amount of tiles and other stuff as a function of the
largest maximum tile dimensions. Blender render engine won’t allow the a render wh of higher than 10000 * 10000. The tile approach essentially allows for any conceivable pixel wh.

It’s amazing that 40" at 300 DPI is 12,000 pixels in length. 12,000 pixels is not to be sniffed at.
especially if the the other dimension is 30" , that’s 9,000*12,000 pixels. (108000000 px total). I’ll have to find a way to test if PIL can create images that big. At that kind of size a printer will advise you to go with a lower DPI image (150)

here’s a start to that code


# GPL 2 License 2011 Dealga McArdle July 12

import math

CMINCH = 0.393700787    # 1 centimeter = 0.393700787 inch 
INCHCM = 2.54           # 1 inch = 2.54 centimeters

# or whatever your machine can handle comfortably
largest_tile_dimension_wide = 1000
largest_tile_dimension_high = 1000

def get_pixels(mode, width, height, DPI):
    '''
    Takes realworld width, height and DPI to produce raster equivalent

    arguments   :   Description
    ------------------------------------------------------------
    mode        :   (string) ['CM','INCH'], prepares functions for input values
    width       :   (float) or int value for the real world measurement
    height      :   (float) or int value for the real world measurement
    DPI         :   (int) to declare what DPI you are aiming for.

    returns     :   by valid input:
                    cells_wide, cells_high, total_px_width, total_px_height

                    by invalid input: returns None
    '''
    
    if mode == 'CM':
        width_in_inches = width*CMINCH
        height_in_inches = height*CMINCH
    elif mode == 'INCH':
        width_in_inches = width
        height_in_inches = height
    else:
        print("mode must be 'INCH' or 'CM'")
        return None
    
    print("width", width, "x height", height, mode, "| DPI", DPI)
    if mode == 'CM':
        print("width", width_in_inches,"(inches)")
        print("height", height_in_inches, "(inches)")
        
    print("
at", DPI, "DPI that gives: ")

    # [ ] todo verify if rounding up here is cool   
    w_in_px = width_in_inches*DPI
    h_in_px = height_in_inches*DPI
    w_in_px = math.floor(w_in_px)   
    h_in_px = math.floor(h_in_px)
    
    print("Width", w_in_px,"px. Height", h_in_px, "px")

    # determine number of tiles wide / high
    cells_wide = math.ceil(w_in_px / largest_tile_dimension_wide)
    cells_high = math.ceil(h_in_px / largest_tile_dimension_high)
    px_wide_per_tile = math.floor(w_in_px / cells_wide)
    px_high_per_tile = math.floor(h_in_px / cells_high)
    
    print(cells_wide, "tiles wide, at", px_wide_per_tile, "px wide")
    print(cells_high, "tiles high, at", px_high_per_tile, "px high")
    return cells_wide, cells_high, w_in_px, h_in_px
    
get_pixels('INCH', 100, 240, 300)

    


Not thoroughly tested yet. This version does not allow you to control the number of tiles, but it allows you to define the maximum width/height in pixels of a tile, and the destination dimensions in px/cm/inch. In Metric and Imperial mode it asks for DPI too.


http://digitalaphasia.com/code/BlenderPython/monster_tile_v3_003.py
the tilestitcher script will work without modifications.

Hello, Zeffii!
Very helpful script for those who wants to render something for a big print :slight_smile: And it will help me a lot now because I don’t want to manually border-render then combine all pieces.
Will you update your script? I tried to use it with Cycles (on 2.61) and it seems that it’s not working.
Thank you in advance!

I found some errors. Hope you’ll fix it.

[ATTACH=CONFIG]171560[/ATTACH] - the script renders four exact shots and these shots are NOT from this .blend. Actually it’s some older (already rendered) shot. I don’t know how but it looks like the script just copied it.
It’s the console:


[ATTACH=CONFIG]171561[/ATTACH]- The result must be this shot but in 2500x2500 resolution (or 4 tiles so I’ll stitch it further).


Probably I got the thing: Monster Tile takes other file from other folder! Actually I can’t understand how it finds it.
I placed all working files in …render6/
But it takes some (maybe some cache from another .blend? weird… really don’t understand) other file from …render5/
this picture (it’s first here) wasn’t last or first (neither by name neither by time), it’s .blend also wasn’t last or first. Looks like it copies this picture because I remember it must render in 4 minutes (40 passes, I wrote that in the file’s name).
wheel_try6_2_40p_4mins.png - it’s the name.

Another thing. First time I didn’t matched “Output” (general) to the path in Monster Tile panel. And it did gave me this error:


Please, fix it and you’ll help us a lot :spin:

Thanks anyway.
P.S. I’ll help you to test your script. Will be on touch here.

Great Script. I just made Tile NetRender by replacing Render with Netrender send:

Line 197: # this is candidate for setting up a progress tracker

    #OWN HACK
    bpy.ops.wm.save_mainfile() 
    bpy.ops.render.netclientsendframe()    
        
    #bpy.ops.render.render()

    RR = "Render Result"
    mypath = usedir+filename+"_"+cell+filetype
    #bpy.data.images[RR].save_render(mypath)
    print("rendered", cell+filetype)

Since you know you Code, and it really should be simple, would you implement this Feature?

This has great Potential! Imagine 20000*20000 Image Render on a few machines…

Auto Stitcher not working in my case. I installed the script in Blender 2.63a but it isn’t working

Thanks Bashi for the heads up, i haven’t used this script since the last update and i have no idea how many people use it. If your suggestion is easy to implement I will include it in a more formal release.

Thanks tahseen, i’ll look at it too.

Zeffii,

Really sorry I thought AutoStitcher is an Addon to Blender 2.63a. Which is isn’t. It is a standalone program and I realized it when I opened it in an editor.

There wasn’t any note on it so I was stuck

So just that for novice steps on how to use it is required. It is a great script.

Steps

  1. Install python 2.7
  2. Search PIL on google and download the installer. Install it. (for beginners - it is Python Image Library)
  3. If you are in Windows, edit the Stitcher file and change the path to images to “C:\MyPath\Subfolder”

Note that in Windows, you would have to use \ and no long names with spaces.

  1. Please note that the stitcher python file should not be kept inside this subfolder. Else apart from PNGs, the program reads itself also as a PNG file and gives error.

Script is amazing and does terrific work

Thanks a ton Zeffi. There is no software like this on net :slight_smile: You are a great coder :slight_smile:

Running Monster on a recent build of 2.63 crashes blender so some debugging/API checks will be necessary as soon as time becomes available.

The github repo has a second stitcher script that works only on py3k, at the time of writing new PIL libraries had become available (tho maybe still not official builds).

am using Blender 2.63a and it works fine. Infact I rendered an image of 30,000 x 15,000 resolution and used your stitcher to get the final composite image :slight_smile:

Cool, nice to know people are using it to create gigantic renders! If you do big prints i’d love to see pictures of them out in the wild!

I’m running my own build Blender 2.63.13 r48460 and it definitely crashes blender. Thanks for the short tutorial, i’ll incorporate it into the github readme.

If you can provide me an FTP, I can upload it there and you can see it.

I created one, which is 6,000 x 3,500 and the file size is 4MB. This one is getting used for an upcoming Indian movie poster :slight_smile:

Another I created is 20,000 x 10,000 and file size is 30MB. This one is difficult to open with normal Photo Viewers.

Ziffii

Just a correction for windows path has to like “c:\myfolder\subfolder\”

means at the end also there has to be an “\” because your script appends file name after it. If there is no “\” at the end of the defined folder path, then it would concatenate incorrectly.

I will edit the text I wrote above

tahseen, i was hoping you could send me a picture of the poster on the street: like http://www.flickr.com/photos/59092439@N05/5421214889

As soon as i get Monster to run on the latest builds of blender i will be able to clean it up. Keeping the stitcher separate is probably a slight inconvenience for most people, but with the correct documentation it might be a little less mystical.

Zeffi,

The movie is yet to be launched. The prints have been taken out but they haven’t been put up on the hoarding boards yet. The moment it is done, I myself would personally go and take a snap for you and share it with you :slight_smile:

I used this one https://github.com/zeffii/Monster_Tile_Renderer
Blender 2.63a and Windows 7 OS

Let me know if you are facing any problem.