You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For reference, here's the old script for 2.49. It looks for an object named "RenderPlatform", rotates it 45 degrees, then renders the animation (output files named appropriately). This continues until the animation is rendered in all 8 directions.
import Blender
from Blender import *
from Blender.Scene import Render
pi = 3.14159
deg45 = 45 * pi / 180
context = Scene.GetCurrent().getRenderingContext()
basePath = context.renderPath
for i in range(1,9):
# objects without parents should be parented to RenderPlatform
platform = Object.Get('RenderPlatform')
platform.RotZ = platform.RotZ - deg45
platform.setLocation(platform.getLocation()) # refreshes the child locations
context.renderPath = basePath + str(i)
context.renderAnim()
Blender.Redraw()
context.renderPath = basePath
The goal of the script is to render sprites (e.g. character animations) in 8 directions isometric view. Objects are parented to the empty object RenderPlatform so that the scene can be rotated easily (rotate that parent object and the whole scene is facing the right direction). In future uses I probably want to only rotate cameras and lights while leaving the rest of the scene in place.
The text was updated successfully, but these errors were encountered:
from math import pi
# get current selected object
obj = bpy.context.object
help(obj)
...
help(obj.rotation_euler)
...
help(obj.rotation_euler.rotate)
# or maybe just...
help(bpy.ops.transform.rotate)
importbpyfrommathimportradiansangle=45axis=2# z-axisplatform=bpy.data.objects["RenderPlatform"]
original_path=bpy.data.scenes[0].render.filepathforiinrange(0,8):
# rotate the render platform and all childrentemp_rot=platform.rotation_eulertemp_rot[axis] =temp_rot[axis] -radians(angle)
platform.rotation_euler=temp_rot;
# set the filename direction prefixbpy.data.scenes[0].render.filepath=original_path+str(i)
# render animation for this directionbpy.ops.render.render(animation=True)
bpy.data.scenes[0].render.filepath=original_path
For reference, here's the old script for 2.49. It looks for an object named "RenderPlatform", rotates it 45 degrees, then renders the animation (output files named appropriately). This continues until the animation is rendered in all 8 directions.
The goal of the script is to render sprites (e.g. character animations) in 8 directions isometric view. Objects are parented to the empty object RenderPlatform so that the scene can be rotated easily (rotate that parent object and the whole scene is facing the right direction). In future uses I probably want to only rotate cameras and lights while leaving the rest of the scene in place.
The text was updated successfully, but these errors were encountered: