I’d like to be able to use screening room in RV and load 4k EXR/DPX sequences from a local SSD. This is obviously much faster than the server. However not all media is on the server and only some on the SSD. Is there an option for the to tell RV to check a relative file path before loading the files from the server? If they don’t exist on the SSD just load from our server? Ideally I want this to be seamless to the user when using RV.
I have read the documentation here
but this seems to relate to swapping paths across different operating systems. Perhaps i’m misreading the documentation?
Would really appreciate help if anyone has any tips.
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:
I am having problems getting this to work (7.6 - 2021).
Where you setStringProperty, if I take the same form that you show, it returns the following error :
TypeError: Bad argument (1) to function commands.setStringProperty: expecting dynamic array
But if I encapsulate the path in square brackets, then it hard crashes RV without any error.
The only difference I can see in my code is that the path I’m passing uses “%4d” instead of a framerange. Can you confirm the valid syntax of the path when using setStringProperty?
Thanks!
Exception: Exception thrown while calling commands.setStringProperty – exception: “in commands.setStringProperty: number of values does not match property size”, program exception
Hey @Patrick, the specific error you have is that you are trying to set an array into a slot for a single value. Check out commands.contractSequences to shrink your sequence down to a single sequence notation rather than a list of frames.
Also, you can be a little bit more efficien with this if you bind on incoming-source-path and set your path with event.setReturnContents rather than source-group-complete. Then you never have to load things twice (or set the movie property, just return the new path as the returnContents)
Function: returnContents
Path: Event.returnContents
returnContents (string;
Event)
Description
Access to the "return value" for this event set by previous event handlers. In order to "daisy-chain" event handling for events with a return value (for example, the "incoming-source-path" event), handlers should check the event's returnContents, so that work done by previous handlers is not overridden.
Hi Michael,
If I don’t set an array it raises an error.
TypeError: Bad argument (1) to function commands.setStringProperty: expecting dynamic array
It must be in the form ‘[path]’.
I’ll certainly try the method you suggest though, but can you provide an example of a valid path value as neither single, dynamic or array values appear to be valid.
Hi again,
I’ve got the income_source_path event working now.
The problem remains though, if a user wants to revert the path-swap, I still need to execute a “setStringProperty” on the media node to update the path. When I do this, it crashes RV every time.
The crash is probably worth making a reproduction case and submitting a ticket to the RV team.
Ideally if you are using the incoming-source-path you aren’t setting media, but instead just using the event.setReturnContents(newPath), then you aren’t loading media multiple times.
Yea the income_source_path works for when clips are loaded, but we also need to toggle the behaviour on and off after the clips are loaded, in which case I grab the sources and then update the paths… setSourceMedia did the job nicely!
Thanks again.
p