CodemanX,
I appreciate the response. I guess I would prefer to whatever API is the most stable. If the operators change from version to version, then I agree I shouldn’t use them. If the low level API is less stable then operators then I’d think I’d be better off using them. I’m too new to blender to know the history on that. I’m not particular concerned with the speed since this isn’t a runtime/real-time sorta thing but something that is run once at user command to set up the animations. I guess if I were to run this script on an entire paragraph then I would be more concerned. But your point is well taken.
I tried your suggestion, and I was finally able to get it to work. Here is my script in case anybody wants to try it out:
import bpy
import math
def createFrameAt(frame):
[INDENT=2]markers = bpy.context.scene.timeline_markers
m = markers.new("")
m.frame = frame
bpy.context.scene.frame_current=m.frame [/INDENT]
selected=bpy.context.scene.objects.active
location=selected.location
dimensions=selected.dimensions
bpy.context.scene.cursor_location=(location.x,location.y+dimensions.y,location.z)
bpy.ops.object.origin_set(type=‘ORIGIN_CURSOR’)
camera=bpy.context.scene.camera.location
bpy.data.scenes[“Scene”].tool_settings.use_keyframe_insert_auto=True
initialFrame=bpy.context.scene.frame_current
frameOffset=initialFrame
bpy.ops.object.convert()
bpy.ops.mesh.separate(type=‘LOOSE’)
createFrameAt(frameOffset)
initialAngle=math.atan( (camera.z-location.z)/(camera.y-location.y) )
bpy.ops.transform.rotate(value = initialAngle, axis=(1,0,0))
selected=bpy.context.selected_objects.copy();
last=selected.pop()
selected.insert(0,last)
bpy.ops.object.select_all(action=‘DESELECT’)
for x in selected:
[INDENT=2]x.select=True
createFrameAt(frameOffset+2)
bpy.ops.transform.rotate(value = -initialAngle, axis=(1,0,0))
createFrameAt(frameOffset+4)
bpy.ops.transform.rotate(value = 10*math.pi/180, axis=(1,0,0))
createFrameAt(frameOffset+8)
bpy.ops.transform.rotate(value = -15*math.pi/180, axis=(1,0,0))
createFrameAt(frameOffset+10)
bpy.ops.transform.rotate(value = 5*math.pi/180, axis=(1,0,0))
x.select=False
frameOffset=frameOffset+2[/INDENT]
bpy.context.scene.frame_current=initialFrame
bpy.data.scenes[“Scene”].tool_settings.use_keyframe_insert_auto=False
To use it, add some text (all caps looks best, I think), select it, and then run this script. I also think it’s looks best if you make the camera straight above the grid, pointing right down at it. (so at like (0,0,10) rotated (0,0,0))