Gravedigger or anyone for this matter,
Look at the #rmanOutputDelayedReadArchive.mel# I attached above.
I’m thinking the script could be causing the problems. My sequence is 240 frames. I sense he made this script for the use of looping.
If I’m seeing this correctly is it possible to alter this script to make it just render out the explicit frames instead of adding an offset or extra stuff?
**To batch render my scene I have to run batchRenderRI in the mel command. If it helps here’s the python script batchRenderRI calls.
# Refer to www.fundza.com/rms/batching/index.html for more
# details about this script and its used with Maya.
# Malcolm Kesson (Feb 29 2008)
import re, sys, os
#-----------------------------------------------------
def convertToWindows(linuxpath):
pattern = re.compile(r"/")
return pattern.sub(r'\\', linuxpath)
#-----------------------------------------------------
# Given the relative path to a beauty pass rib file this proc
# returns the relative path of its primary image. For example,
# getImagePath("renderman/untitled/rib/0001/perspShape_Final.0001.rib")
# might return,
# "renderman/untitled/images/untitled.0001.iff"
#
def getImagePath(beautyRib, projectPath):
f = open(os.path.join(projectPath,beautyRib), 'r')
lines = f.readlines()
for line in lines:
if line.strip().startswith("Display "):
tokens = line.split('"')
path = tokens[1]
if path.startswith("+") == False:
return path
f.close()
#-----------------------------------------------------
# Given the relative path of an image this proc will substitute
# the numberic extension with a single "#" (pound) symbol. For
# example,
# replaceNumericWithPound("renderman/untitled/rib/0001/perspShape_Final.0001.rib")
# would return,
# renderman/untitled/rib/0001/perspShape_Final.#.rib
# This makes the path useable within a Shake script.
#
def replaceNumericWithPound(imagepath):
parent,name = os.path.split(imagepath)
pattern = re.compile(r"[.]\d+[.]")
name = pattern.sub(r'.#.',name)
return os.path.join(parent,name)
#-----------------------------------------------------
# Given the name of a scene this proc returns a list of the
# relative paths of the beauty ribs. For example,
# getListOfBeautyRibs("untitled")
# would return say,
# renderman/untitled/rib/0001/perspShape_Final.0001.rib
# renderman/untitled/rib/0001/perspShape_Final.0002.rib
# etc...
#
def getListOfBeautyRibs(scene, projectPath):
outList = [ ]
targetRibDir = "/renderman/" + scene + "/rib"
targetSubDirs = os.listdir(projectPath + targetRibDir)
# There are many rib files but a beauty pass rib can be
# identified by the text "_Final" in their name.
pattern = re.compile(r"_Final")
for subdir in targetSubDirs:
# Rib sub-directories are named with 4 digits
if len(subdir) == 4:
ribs = os.listdir(projectPath + targetRibDir + "/" + subdir)
for rib in ribs:
ribpath = targetRibDir + "/" + subdir + "/" + rib
if pattern.search(ribpath, 1):
outList.append(ribpath)
return outList
#-----------------------------------------------------
# Given the name of the scene and a path to the users project
# this proc returns a list of paths to the, what might be
# the "root" rib files. The "root" ribs are those with four
# digit names, for example,
# renderman/untitled/rib/0001/0001.rib
# renderman/untitled/rib/0002/0002.rib
#
def getListOfRootRibs(scene, projectPath):
outList = [ ]
targetRibDir = "renderman/" + scene + "/rib"
targetSubDirs = os.listdir(projectPath + targetRibDir)
for subdir in targetSubDirs:
if len(subdir) == 4:
ribpath = targetRibDir + "/" + subdir + "/" + subdir + ".rib"
outList.append(ribpath)
return outList
#-----------------------------------------------------
# Writes a batch list for rendering with prman. For example,
# prman FULL_PATH/renderman/untitled/rib/0001/0001.rib
# prman FULL_PATH/renderman/untitled/rib/0002/0002.rib
# ditto...
# This proc also appends a call to run a shake script (refer
# to the next proc) that will automatically read the rendered
# images into a FileIn node. This allows the image sequence
# to be viewed in a Shake flipbook
#
def makeBatchFromList(batchName, projectPath, ribList):
batchPath = os.path.join(projectPath,batchName)
f = open(batchPath, 'w')
if os.name == "posix":
f.write("source /etc/profile
")
else:
f.write("SET
")
trimmedPath = projectPath[:len(projectPath) - 1]
if os.name == "nt":
projectPath = convertToWindows(projectPath)
trimmedPath = convertToWindows(trimmedPath)
f.write("cd " + trimmedPath + "
")
for rib in ribList:
if os.name == "nt":
rib = convertToWindows(rib)
f.write("prman " + os.path.join(projectPath,rib) + "
")
shkPath = os.path.join(projectPath, "batch.shk")
f.write("openFcheck.bat")
# or use shake if you wish...
# f.write("shake -script %s" % shkPath)
f.close()
return batchPath
#-----------------------------------------------------
# Writes a simple Shake script that loads an image sequence and
# displays it in a flipbook.
def makeShakeScript(scriptPath, frameCount, imagePath):
f = open(scriptPath, 'w')
f.write('SetTimeRange("1-%s");
' % frameCount)
if os.name == "nt":
imagePath = convertToWindows(imagePath)
f.write('FileIn("%s");' % imagePath)
f.close()
#-----------------------------------------------------
# Writes a simple batch script that loads an image sequence and
# displays it in fcheck.
def makeFcheckScript(scriptPath, frameCount, imagePath):
if os.name == "nt":
imagePath = convertToWindows(imagePath)
f = open(scriptPath, 'w')
f.write('fcheck -n 1 %s 1 %s
' % (frameCount, imagePath))
f.close()
#-----------------------------------------------------
def main():
sceneName = "untitled"
projectPath = "./"
args = sys.argv[1:]
sceneName = args[0]
projectPath = args[1]
# Get a list of beauty pass rib files associated with a scene.
beautyRibs = getListOfBeautyRibs(sceneName, projectPath)
# Get a list of the "root" rib files.
rootRibs = getListOfRootRibs(sceneName, projectPath)
if len(rootRibs) > 0:
# Write a batch rendering file
if os.name == "posix":
batchName = "batchRender.sh"
batchPath = makeBatchFromList(batchName, projectPath, rootRibs)
os.chmod(batchPath, 0777)
else:
batchName = "batchRender.bat"
makeBatchFromList(batchName, projectPath, rootRibs)
# Look into one of the beauty pass ribs to find the relative path
# specified by its "Dispay" statement.
imagePath = getImagePath(beautyRibs[0], projectPath)
# Convert the relative path to a full path and substitute
# the numeric extension to a "#" symbol.
imagePath = replaceNumericWithPound(imagePath)
#projectPath = convertToWindows(projectPath)
#makeShakeScript(os.path.join(projectPath,"batch.shk"),len(beautyRibs),
#os.path.join(projectPath,imagePath))
makeFcheckScript(os.path.join(projectPath,"openFcheck.bat"),len(beautyRibs),
os.path.join(projectPath,imagePath))
if __name__ == "__main__":
main()