Check for frames on local storage before loading. If exist load those instead

Hey K!

Thank you for using the community!

You can write a package that binds on source-group-complete event (Event Reference HERE), where you can cycle through media and replace the paths with what you need. The core code would look something like this:

    # Rough logic, please don't use as is!
    from rv import commands, extra_commands
    info = extra_commands.sourceMetaInfoAtFrame(rv.commands.frame())
    metadata = commands.sourceMediaInfo(info['node'])
    filename = metadata.get("file")
    sourceFrame = info['frame']
    files = commands.existingFilesInSequence(filename)
    frames = commands.existingFramesInSequence(filename)
    framesToFiles = dict(zip(frames, files))
    framesToFiles[sourceFrame]

You can set the path by modifying media.movie property on RVFileSource node by running commands.setStringProperty("%s.media.movie" % sourceNode, "/new/path/.1001-1004.exr").

If you need help writing your first package, we have some reference her:

Hope this helps!

Cheers,
Alexa

2 Likes