Image Tile Script For MandelBulb 3D, Blender, and Photoshop

First, the files for the Image Tile Script.

Blender Addon: RenderTilesPanel.zip
Photoshop Script: compositeFromImageTilesWithZBuf_v3.0.2.zip

After downloading the image tile scripts, scan the zips for malware (but you were going to do that already, because you are smarter than the average user, aren’t you?) before you unzip them.

Installing the Blender Addon

For the Blender Addon, open Blender, go to User Preferences (File->User Preferences), go to the Add-ons tab, and click the Install From File button at the bottom of the window. Select the unzipped RenderTilesPanel.py file. When it is loaded, be sure to check the box to activate it. The panel will appear below the Render buttons in the Properties panel.

Installing the Photoshop Script

You can’t. At least, I don’t know how to install it so it just appears as a Script option. Yet. To run the script, open Photoshop. Then go to File->Scripts->Browse, and select the unzipped compositeFromImageTilesWithZBuf_v3.jsx file.

I figured out how to install it as a menu item. You will need to locate your installation of Photoshop on your computer. Copy the unzipped file to the Photoshop Presets Scripts folder. For me, that location is: C:\Program Files\Adobe\Adobe Photoshop CC 2015\Presets\Scripts. If you are running Photoshop already, you will need to close it, then run it again. This script should now appear in the File->Scripts menu.

That said, you could also create an Action to run the script. But, I’m not covering that process here. Go google it, if you need to. Go on. You can do it.

Render Tiles addon for Blender

So, I have been working on an image tile script for Photoshop. The purpose is to import image tiles that were created with Mandelbulb 3D’s Big Render process. I also wanted to make this script usable for image tiles that were created in Blender, using the Big Render addon.

However, when I tried to run the Big Render addon in Blender, I found that it no longer worked with my version of Blender. I do not know why. Maybe it is no longer compatible with the current version? Maybe I screwed something up in my setup? I don’t know. It just didn’t work for me. Now, I had to rewrite the addon for Blender. Not an easy task, since I have never written a Blender addon. I began with the old Big Render script, created by Marco Crippa. Had I been smart, I would have simply debugged his script. I am sure there is a very basic/easily fixable reason why it failed – and could very well have something to do with my own setup. But, I was intrigued by the prospect of making an addon, and went with the “lets recreate the wheel” approach.

My version is not as comprehensive ad Marco’s. It is basic and could have bugs that I have yet to identify. Basically, my addon gives you the option to slice up your scene into a grid of border renders. You can specify how may rows and columns into which the image is split. It does allow you to resume rendering at a specific row and column, if you ever need to cancel the render process (or if something interrupts the process) before it is complete. It saves the image tiles to the folder specified in the Output panel, names the files using the current .blend filename, and appends to the filename the XY coordinates of each border render. For my addon, I number the files such that X1Y1 is the top-left corner, proceeding left to right, top to bottom.

This addon does not allow for saving extra render information. It does not save out zbuf files. It does no compositing. It may not work with volume sampling (it may, but I have not yet tested that). Basically, this is the same as if you manually select a border render region and render that with the Border and Crop boxes checked. The only difference is that this addon automates the process along a grid of image cells, where you can tell it how many rows and columns make up the grid. It uses the resolution dimensions you specify. So, if you have a scene with the render dimensions of 1000×1000 pixels and specify 10 rows and 10 columns, each tile will render at 100×100 pixels.

I have not yet figured out a way to cancel the render process. So far, the only way to cancel it is to end-task Blender. So, user beware, and all that.

The Photoshop Script

The Photoshop script was a bit of a pain. Actually, it was a pain because of an issue I had creating the Blender addon. The problem was the way in which Blender was slicing up the scene. You would think that given any number of rows and columns, Blender would create the image tiles all of equal width and height. That is not always the case. Some of the images would be a pixel or two smaller, along one of the dimensions. I *think* there are two reasons for this. First, not every number of pixels can be evenly divided by every integer. For example, you don’t get an even number of pixels if you divide 1000 by 13. Second, I rediscovered an old problem with floating point values. For example, 1/20 equals 0.05. However, in Python, it may equal 0.0500000000000000001 (or something to that effect, depending on the decimal precision).

Whatever the reason(s), I could never guarantee that all the image tiles would be exactly the same width and height, no matter what approach I took. So, I had to rewrite my previous Photoshop script to account for image tiles that may not all be the same width and height. It still assumes the tiles are the same dimensions, if you are importing sequentially numbered files (image0001.png, image0002.png, …image000n.png). But, if you are importing image tiles that have XY numbering (imageX01Y01.png, imageX01Y02.png, …imageX0nY0n.png), it now assumes that there is at least a chance that the image tiles are not all the same size.

So, run the script, select your image tiles (and ZBuf tiles, if you are importing images created with Mandelbulb 3D Big Render), tell it to Attempt To Align the Source Images, tell it how many rows and columns it should expect, optionally tell it to make Smart Objects, click OK, and watch it go.

Compatibility

The Blender Addon has been tested with Blender version 2.76. It may or may not work with older or newer versions of Blender.

The Photoshop script has been tested with the November (or was it December?) release of Photoshop CC 2015. It may or may not work with older or newer versions of Photoshop.

Feedback

Have suggestions for improvements? Found a bug? Let me know in the comment section below.