Python - Get Media Panel Selection

How does one get the current selection from the media panel? For example, all the scripts from pyFlame pass ‘selection’ as an argument to their class methods but they’re not defining directly what the selection is. I’m assuming whatever right click wrapper function control the Python hooks does that but - how can I do it directly?

In nuke it’s very simple:

nuke.selectedNodes() gives a list of all nodes selected in the node graph.

Surely there’s a direct way in the Flame API to do the same for Media Panel selections?

1 Like

Whenever you do a right-click a selection is always returned. The selection will always be a list of whatever gets right-clicked on. A selection of nodes, a segment, a folder…


Hey Mike,

Is there a global variable called ‘selection’ then? I’m trying to call it directly in the python console - not hard coding it into a persistent custom menu.

its tucked in the flame module. i dont thiiiiink its in the documentation.

flame.media_panel.selected_entries returns a list of the selected objects

NOTE - its an attribute. not a function you have to call.

Brilliant - that’s what i was looking for. Thanks, Kieran