MuSymbol and session_manager

I’m trying to access the session_manager functions but I’m struggling getting the “self” argument from muSymbol functions like “session_manager.SessionManagerMode”.

For instance I want to call a simple mu function like this “session_manager.SessionManagerMode.activate” I need to provide the “self” argument, I do I get it? I was hoping into something like rv.qtutils.sessionManager() but no…

getting there

this gives me a pointer to the session_manager
S = MuSymbol(“session_manager.theMode”)

this returns the class of the session manager
S = MuSymbol(“rvui.minorModeFromName”)(“session_manager”)

but when I test “session_manager.SessionManagerMode.activate” I get “nil” error with the first command and a crash with the second as argument

this works

rv.runtime.eval (‘{ let m = session_manager.theMode(); m.deactivate(); }’, [“session_manager”])

I’m now trying a more advanced command but I get a weird error:

from here:

{
let m = session_manager.theMode();
m.reorderSelected(true, ); 
}
'''

rv.runtime.eval (commands, ["session_manager"])

I get this, and nothing happens (this is supposed to move the layer up in the edit mode of the session manager)

'__lambda1d7a (void; bool checked) (session_manager.SessionManagerMode.reorderSelected session_manager.SessionManagerMode {true, "session_manager", nil, nil, false, false, qt.QDockWidget {<#qt.NativeObject 0x0xb4386c0>}, session_manager.EventFilter {<#qt.NativeObject 0x0x7f4649f72760>}, qt.QWidget {<#qt.NativeObject 0x0x7f4649f73d70>}, qt.QSplitter {<#qt.NativeObject 0x0x7f46b5526530>}, qt.QWidget {<#qt.NativeObject 0x0x7f4649f76850>}, session_manager.NodeTreeView {<#qt.NativeObject 0x0xb380600>, 0, nil, false, qt.QStandardItemModel {<#qt.NativeObject 0x0x7f46b5534a40>}, string[] {}, qt.QTimer {<#qt.NativeObject 0x0x7f4649f80160>}, qt.QStandardItem {<#qt.NativeObject 0x0x5da3280>}}, qt.QStandardItemModel {...ad infinitum...}, qt.QStandardItemModel {<#qt.NativeObject 0x0x7f46b55358a0>}, qt.QToolButton {<#qt.NativeObject 0x0x7f46b552e3d0>}, qt.QToolButton {<#qt.NativeObject 0x0x7f46b552cb30>}, qt.QToolButton {<#qt.NativeObject 0x0x7f46b55292c0>}, qt.QToolButton {<#qt.NativeObject 0x0x7f46b5527640>}, qt.QToolButton {<#qt.NativeObject 0x0x7f46b552de50>}, qt.QToolButton {<#qt.NativeObject 0x0x7f46b5527730>}, qt.QWidget {<#qt.NativeObject 0x0x7f46b5542bc0>}, session_manager.InputsView {<#qt.NativeObject 0x0x7f4649f80070>, qt.QAbstractItemView {...ad infinitum...}, qt.QTimer {<#qt.NativeObject 0x0x7f478fcf3f30>}}, qt.QTabWidget {<#qt.NativeObject 0x0x7f46b553ce00>}, qt.QToolButton {<#qt.NativeObject 0x0x7f46b5542950>}, qt.QToolButton {<#qt.NativeObject 0x0x7f46b5543ec0>}, qt.QToolButton {<#qt.NativeObject 0x0x7f46b55450a0>}, qt.QToolButton {<#qt.NativeObject 0x0x7f46b5543f50>}, qt.QToolButton {<#qt.NativeObject 0x0x7f46b5545330>}, qt.QTreeWidget {<#qt.NativeObject 0x0x7f4797b24f80>}, qt.QTreeWidgetItem[] {qt.QTreeWidgetItem {<#qt.NativeObject 0x0x7f474f762710>}}, (string,qt.QIcon)[] {("RVSourceGroup", qt.QIcon {}), ("RVImageSource", qt.QIcon {}), ("RVSwitchGroup", qt.QIcon {}), ("RVRetimeGroup", qt.QIcon {}), ("RVLayoutGroup", qt.QIcon {}), ("RVStackGroup", qt.QIcon {}), ("RVSequenceGroup", qt.QIcon {}), ("RVFolderGroup", qt.QIcon {}), ("RVFileSource", qt.QIcon {})}, qt.QIcon {}, qt.QIcon {}, qt.QIcon {}, qt.QIcon {}, qt.QIcon {}, false, false, qt.QTimer {<#qt.NativeObject 0x0x7f46b31082a0>}, qt.QTimer {<#qt.NativeObject 0x0x7f46b3108c10>}, qt.QTimer {<#qt.NativeObject 0x0x7f46b552b330>}, nil, true, nil, qt.QColorDialog {<#qt.NativeObject 0x0x7f4649f7b480>}, nil, qt.QAction[] {qt.QAction {<#qt.NativeObject 0x0x7f472c9e53e0>}, qt.QAction {<#qt.NativeObject 0x0x7f4799f3fa20>}, qt.QAction {<#qt.NativeObject 0x0x7f46afaf7130>}}, qt.QMenu {<#qt.NativeObject 0x0x7f463d8dd310>}, qt.QMenu {<#qt.NativeObject 0x0x7f474f730d00>}, nil, nil, qt.QToolButton {<#qt.NativeObject 0x0x7f46b552ba00>}, qt.QToolButton {<#qt.NativeObject 0x0x7f4649f7e810>}, qt.QLabel {<#qt.NativeObject 0x0x7f4649f7e610>}, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, false} true __lambda1d7a.checked)'

Hello!

As you can see, the mu errors can be quite cryptic !
I believe that you are missing the last argument for the reorderSelected(true, true) method.
It is not used in the method but it needs to be specified.
I guess the dummy parameter was added so it could conveniently be used in the UI.

I hope this helps,

Bernie

thanks Bernie, this works

moveInputUpCommand = '''

{

let m = session_manager.theMode();

m.reorderSelected(true, true);

}

'''

rv.runtime.eval (moveInputUpCommand, ["session_manager"])```
1 Like