0

Replacing Images

Hello,

I'm opening up a blank RV session, and I'd like to load in images via python.  After I load in one image, I'd like to replace that image with another.  I've been struggling to find this, and I haven't found anything browsing the forums.

Thanks in advance!

3件のコメント

  • 0
    Avatar
    Alan Trombla

    Hi Josh,

    Do you know about the RVPUSH command ?  Docs for that here:

    http://www.tweaksoftware.com/static/documentation/rv/current/html/rv_manual.html#RVPUSH

    That'll let you push images (or arbitrary scripting code) to a running RV.  So with no RV running, this will start RV and load "first.jpg":

    rvpush set first.jpg

    Then this will replace that image with "second.jpg":

    rvpush set second.jpg

    Hope that helps,

    Alan

  • 0
    Avatar
    josh

    I did not know about that, that's good to know.

     

    Is there a Python method of doing this?

  • 0
    Avatar
    Jon Morley

    You can always use commands.setSourceMedia if you know the source node for which you are trying to replace the media. Here are the docs from Help -> "Mu Commands API Browser...":

    Path: commands.setSourceMedia

    setSourceMedia (void; 
                    string sourceNode,
                    string[] fileNames,
                    string tag = nil)
    

    Description

    Replace all media in the given RVFileSource node with new media with optional tag.

    If you do not yet have a source you should call commands.addSourceVerbose and keep track of the node it returns. Then you can use that node with commands.setSourceMedia to change the media. Here are the docs from Help -> "Mu Commands API Browser..." for commands.addSourceVerbose:

    Path: commands.addSourceVerbose

    addSourceVerbose (string; 
                      string[] fileNames,
                      string tag = nil)
    

    Description

    Similar to addSource(), but returns the name of the source node created.

    Please let us know if you have any more questions.

    Thanks,
    Jon

ログインしてコメントを残してください。