Commit 87e800b1 authored by bblanimation's avatar bblanimation

Updated Bricker support

parent 4539e92e
......@@ -281,7 +281,7 @@ def getRenderDumpFolder():
# setup the render dump folder based on user input
if dumpLoc.startswith("//"):
dumpLoc = os.path.join(bpy.path.abspath("//"), dumpLoc[2:])
elif dumpLoc != "":
elif dumpLoc != "" and len(dumpLoc) > 2:
dumpLoc = dumpLoc[2:]
# if no user input, use default render location
else:
......
......@@ -40,18 +40,18 @@ def jobIsValid(jobType, classObject):
# verify that a camera exists in the scene
elif scn.camera is None:
jobValidityDict = {"valid":False, "errorType":"ERROR", "errorMessage":"RENDER FAILED: No camera in scene."}
jobValidityDict = {"valid":False, "errorType":"WARNING", "errorMessage":"RENDER FAILED: No camera in scene."}
# verify image file format
unsupportedFormats = ["AVI_JPEG", "AVI_RAW", "FRAMESERVER", "H264", "FFMPEG", "THEORA", "QUICKTIME", "XVID"]
if not jobValidityDict and scn.render.image_settings.file_format in unsupportedFormats:
jobValidityDict = {"valid":False, "errorType":"ERROR", "errorMessage":"RENDER FAILED: Output file format not supported. Supported formats: BMP, PNG, TARGA, JPEG, JPEG 2000, TIFF. (Animation only: IRIS, CINEON, HDR, DPX, OPEN_EXR, OPEN_EXR_MULTILAYER)"}
jobValidityDict = {"valid":False, "errorType":"WARNING", "errorMessage":"RENDER FAILED: Output file format not supported. Supported formats: BMP, PNG, TARGA, JPEG, JPEG 2000, TIFF. (Animation only: IRIS, CINEON, HDR, DPX, OPEN_EXR, OPEN_EXR_MULTILAYER)"}
# verify that sampling is high enough to provide expected results
if jobType == "image" and scn.render.engine == "CYCLES":
jobsPerFrame = scn.maxSamples // scn.samplesPerFrame
if jobsPerFrame > 100:
jobValidityDict = {"valid":False, "errorType":"ERROR", "errorMessage": "Max Samples / SamplesPerJob > 100. Try increasing samples per frame or lowering max samples."}
jobValidityDict = {"valid":False, "errorType":"WARNING", "errorMessage": "Max Samples / SamplesPerJob > 100. Try increasing samples per frame or lowering max samples."}
# verify that the user input for renderDumpLoc is valid and can be created
try:
......
......@@ -81,17 +81,19 @@ matt
"cse21707","cse21708","cse21709","cse21710","cse21711","cse21712",
"cse21713","cse21714","cse21715","cse21716"
],'cse218': [
"cse21801","cse21803","cse21804","cse21805","cse21806",
"cse21801","cse21802", "cse21803","cse21804","cse21805","cse21806",
"cse21807","cse21808","cse21809","cse21810","cse21811","cse21812"
],'cse103': [
"cse10301","cse10302","cse10303","cse10304","cse10305","cse10306",
"cse10307","cse10308","cse10309","cse10310","cse10311","cse10312",
"cse10313","cse10314","cse10315","cse10316","cse10317","cse10318",
"cse10319","cse103podium"
]}
### END REMOTE SERVERS DICTIONARY ###
# 201 servers
],'cse201': [
"cse20101","cse20102","cse20103","cse20104","cse20105","cse20106",
"cse20107","cse20108","cse20109","cse20110","cse20111","cse20112",
"cse20113","cse20114","cse20115","cse20116","cse20117","cse20118",
"cse20119","cse20120","cse20121","cse20122","cse20123","cse20124"
]}
### END REMOTE SERVERS DICTIONARY ###
......@@ -26,15 +26,15 @@ from bpy.app.handlers import persistent
scn = bpy.context.scene
""" BEGIN SUPPORT FOR REBRICKR """
""" BEGIN SUPPORT FOR BRICKER """
@persistent
def handle_rebrickr_animation(scene):
def handle_bricker_animation(scene):
print("Adjusting frame")
groupsToAdjust = {}
for group in bpy.data.groups:
if group.name.startswith("Rebrickr") and "_bricks_frame_" in group.name:
sourceName = group.name[9:(group.name.index("_bricks_frame_"))]
if group.name.startswith("Bricker") and "_bricks_f_" in group.name:
sourceName = group.name[9:(group.name.index("_bricks_f_"))]
if sourceName not in groupsToAdjust.keys():
groupsToAdjust[sourceName] = [group.name]
else:
......@@ -43,7 +43,7 @@ def handle_rebrickr_animation(scene):
groupsToAdjust[sourceName].sort()
for i,gName in enumerate(groupsToAdjust[sourceName]):
group = bpy.data.groups.get(gName)
frame = int(group.name[(group.name.index("_bricks_frame_") + 14):])
frame = int(group.name[(group.name.index("_bricks_f_") + 10):])
onCurF = frame == scn.frame_current
beforeFirstF = (i == 0 and scn.frame_current < frame)
afterLastF = (i == (len(groupsToAdjust[sourceName]) - 1) and scn.frame_current > frame)
......@@ -53,11 +53,11 @@ def handle_rebrickr_animation(scene):
brick.hide = not displayOnCurF
brick.hide_render = not displayOnCurF
handle_rebrickr_animation(scn)
bpy.app.handlers.render_pre.append(handle_rebrickr_animation)
bpy.app.handlers.frame_change_pre.append(handle_rebrickr_animation)
handle_bricker_animation(scn)
bpy.app.handlers.render_pre.append(handle_bricker_animation)
bpy.app.handlers.frame_change_pre.append(handle_bricker_animation)
""" END SUPPORT FOR REBRICKR """
""" END SUPPORT FOR BRICKER """
randomSeed = random.randint(1, 10000)
for scene in bpy.data.scenes:
......
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