Hi everyone.
I was reading some discussion about the compositor, and how it would be interesting to integrate the VSE to become a more in-place feature, rather than compositing all pre assembled footage.
This script is designed to read the VSE strips, and create handled nodes which will expose useful information to the UI when compositing. The idea is that the VSE is not actually used for rendering, and is only used as a GUI.
This script is very bare-bones. Currently, I’ve implemented Image and Movie nodes, and only the cross effect. I did have a different form of effect node which simply exposed a normalised factor for the effect, but I decided that the purpose of this script is to reduce the need to create your own node graphs manually. You can still read the factor value of the effect node output.
The script creates a new node group type for each input sequence strip. The reason for this is it is not possible to instantiate node groups, so any data you modify on their node tree affects all the instances. I could solve this by exposing all the data to input sockets, but that looks unclean, and this is merely a P.O.C.
(Movie node)
(User-arranged node tree)
If an effect is applied to two strips, it can connect them to the effect, but if two input strips overlap, you will need to fulfil that connection yourself.This would be somewhat straightforward to implement, but I won’t do it for now.
(Cross Effect node)
Node sockets:
Each node will have a number of common pins:
- Image - output image of node (effect, movie, image …)
- Current frame - current VSE frame. All nodes expose it in case it is needed for custom effects
- Start Frame - start frame (global frame in VSE, accounting for trim) of clip
- End Frame - end frame (global frame in VSE, accounting for trim) of clip
- Layer In - Image to use when before the start frame of this node
- Layer out - Image to use when after the end frame of this node
Effect nodes also expose:
- Fac - linear interpolation between start and end frame according to current frame. Used for fading, other linear effects.
- Image Upper - Higher channel Image
- Image Lower - Lower channel Image
Be aware - there is a limitation, that there can be only one user of any input data blocks. This limitation comes from the Movie input only, but I have extended that to the image to keep things consistent.
Don’t manually delete the nodes, they’re created from the VSE, and the system doesn’t check if they still exist, deleting them will cause problems. Instead, delete the VSE sequence.
When a VSE clip is removed, the associated data block will be deleted (user_clear() and then deleted)
To update the nodes, simply change the current frame.