0

Creating a layout and adding sources to it in python

Hello:

  In RV, I'd like to create a new Layout, and then add some sources to it using python.  The sources are sequences of .exr images.  So far, I can create my layout and load in some sources:
myNewLayout = rv.commands.newNode("RVLayoutGroup","JakesNewLayout")
source = rv.commands.addSourceVerbose(sourceArray)

but then how do I get these new sources into the layout?  I tried:

rv.commands.setNodeInputs

but that was giving me some warnings about the input and output source groups...

Thanks!

Jake

2 comments

  • Avatar
    (Michael) Kessler Official comment

    Hi Jake, 

     What is the syntax you are using for your setNodeInputs?  You want to ensure you are setting the sourceGroups for the sources as the input to the RVLayoutGroup.

     

    Add an rv.commands.nodeGroup(source) to find the source group for your newly created source.

    import rv
    myNewLayout = rv.commands.newNode("RVLayoutGroup","JakesNewLayout")
    source = rv.commands.addSourceVerbose(["/demo_content/highres/08_a-team_001_ANIM_001/movie/08_a-team_001_ANIM_001.mov"])
    sourceGroup = rv.commands.nodeGroup(source)
    rv.commands.setNodeInputs(myNewLayout, [sourceGroup])

    If you generate multiple sources you can add them all to the second argument array to setNodeInputs to get them all added.

     

    Thanks,

    -Kessler

  • 0
    Avatar
    Jake Richards

    Ah, it looks like I needed to add the sourceGroup, that was my error.  Thanks!

     

    Jake

Please sign in to leave a comment.