How can I run a python script when a render is finished?

View: New views
2 Messages — Rating Filter:   Alert me  

How can I run a python script when a render is finished?

by Daniel Scott Matthews :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I want to be able to run a script on the folder of animation frames
when the last frame is complete. At the moment I manually do the same
set of actions on the folder the animation frames are saved in.

I could watch a folder with a script so I know when frames go into it,
but they are not rendered in frame order and unless I tell the script
how many to expect it does not know when to process the set of frames.
In my case I want to convert to a video file and open it in vlc or
ffplay.

Is it possible to have a text property added to each engine that holds
a python script that is invoked when the render manager returns a
result? Per frame and per job (do we need two scripts?) and passes
messages to the script as to the results that were returned, i.e.
errors etc.


I have been playing with sending frames to LuxRender,
http://k-3d.org/blogs/dsmatthews/2009/10/11/rendering-animations-frames-with-luxrender/
, which works well except that I need more cores to get the job done
faster.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development

Re: How can I run a python script when a render is finished?

by Timothy M. Shead :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Daniel Scott Matthews wrote:

> I want to be able to run a script on the folder of animation frames
> when the last frame is complete. At the moment I manually do the same
> set of actions on the folder the animation frames are saved in.
>
> I could watch a folder with a script so I know when frames go into it,
> but they are not rendered in frame order and unless I tell the script
> how many to expect it does not know when to process the set of frames.
> In my case I want to convert to a video file and open it in vlc or
> ffplay.
>
> Is it possible to have a text property added to each engine that holds
> a python script that is invoked when the render manager returns a
> result? Per frame and per job (do we need two scripts?) and passes
> messages to the script as to the results that were returned, i.e.
> errors etc.
I don't think there's a clean solution in the short-term; as you point
out, your script would have to use a heuristic to figure-out when
rendering is truly complete.

The right solution for the 0.9 time-frame would be to make this a
special-case of multi-pass rendering.  There, I see a hierarchy of
render engines in a scene, with one render engine at the root of the
hierarchy "calling" the others.  That implies a degree of coordination,
and it provides an opportunity for a scripted render-engine to do
per-pass, per-frame, or per-animation operations.  It's wonderful how
well it all works in my head ;)

Cheers,
Tim

[tshead.vcf]

begin:vcard
fn:Timothy Shead
n:Shead;Timothy
org:www.k-3d.org
email;internet:tshead@...
title:Founder
x-mozilla-html:FALSE
version:2.1
end:vcard



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development