private static bool StartRendering(Job job) { string parameters = JobPathHelper.GetDeadlineJobFile(job); parameters += " " + Settings.LocalFusionPluginPath; parameters += " " + JobPathHelper.GetJobCompPath(job); VCProcess process = new VCProcess(job); process.StartInfo.FileName = Settings.LocalDeadlineExePath; process.StartInfo.CreateNoWindow = true; process.StartInfo.UseShellExecute = false; process.StartInfo.RedirectStandardError = true; process.StartInfo.RedirectStandardOutput = true; process.StartInfo.Arguments = parameters; process.EnableRaisingEvents = true; process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Minimized; process.Execute(); string output = process.StandardOutput.ReadToEnd(); job.RenderID = RenderIDParser.Parse(output); process.WaitForExit(); process.Close(); return(job.RenderID != null); }
public static bool WriteJobFile(Job job) { string renderFilename = JobPathHelper.GetDeadlineJobFile(job); StreamWriter jobFile = new StreamWriter(renderFilename); jobFile.WriteLine("Plugin=FusionCmd"); jobFile.WriteLine("Frames={0}-{1}", job.InFrame, job.OutFrame); job.RenderStartTime = DateTime.Now.Ticks; jobFile.WriteLine(string.Format("Name={0} [{1}]", job.ID, job.RenderStartTime)); jobFile.WriteLine("UserName=virtualcampaign"); if (job.Production.Is4K) { jobFile.WriteLine("Group=vc_360"); } else { jobFile.WriteLine("Group=vc"); } jobFile.WriteLine("ArchiveOnComplete=false"); jobFile.WriteLine("OnJobComplete=Nothing"); jobFile.WriteLine("Priority=" + Convert.ToString(job.Production.Priority)); jobFile.WriteLine("Comment=#" + job.FrameCount.ToString()); if (job.FrameCount <= 1) { jobFile.WriteLine("ChunkSize=1"); } else { jobFile.WriteLine("ChunkSize=" + Settings.RenderChunkSize); } jobFile.WriteLine("ExtraInfo1=" + job.ProductID); jobFile.WriteLine("OverrideJobFailureDetection=true"); jobFile.WriteLine("FailureDetectionJobErrors=10"); jobFile.Close(); return(File.Exists(renderFilename)); }