Best event for auto stacking new sources

I have a requirement to turn new version or versions added to RV from a source into a stack (with the vzero plate for wiping).

The version(s) can come from drag and drop, from opened with shotgun (single version or playlist) or screening room.

The newly generated stack should be played instead of the original source media.

My question is

  • what’s the best event or events to listen to to get these sources reliably (after the metadata from Flow has been added to the source)
  • how to ensure that the new stack is played back instead of the original source (especially important if multiple versions are added)

Thank you for your help!


I would try to use the source-group-complete event. This is triggered no matter where the source gets added from.
This is the first event where it is safe to intercept after adding a source and it should work for your use case.

in the event.contents() you can then find the added node and add it to your stack.

Then set the stack as the view node
→ should be commands.setViewNode(your_stack) or something similar


1 Like

Thank you @mircotornow.

Let’s say I have 3 new sources and for each create a stack with the corresponding plate.
Would one of you know if there is sample code/docs that outlines how to?

  • create the stacks
  • add them to a sequence
  • make that sequence the next view to be played

hey had some time and threw together a mode that should do it.
Just quick and dirty so don’t expect it to be robust but the basic functionality should be there

from rv import rvtypes, commands

class LoadPlates(rvtypes.MinorMode):

    def __init__(self):
            [("source-group-complete", self.load_plate, "")],

    def load_plate(self, event):

        contents = event.contents()
        added_node = contents.split(";;")[0]

        src_path = commands.getStringProperty(f"{added_node}")[0]
        plate_path_to_add = self.find_plate_path(src_path)
        added_plate_node = commands.addSourceVerbose([plate_path_to_add])

        stack_node = commands.newNode("RVStackGroup", "PlateStack")
        commands.setNodeInputs(stack_node, [added_plate_node, added_node])


    def add_to_custom_sequence(self, stack_node: str):
        sequence_node = "MySequenceNode"
        if not commands.nodeExists(sequence_node):
            commands.newNode("RVSequenceGroup", sequence_node)

        input_nodes, _ = commands.nodeConnections(sequence_node)
        commands.setNodeInputs(sequence_node, input_nodes)


    def find_plate_path(self, source_path: str) -> str:
        # TODO: implement

def createMode():
    "Required to initialize the module. RV will call this function to create your mode."
    return LoadPlates()

1 Like

thank you so much! I look forward to trying it out. RV dev documentation isn’t too available it seems so that looks helpul!

I just tried it out and unfortunately the is set after the source-group-complete event when media is added from screening room

sourceComplete sourceGroup000001;;new
stateChange sourceGroup000001_source.tracking.infoStatus
stateChange sourceGroup000001_source.tracking.mediaType

I wonder if there is another event when it’s all completed including loading sg data?

To see which event you can use;
You can try opening rv with

rv --debug events

to see which events get triggered at which point when adding sources


Thank you @mircotornow that helped.

Looks like for “source-group-complete” different mode’s compete for the order and that mine is called before the code that loads the sg data.

And that the order of the modes can be tweaked during the init process of the mode.

And alternatively the “after-progressive-loading” event is fired at the very end of the process

  1. before-progressive-loading
  2. source-group-complete media 1
  3. source-group-complete media 2
  4. after-progressive-loading

thank you again so much! i tried it out and it worked and also gave an error which i posted here. would you have an idea? thank you!