0

RV: How do you set imageComponent in RV Session with rvSession Python library?

(Full-diclosure: I know that rvSession.py states it only supports RV Session files for RV 4, but maybe someone knows something I don't that can make it work (in this case) with RV 6 as well.)

I'm attempting to use the rvSession Python library to create an RV Session file that loads Sources and sets the Image layer for each source.

 

To set the Image layer in the RV Session file in RV 4, you do this:

sourceGroup000000_source : RVFileSource (1)
{
request
{
string imageLayerSelection = "matteA"
}
}

This can be generated by the rvSession Python library by doing this:

session = rvSession.Session()
node = session.newNode('Source')
node.setProperty ("RVFileSource", "source", "request", "imageLayerSelection", gto.STRING,"matteA")

However, in RV 6, the RV Session file sets the Image layer with this:

sourceGroup000000_source : RVFileSource (1)
{
request
{
string imageComponent = [ "layer" "" "matteA" ]
}
}

Does anyone know how to generate that setting via rvSession and/or gto? The format of that value (i.e. [ "layer" "" "matteA" ]) doesn't appear to be a gto compatible format (i.e. gto.STRING, gto.INT), but I could be missing something.

Thanks!

3 comments

  • Avatar
    (Michael) Kessler Official comment

    Hi Josh,

    There's just a small change you need to make to make the string property an array with multiple elements.

    If you still specify that the data type is a gto.STRING but pass in an array of strings, you should get what you are looking for.


    For instance, adapting your example, if you do:

     >>> node.setProperty ("RVFileSource", "source", "request", "imageLayerSelection", gto.STRING, ["layer", "", "matteA"]) 


    That should result in a source that looks like:

     sourceGroup000000_source : RVFileSource (1) 
     { 
        request 
        { 
            string imageLayerSelection = [ "layer" "" "matteA" ] 
        } 
     } 

     

    -Kessler

  • 0
    Avatar
    Jon Morley

    Hi Josh,

    For the record RV-4 sessions have very few differences from RV-6 or 7 and all session versions (even RV-3) should open in the latest RV releases.

    Thanks,
    Jon

  • 0
    Avatar
    Josh Burnell

    Thanks, guys! That works perfectly.

    Jon, feel free to call this request Closed.

Please sign in to leave a comment.