def MakePythonFile(file_name): #3DO new routine to make python file print 'Make Python File started.' temp_path = dst + file_name file = open(temp_path, 'w') fileData = """import mcjBlendBot mcjBlendBot.setGloss( 0.05, 0.15 ) mcjBlendBot.setRenderEngine( "CYCLES" ) mcjBlendBot.setImageSize( 1280, 720 ) mcjBlendBot.setCyclesSettings( "EXPERIMENTAL", "GPU", "CUDA", 100 ) mcjBlendBot.setSmooth( True ) mcjBlendBot.setEdgeSplit( True ) mcjBlendBot.loadfix( "REPLACETHIS", "CYCLESMATS", "", True ) mcjBlendBot.setHorizonColor( 0.47637062668204533, 0.5968319876970396, 1, 1.0 )""" #3DO Insert Path into above Batch File fileData = fileData.replace("REPLACETHIS",dst + objFile) #3DO Change backslashes to forward slashes for Blender Python fileData = fileData.replace("\\","/") file.write(fileData) file.close() print 'Make Python File completed.' def MakeBatchFile(file_name): #3DO new routine to make a batch file print 'Make Batch File started.' temp_path = dst + '/' + file_name file = open(temp_path, 'w') fileData = 'call "' + blenderLoc + '"' + ' -P ' + '"' + dst + pyFile + '"' #3DO Change backslashes to forward slashes for Blender Python fileData = fileData.replace("\\","/") print fileData file.write(fileData) file.close() print 'Make Batch File completed.' #3DO create new sub-directory from obj name and put all in there onlyName = fileName.replace(dst,"") dst = fileName fileName = dst + onlyName os.makedirs(dst) print "New Path: " + dst print "New Filename: " + fileName