Commit b036d305 authored by Christopher Gearhart's avatar Christopher Gearhart

Improved stability, revised remoteServers.txt instructions, and fixed bug in blender_p.py file

parent 7004bd20
......@@ -622,15 +622,12 @@ class openRenderedAnimationInUI(Operator):
image_sequence_filepath = "{dumpFolder}/".format(dumpFolder=self.renderDumpFolder)
for frame in bpy.props.animFrameRange:
try:
print("entering try")
image_filename = "{fileName}_{frame}{extension}".format(fileName=getNameOutputFiles(), frame=str(frame).zfill(4), extension=bpy.props.animExtension)
bpy.ops.clip.open(directory=image_sequence_filepath, files=[{"name":image_filename}])
print("bpy.ops.clip.open(directory=" + image_sequence_filepath + ", files=[{'name':" + image_filename + "}]")
openedFile = image_filename
openedFrame = frame
break
except:
print("hit exception")
pass
if openedFile:
bpy.ops.clip.reload()
......
......@@ -56,7 +56,6 @@ def getFrames(projectName, archiveFiles=False, frameRange=False):
fetchRsyncCommand = "rsync -x --progress --remove-source-files --exclude='*.blend' --exclude='*_average.???' -e 'ssh -T -oCompression=no -oStrictHostKeyChecking=no -x' '{login}:{remotePath}{projectName}/results/*' '{dumpLocation}/';".format(login=bpy.props.serverPrefs["login"], remotePath=bpy.props.serverPrefs["path"], projectName=projectName, dumpLocation=dumpLocation)
# run the above processes
print(archiveRsyncCommand + fetchRsyncCommand)
process = subprocess.Popen(archiveRsyncCommand + fetchRsyncCommand, stdout=subprocess.PIPE, shell=True)
return process
......@@ -278,7 +277,7 @@ def getNameOutputFiles():
scn = bpy.context.scene
if scn.nameOutputFiles != "":
# remove illegal characters
for char in "/<>:\"\ |?*":
for char in " <>:\"'/|\?*.^":
scn.nameOutputFiles = scn.nameOutputFiles.replace(char, "_")
return scn.nameOutputFiles
else:
......
......@@ -95,21 +95,23 @@ def setupServerPrefs():
return {"valid":False, "errorMessage":invalidEntry("HOST SERVER PATH")}
# format host server path
path = path.replace(" ", "_").replace("$username$", username)
for char in " <>:\"\|?*.^":
path = path.replace(char, "_")
path.replace("$username$", username)
if not path.endswith("/") and path != "":
path += "/"
# read file for servers dictionary
try:
tmpServers = readFileFor(serverFile, "REMOTE SERVERS DICTIONARY")
tmpServers = readFileFor(serverFile, "REMOTE SERVERS DICTIONARY").replace("'", "\"")
except:
return {"valid":False, "errorMessage":"Could not load 'REMOTE SERVERS DICTIONARY'. Please read the instructions carefully to make sure you've set up your file correctly"}
return {"valid":False, "errorMessage":invalidEntry("REMOTE SERVERS DICTIONARY")}
# convert servers dictionary string to object
try:
servers = json.loads(tmpServers)
except:
return {"valid":False, "errorMessage":"Could not load dictionary. Please make sure you've entered a valid dictionary and check for syntax errors"}
return {"valid":False, "errorMessage":invalidEntry("dictionary")}
return {"valid":True, "servers":servers, "login":login, "path":path, "hostConnection":hostConnection}
......
INSTRUCTIONS:
This text file is used by the Server Farm Client addon to connect to remote
servers using ssh and rsync. DO NOT MODIFY LINES CONTAINING "###", as these
lines are used to accurately parse the text file.
Below, you'll find the SSH username, Host Server, optional ssh connection
extension, and remote server dictionary that will be loaded to the addon on
startup. Your computer will be communicating to the remote servers through the
host server, which has the 'blender_task.py' script installed as per the
instructions given on this addon's wiki page. It will be connecting to the host
This text file contains connection information for use with ssh and rsync to
remote servers. DO NOT MODIFY LINES CONTAINING "###", as these lines are used to
accurately parse the text file.
Below, you'll find the SSH username, host server, SSH connection extension
(optional), and remote server dictionary that will be loaded on startup. Your
computer will be communicating to the remote servers by running the
'blender_task.py' script on the host server. It will be connecting to the host
server with the following bash call:
$ ssh ${username}@${hostServer}${extension}
where '${username}' is the username defined below, '${hostServer}' is the host
server name defined below, and '${extension}' is the optional ssh connection
extension defined below. The addon will also try to communicate with each of the
remote servers on occasion, using the following bash call:
where '${username}', '${hostServer}', and '${extension}' are defined below. The
addon will also communicate with each of the remote servers using the following
bash call:
$ ssh ${username}@${serversDictionary[groupName][index]}${extension}
where 'serversDictionary[groupName][index]' is the remote server name at the
given index within the given list accessed with the groupName key.
where 'serversDictionary[groupName][index]' is the remote server name at any
existing index within the 'groupName' list.
The remote servers dictionary defined below must be a valid dictionary
(extra white space and new line characters will be removed) of server names.
of server names (extra white space and new line characters will be removed).
Please follow the following formatting guidelines while defining the remote
servers dictionary:
- The dictionary must begin with a starting brace '{' and end with an ending
brace '}'
- The dictionary keys define remote server groups; you can name these
whatever you like.
- The dictionary values must be valid lists of strings
- All server and group names must be defined as strings, with double quotes
'"' surrounding each server name.
whatever you like (must be valid strings).
- The dictionary values must be valid lists of server name strings.
- NOTE: Valid strings are be surrounded by double or single quotes - single
quotes are converted to double quotes by the addon.
- Double check your dictionary formatting before committing your changes!
if you'd like to learn more about dictionaries, read the Python documentation on
......@@ -43,7 +41,7 @@ dictionaries at the following URL:
https://docs.python.org/3/tutorial/datastructures.html#dictionaries
If you have any questions or if you'd like to report a bug, feel free to email
the author, Chris Gearhart, at chris@bblanimation.com.
me at chris@bblanimation.com.
Once you've finished making changes to the information below, save the
changes to this file (Text > Save), and switch back to the 3D viewport. Now
......@@ -78,19 +76,19 @@ john
### BEGIN REMOTE SERVERS DICTIONARY ###
{"cse217": [
{'cse217': [
"cse21701","cse21702","cse21703","cse21704","cse21705","cse21706",
"cse21707","cse21708","cse21709","cse21710","cse21711","cse21712",
"cse21713","cse21714","cse21715","cse21716"
],"cse218": [
],'cse218': [
"cse21801","cse21803","cse21804","cse21805","cse21806",
"cse21807","cse21808","cse21809","cse21810","cse21811","cse21812"
],"cse103": [
],'cse103': [
"cse10301","cse10302","cse10303","cse10304","cse10305","cse10306",
"cse10307","cse10308","cse10309","cse10310","cse10311","cse10312",
"cse10313","cse10314","cse10315","cse10316","cse10317","cse10318",
"cse10319","cse103podium"
],"cse201": [
],'cse201': [
"cse20101","cse20102","cse20103","cse20104","cse20105","cse20106",
"cse20107","cse20108","cse20109","cse20110","cse20111","cse20112",
"cse20113","cse20114","cse20115","cse20116","cse20117","cse20118",
......
......@@ -34,4 +34,4 @@ for scene in bpy.data.scenes:
scene.cycles.blur_glossy = 0
scene.render.use_overwrite = True
if scene.cycles.film_transparent:
scene.color_mode = 'RGBA'
scene.render.image_settings.color_mode = 'RGBA'
......@@ -185,9 +185,9 @@ def main():
subprocess.call("rsync -e 'ssh -oStrictHostKeyChecking=no' -a '{pyFilePathSource}' '{pyFilePathDest}'".format(pyFilePathSource=os.path.join(projectRoot, "blender_p.py"), pyFilePathDest=pyFilePathDest), shell=True)
if args.samples:
with open(pyFilePathDest, "a") as f:
f.write(" scene.cycles.progressive == 'PATH'\n")
f.write(" scn.cycles.use_square_samples == False\n")
f.write(" scene.cycles.samples = {samples}".format(samples=args.samples))
f.write(" scene.cycles.progressive = 'PATH'\n")
f.write(" scene.cycles.samples = {samples}\n".format(samples=args.samples))
f.write(" scene.cycles.use_square_samples = False\n")
# Print frame range to be rendered
frames = json.loads(args.frame_range)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment