Exemplo n.º 1
0
    def update_render_status(self):

        Gdk.threads_enter()
                    
        if motionheadless.session_render_complete(self.get_session_id()) == True:
            #remove_as_status_polling_object(self)
            
            job_msg = self.get_completed_job_message()
            update_job_queue(job_msg)
            
            motionheadless.delete_session_folders(self.get_session_id())
            
            GLib.idle_add(self.create_media_item)

        else:
            status = motionheadless.get_session_status(self.get_session_id())
            if status != None:
                fraction, elapsed = status
                
                self.progress = float(fraction)
                if self.progress > 1.0:
                    # A fix for how progress is calculated in gmicheadless because producers can render a bit longer then required.
                    self.progress = 1.0

                self.elapsed = float(elapsed)
                self.text = _("Rendering Motion Clip ") + self.get_job_name()
                
                job_msg = self.get_job_queue_message()
                
                update_job_queue(job_msg)
            else:
                # Process start/stop on their own and we hit trying to get non-existing status for e.g completed renders.
                pass

        Gdk.threads_leave()
Exemplo n.º 2
0
    def update_render_status(self):

        Gdk.threads_enter()

        if motionheadless.session_render_complete(
                self.get_session_id()) == True:
            remove_as_status_polling_object(self)

            job_proxy = self.get_completed_job_proxy()
            update_job_queue(job_proxy)

            motionheadless.delete_session_folders(self.get_session_id())

            GLib.idle_add(self.create_media_item)

        else:
            status = motionheadless.get_session_status(self.get_session_id())
            if status != None:
                fraction, elapsed = status

                msg = _("Rendering Motion Clip ") + self.get_job_name()

                job_proxy = self.get_job_proxy()

                job_proxy.progress = float(fraction)
                if job_proxy.progress > 1.0:
                    # hack to fix how progress is calculated in gmicheadless because producers can render a bit longer then required.
                    job_proxy.progress = 1.0

                job_proxy.elapsed = float(elapsed)
                job_proxy.text = msg

                update_job_queue(job_proxy)
            else:
                print("MotionRenderQueueObject status none")
                pass  # This can happen sometimes before gmicheadless.py has written a status message, we just do nothing here.

        Gdk.threads_leave()