예제 #1
0
        private void CopyJobParams(RenderJob job)
        {
            job.Antialias = Antialias;
            job.ReconFilter = ReconFilter;
            job.Width = Width;
            job.Height = Height;
            job.Aspect = Aspect;
            job.RenderEffect = RenderEffect;
            job.RenderMode = RenderMode;
            job.RecursionLimit = RecursionLimit;
            job.RenderLine = RenderLine;
            job.AdaptiveSampling = AdaptiveSampling;
            job.AdaptiveThreshold = AdaptiveThreshold;
            job.FilterType = FilterType;
            job.EnhanceAA = EnhanceAA;
            job.AntialiasLevel = AntialiasLevel;
            job.SliceNumber = 0;
            job.SlicesDown = SlicesDown;
            job.SlicesAcross = SlicesAcross;
            job.Overlap = Overlap;
            job.Camera = Camera;
            job.SamplingPattern = SamplingPattern;
            job.CameraAntialias = CameraAntialias;
            job.MinSamples = MinSamples;
            job.MaxSamples = MaxSamples;
            job.Radiosity = Radiosity;
            job.RadiosityType = RadiosityType;
            job.InterpolatedGI = InterpolatedGI;
            job.InterpolatedGI = InterpolatedGI;
            job.CachedGI = CachedGI;
            job.VolumetricGI = VolumetricGI;
            job.UseAmbientGI = UseAmbientGI;
            job.DirectionalGI = DirectionalGI;
            job.IntensityGI = IntensityGI;
            job.ToleranceGI = ToleranceGI;
            job.RayGI = RayGI;
            job.MinEvalGI = MinEvalGI;
            job.MinPixelGI = MinPixelGI;
            job.IndirectGI = IndirectGI;
            job.SaveAlpha = SaveAlpha;
            job.OverrideSettings = OverrideSettings;
            job.OverwriteFrames = OverwriteFrames;
            job.FilenameFormat = FileNameFormats[FileNameFormat];

            foreach (string s in StrippedMaster)
                job.StrippedMaster.Add(s);
        }
예제 #2
0
        public void GenerateRenderJobs()
        {
            if (Log == "")
            {
                Log += "*******************************************************\n";
                Log += "Project: " + SceneFile + "\n";
                Log += "Id: " + ProjectId + "\n";
                Log += "Sent by: " + Owner + "\n";
                Log += "Sent on: " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString() + "\n";
                Log += "*******************************************************\n";
            }
            else
            {
                Log += "*******************************************************\n";
                Log += "Project modified on: " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString() + "\n";
                Log += "*******************************************************\n";
            }

            if (!ContentDir.EndsWith("\\"))
                ContentDir += "\\";

            _jobs.Clear();

            if (SlicesAcross > 1 || SlicesDown > 1)
            {
                for (int i = 0; i < SlicesAcross * SlicesDown; i++)
                {
                    RenderJob job = new RenderJob(SceneFile.Substring(ContentDir.Length), StartFrame, StartFrame, 1, 0,
                                                  ServerServices.Configs[Config].ImageFormats[ImageFormat], SaveAlpha,
                                                  ServerServices.Configs[Config].ImageFormats[AlphaImageFormat]);
                    CopyJobParams(job);
                    job.SliceNumber = i;

                    _jobs.Add(job);
                }
            }
            else
            {
                for (int i = StartFrame; i <= EndFrame; i += FrameSteps)
                {
                    // If the overwrite flag isn't set
                    // Check if the frame (and alpha) to render already exists in the output folder
                    string imgfmt = ServerServices.Configs[Config].ImageFormats[ImageFormat];
                    string ext = imgfmt.Substring(imgfmt.IndexOf('(') + 1, (imgfmt.IndexOf(')') - imgfmt.IndexOf('(')) - 1);
                    string fname = string.Format(FileNameFormats[FileNameFormat], OutputDir, Prefix, i, ext);
                    bool filesExist;
                    if (SaveAlpha)
                    {
                        string aimgfmt = ServerServices.Configs[Config].ImageFormats[AlphaImageFormat];
                        string aext = aimgfmt.Substring(aimgfmt.IndexOf('(') + 1,
                                                        (aimgfmt.IndexOf(')') - aimgfmt.IndexOf('(')) - 1);
                        string aname = string.Format(FileNameFormats[FileNameFormat], OutputDir, AlphaPrefix, i, aext);
                        filesExist = File.Exists(fname) && File.Exists(aname);
                    }
                    else
                        filesExist = File.Exists(fname);

                    // If overwrite flag is set or if one or both the needed files are not in the output folder
                    if (OverwriteFrames || !filesExist)
                    {
                        RenderJob job = new RenderJob(SceneFile.Substring(ContentDir.Length), i, i, 1, 0,
                                                      ServerServices.Configs[Config].ImageFormats[ImageFormat],
                                                      SaveAlpha, ServerServices.Configs[Config].ImageFormats[AlphaImageFormat]);
                        CopyJobParams(job);
                        job.SliceNumber = 0;
                        _jobs.Add(job);
                    }
                }
            }
            StartJobs = _jobs.Count;
        }