Detecting if a task is a 'top level task' inside the action

5 views
Skip to first unread message

Austin Bingham

unread,
Feb 19, 2024, 12:33:40 PMFeb 19
to python-doit
I'm using doit as part of a non-linear video editor. In the render graph I build, there are a lot of intermediate steps which *can* produce output files, but which don't always need to do so. That is, I may have an input video which gets mirrored and then composited into an output video; the mirrored intermediate doesn't need to be written to disk for the final output, though it in principle can.

What I'd like is a way to write a task that can detect when it's a "leaf" task and selectively write a file to disk. So in the example above, the 'mirror' task could detect if it's only being used to produce intermediate results and, if so, not write anything to disk. 

How can I do that? It seems like the information must be in the data structures exposed by the doit API, but I haven't found it.

Eduardo Schettino

unread,
Feb 19, 2024, 12:52:41 PMFeb 19
to pytho...@googlegroups.com
Hi,

I guess it would be better if you can just pass an argument to the action to indicate it is a leaf or not.

For python-action it is possible to use a *magic* `task` parameter that gives you access to task's metadata. [1]
Depending on how you define the tasks you might be able to determine if it is a leaf or not from there.


Regards


--
You received this message because you are subscribed to the Google Groups "python-doit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-doit...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python-doit/b1167930-eecf-423e-9b0e-f90bbc5ab09cn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages