FaceFX Commands - render
The render command is used to save out an image of the Ogre scene.
| Flag | Long Flag | Arg | Description |
|---|---|---|---|
| -f | -file | Yes | Specifies the path to the output rendered image. The extention should be an image format that Ogre supports (.bmp, .png, .jpg, etc.) |
| -c | -camera | Yes | Specifies the name of the camera to use. Camera must exist. |
| -w | -width | Yes | The width of the viewport |
| -h | -height | Yes | The height of the viewport |
| -fsaa | -fsaa | Yes | Controls full screen anti aliasing. 0 for off, 1 for on (default off). |
Internally the render command calls Ogre::TextureManager::createManual
Examples
>>> render -camera "Front" -w 1024 -h 1024 -f "C:\FaceFXScreenGrab.png" -fsaa 1;
A python file like the one below could be used to render a movie:
# This will render out an uncompressed video. Because of the large size,
# it won't play back well until it's compressed with MovieMaker or something
# Similar. Currently you have to set some params up by hand like the camera
# name, etc. It uses a free program called EasyBMPtoAVI to combine the images
# into a movie.
#%exec -f "./../DevelopmentTools/RenderUtilities/render.py"
from FxStudio import *
from FxAnimation import *
import os
import time
timeRange = getVisibleTimeRange()
# We start the time at 0, not timeRange[1] because we want time 0 in the movie to correspond to time 0
# in the audio file, and negative time keys would prevent this.
animStartTime = 0
animEndTime = timeRange[1]
FPS = 24
pixelW = 512
pixelH = 512
camera = "Front"
# Copy audio and verify animation is selected
selectedAnimName = getSelectedAnimation()
if selectedAnimName[1] == "":
raise RuntimeError, 'No animation was selected, or no actor was loaded.'
selectedAnim = Animation(selectedAnimName[0], selectedAnimName[1])
command = "copy " + selectedAnim.absoluteAudioAssetPath + " " + outputWAV
print command;
os.system(command)
EasyBMPtoAVIFilePath = "C:\\Perforce\\FaceFx\\DevelopmentTools\\RenderUtilities\\EasyBMPtoAVI\\"
screenshot_folder = "C:\\Perforce\\FaceFx\\DevelopmentTools\\RenderUtilities\\screenshots\\"
os.system("mkdir " + screenshot_folder)
filebase = "fx_render"
screenshot_file = screenshot_folder + filebase
outputAVI = "C:\\Perforce\\FaceFx\\DevelopmentTools\\RenderUtilities\\output.avi"
outputWAV = "C:\\Perforce\\FaceFx\\DevelopmentTools\\RenderUtilities\\output.wav"
timestep = 1.0/FPS;
print timestep;
i = 0
t = animStartTime
paddedZeros = "000"
while t < animEndTime:
setCurrentTime(t)
t += timestep
if i > 9:
paddedZeros = "00"
if i > 99:
paddedZeros = "0"
if i > 999:
paddedZeros = ""
issueCommand('render -w "%s" -h "%s" -f "%s" -camera "%s";'%(pixelW, pixelH, screenshot_file + paddedZeros + str(i) + ".BMP", camera))
i += 1
i -= 1
command = EasyBMPtoAVIFilePath + "EasyBMPtoAVI -filebase " + screenshot_file + " -start 0 -end " + str(i) + " -framerate " + str(FPS) + " -output " + outputAVI;
print command;
os.system(command)
