0

Querying the active DisplayGroup?

Is it possible through the commands api in Python or Mu to query the current active DisplayGroup that the RV window is using?

We're on a set up where everyone has two monitors. Unlike the single input to the ViewGroup, the output connections to the ViewGroup are always both DisplayGroups. I'm attempting to script up a full chain of all the nodes from SourceGroup to DisplayGroup but I can't seem to figure out how to query the "active" DisplayGroup. I realize that unlike the source groups which there is always only one of, both DisplayGroups are active, but the RV window seems to choose the one depending on which display the playback window is on. And the display dropdown in the UI has the name of the active DisplayGroup. In addition, I seem to be able to adjust only the active Display's brightness when using "@RVDisplayColor" as the node. So internally it seems that RV has access to this information, but is there any way to query it from a script?

Am I thinking about this the wrong way? Or do I need to somehow get the presentation device even if I am not in presentation mode?

댓글 1개

  • 0
    Avatar
    Cameron Billingham

    I think I may have figured it out today playing around with the metaEvaluate() function.

    I didn't realise that by default the metaEvaluate() function starts from the RVViewGroup, but you can pass in 'root' to make it start at the root node. The documentation is a little misleading for metaEvalute():

    You can optionally specify a root and leaf node between which the meta-evaluation occcurs. By default it will use the root of the graph and all leaves.

    This makes it seem like the root node will be passed by default, but without specifying it only the source of the view node is in the resulting list of nodes:

    >>> import rv.commands
    >>> [(n['node'], n['nodeType']) for n in rv.commands.metaEvaluate(rv.commands.frame())]
    [(u'defaultSequence', u'RVSequenceGroup'),
    (u'defaultSequence_sequence', u'RVSequence'),
    (u'defaultSequence_rt_sourceGroup000000', u'RVRetime'),
    (u'defaultSequence_p_sourceGroup000000', u'RVPaint'),
    (u'sourceGroup000000', u'RVSourceGroup'),
    (u'sourceGroup000000_transform2D', u'RVTransform2D'),
    (u'sourceGroup000000_sourceStereo', u'RVSourceStereo'),
    (u'sourceGroup000000_lookPipeline', u'RVLookPipelineGroup'),
    (u'sourceGroup000000_lookPipeline_0', u'OCIOLook'),
    (u'sourceGroup000000_colorPipeline', u'RVColorPipelineGroup'),
    (u'sourceGroup000000_colorPipeline_0', u'RVColor'),
    (u'sourceGroup000000_paint', u'RVPaint'),
    (u'sourceGroup000000_overlay', u'RVOverlay'),
    (u'sourceGroup000000_tolinPipeline', u'RVLinearizePipelineGroup'),
    (u'sourceGroup000000_tolinPipeline_1', u'RVLensWarp'),
    (u'sourceGroup000000_tolinPipeline_0', u'OCIOFile'),
    (u'sourceGroup000000_cache', u'RVCache'),
    (u'sourceGroup000000_channelMap', u'RVChannelMap'),
    (u'sourceGroup000000_format', u'RVFormat'),
    (u'sourceGroup000000_cacheLUT', u'RVCacheLUT'),
    (u'sourceGroup000000_source', u'RVFileSource')]

    But by specifying the root node, the result will include the full evaluation graph with the active RVDisplayGroup:

    >>> import rv.commands
    >>> [(n['node'], n['nodeType']) for n in rv.commands.metaEvaluate(rv.commands.frame(), 'root')]
    [(u'root', u'Root'),
    (u'displayGroup0', u'RVDisplayGroup'),
    (u'displayGroup0_colorPipeline', u'RVDisplayPipelineGroup'),
    (u'displayGroup0_colorPipeline_0', u'OCIODisplay'),
    (u'displayGroup0_stereo', u'RVDisplayStereo'),
    (u'viewGroup', u'RVViewGroup'),
    (u'viewGroup_dxform', u'RVDispTransform2D'),
    (u'viewGroup_soundtrack', u'RVSoundTrack'),
    (u'viewGroup_viewPipeline', u'RVViewPipelineGroup'),
    (u'defaultSequence', u'RVSequenceGroup'),
    (u'defaultSequence_sequence', u'RVSequence'),
    (u'defaultSequence_rt_sourceGroup000000', u'RVRetime'),
    (u'defaultSequence_p_sourceGroup000000', u'RVPaint'),
    (u'sourceGroup000000', u'RVSourceGroup'),
    (u'sourceGroup000000_transform2D', u'RVTransform2D'),
    (u'sourceGroup000000_sourceStereo', u'RVSourceStereo'),
    (u'sourceGroup000000_lookPipeline', u'RVLookPipelineGroup'),
    (u'sourceGroup000000_lookPipeline_0', u'OCIOLook'),
    (u'sourceGroup000000_colorPipeline', u'RVColorPipelineGroup'),
    (u'sourceGroup000000_colorPipeline_0', u'RVColor'),
    (u'sourceGroup000000_paint', u'RVPaint'),
    (u'sourceGroup000000_overlay', u'RVOverlay'),
    (u'sourceGroup000000_tolinPipeline', u'RVLinearizePipelineGroup'),
    (u'sourceGroup000000_tolinPipeline_1', u'RVLensWarp'),
    (u'sourceGroup000000_tolinPipeline_0', u'OCIOFile'),
    (u'sourceGroup000000_cache', u'RVCache'),
    (u'sourceGroup000000_channelMap', u'RVChannelMap'),
    (u'sourceGroup000000_format', u'RVFormat'),
    (u'sourceGroup000000_cacheLUT', u'RVCacheLUT'),
    (u'sourceGroup000000_source', u'RVFileSource')]

    And by extension an even more concise way to find the name of the active display group is to use the metaEvaluateClosestByType():

    >>> rv.commands.metaEvaluateClosestByType(rv.commands.frame(), 'RVDisplayGroup')[0]['name']
    displayGroup0

    I feel a bit like an idiot now, but I hope this helps someone else looking for the same answer.

댓글을 남기려면 로그인하세요.