But I need the frame number as a 3D text object, not as a flat bitmap burned into the render.
I’m no programmer, and have never used Python before - is this difficult?
Thanks,
Tom
PS
The reason for this is: I’m trying to create a series of bar graphs, where each frame will indicate some data in a graph (eg frame 1 = 1% and a small bar, frame 100=100% and a large bar). If I could put the frame number above the bar graphs it would look really nice.
Following script sets current frame to text object:
import Blender
from Blender import Text3d, Scene, Window
from Blender.Scene import Render
inEmode = Window.EditMode()
if inEmode: Window.EditMode(0)
scn = Scene.GetCurrent()
ctx = scn.getRenderingContext()
txt = Text3d.Get("Text")
curframe = ctx.currentFrame()
txt.setText(str(curframe))
Window.EditMode(0)
Window.EditMode(1)
if not inEmode:
Window.EditMode(0)
Blender.Redraw()
Edit as needed.
<edit> I made a tiny example of its usage. See http://bebraw.googlepages.com/animtest08.blend . Enable script links and make sure the text object is selected. Note that it does not work in 2.45 due to a bug. It works in SVN version though as it has been fixed. </edit>
That’s really great, thanks - it gave me enough to get going… I looked at some other scripts and added a loop so that each frame would render one by one, then put the number from that loop into the text element… It’s probably a really ugly way of doing it, but it seems to work:
import Blender
from Blender import *
from Blender.Scene import Render
inEmode = Window.EditMode()
if inEmode: Window.EditMode(0)
scn = Scene.GetCurrent()
context = scn.getRenderingContext()
ctx = scn.getRenderingContext()
txt = Text3d.Get("Text")
curframe = ctx.currentFrame()
for i in range(10):
txt.setText(str(i))
Window.EditMode(0)
Window.EditMode(1)
if not inEmode:
Window.EditMode(0)
Render.EnableDispWin()
context.extensions = True
context.renderPath = "//myRenderdir/"
context.sizePreset(Render.PAL169)
context.imageType = Render.TARGA
context.fps = 15
context.sFrame = i
context.eFrame = i
context.renderAnim()
Render.CloseRenderWindow()