blender zip is shared here:
here, below a small tutorial how I created objects in all orientations.
Create your object, (usually) within the confines of a block (i.e. mossy or bluegray object)
In this case the object (ring) was resized/positioned to lie within the alcove of the mossy_inset object.
When happy with the result I do the rendering, which requires four copy/paste actions.
First In the blender python console: I copy/paste:
import os
#adapt these:
dungeon_dir = 'P:\\ath\\to\\PyTFall\\game\\content\\dungeon\\'
# what objects you want to render, there can be multiple. These objects will be moved about.
tgts=["ring"]
# a tag to append to the folder name
tag="ring"
# the light indication to use in the folder name, either '' (dark) or '_torch' (light)
light=''
# Also make sure that only for the objects below the `camera' is set (in outliner - to ensure these are rendered only)
# - the object you want to draw (here: ring)
# - Camera
# - The light you want to render (for the red stones: mossy_dark or mossy_light)
Next, to store the original locations of the to-be rendered objects:
sc = bpy.data.scenes["render"]
bpy.context.screen.scene = sc
origloc = {}
for obj in sc.objects:
if any(obj.name[:len(t)] == t for t in tgts):
origloc[obj.name] = [obj.location[0], obj.location[1]]
Then copy/paste code below to start the rendering. This takes a while and blender seems to stall. There should be files created in your output folder. In case you want to stop it, create a file named 'blender_break' in your dungeon_dir. Blender stops right after the next image.
distal = {"b": 2, "c": 4 }
for depth in range(0, 6):
y = (depth-1)*2
for side in ["left%dc", "left%db", "left%d", "front%d", "right%d", "right%db", "right%dc"]:
x = 2 if side != "front%d" else 0
dir = dungeon_dir
if os.path.isfile(dir+"blender_break"):
continue
filename = os.path.join(dungeon_dir + tag + light, "dungeon_" + tag + light + "_" + side % depth)
if os.path.isfile(filename+".png"):
print(filename+" exists")
continue
if x:
if side[-1] in distal:
v = distal[side[-1]]
if depth < v:
continue
x += v
if side[:4] == "left":
x = -x
for obj in sc.objects:
if not obj.name in origloc:
continue
if x:
if side[:4] in obj.name:
obj.hide_render = True
obj.hide = True
continue
elif "left" in obj.name or "right" in obj.name:
obj.hide_render = True
obj.hide = True
continue
obj.hide_render = False
obj.hide = False
obj.location[0] = origloc[obj.name][0] + x
obj.location[1] = origloc[obj.name][1] + y
bpy.context.screen.scene = sc
bpy.context.scene.objects.active = obj
obj.select = True
bpy.data.scenes["render"].render.filepath = filename
bpy.ops.render.render(write_still=True)
And finally, to restore the image to the original state, copy/paste:
sc = bpy.data.scenes["render"]
bpy.context.screen.scene = sc
for obj in sc.objects:
print(str(obj.name))
if not obj.name in origloc:
continue
if "left" in obj.name or "right" in obj.name:
obj.hide_render = True
obj.hide = True
continue
obj.hide_render = False
obj.hide = False
obj.location[0] = origloc[obj.name][0]
obj.location[1] = origloc[obj.name][1]
bpy.context.screen.scene = sc
bpy.context.scene.objects.active = obj
obj.select = True