0

MU commands for interrogating multiple sessions

We're trying to extend our RV integration and we have a situation where we want to retrieve information about what the user has loaded in RV currently (we're using the Python network support, but I don't think this question has anything to do with that, it's just a newbie Mu question).  I haven't been able to figure out how, in Mu, to get information about any session other than the current session.

For instance, I can use command.sources() to get a list of the sources in the current session (this log is from running muConsole.py although again I think this is a basic Mu question).

   sources();

   RETURN: (string,int,int,int,float,bool,bool)[] {("//KRONOS/Software/ntbin/develop/Test/render/nukeTest/sample/Ep101_021_276_00_LHT_002/Ep101_021_276_00_LHT_002.1-176#.tif", 1, 176, 1, 0.0, false, true)}

That's cool, it's exactly the information I want, but there are actually 2 RV sessions open in that process.  I can get their names:

    sessionNames();

   RETURN: string[] {"session0", "session1"}

But I can't see any way to retrieve information about any session other than the current one.

I looked through the reference manual, the Mu User's Manual, and the Mu Command API browser, but I couldn't find any references to a "setSession" or similar command.  I tried looking for the "server" end code for network mode, but I couldn't tell if that was integrated into the core or lurking in some .mu file somewhere. 

Sorry if this is all documented somewhere and I just missed it, but any pointers for how to crawl the dependency graphs in the various open sessions would be welcome!

Leo

 

 

 

2 comments

  • 0
    Avatar
    Alan Trombla

    Hi Leo,

    That's a great question, but unfortunately the answer is that you can't really get at a session other than the one the connection is associated with.  When a network connection is set up, it's associated with the currently active session, and all the future events and messages produced by that network connection are processed by that session.

    And in general, there's a Mu Context associated with the session at a very low level (down among the threads and memory management), and it's pretty much impossible to run Mu code "across sessions'.  We used to try to support some of this, but the complexity of the problems this produced was that we basically shut it off at some point, to keep thing sane.

    Maybe if you explain what exactly you're trying to do, we could think about how we could get there from here.

    Sorry to not be more helpful,

    Alan

  • 0
    Avatar
    Leo Hourvitz

    Hi Alan,

    Thanks for the fast reply as always!

    As part of a submission tool, we want to know what media the user has loaded in RV currently.  Although some of the sessions have probably been initiated from our tools in the first place (and thus we could simply remember what's in them), the user might have added a layer into the session since it was initiated; or, they might have simply opened a new RV session on a different set of images. So, we'd like to get a list of all current sessions and the source media (including audio) imported into each one.

    You mentioned that it's hard to run Mu code across sessions, which I can totally believe.  In our case it would be fine to open a new connection to each session and individually query them, but I didn't see any way to specify at connection time the session name you're interested in (while this would probably be a bit slow, we expect the average user will only have one or two sessions at a time).

    If none of this is possible, one obvious workaround is to communciate out; that is to say, add a UI command in RV that broadcasts the information out to the other tools.  For various reasons that's going to be less efficient than if we could look in to the existing RV session from outside, but it obviously it would be a way to get the information.

Please sign in to leave a comment.