0

getting the shotgun selected items in pyqt window

Hi Guys!

Just wondering if there was a way of getting the shotgun selected items in pyqt window for my app??

Basically I want to open up the window then I would like to connect with shotgun and get a list of the selected items that are in the window.

Any help would be great appreciated!

Nick

 

class AppDialog(QtGui.QWidget):
    def __init__(self, app):
        QtGui.QWidget.__init__(self)
       self._app = app
        self.ui = Ui_Dialog()
       self.ui.setupUi(self)

3 comments

  • 0
    Avatar
    Hughes- Nick

    so far I am here and able to egt one item from the web browser using:

        self.asset = [self._app.context.entity]

    but trying to select more than one entity means that it returns none? I'll get playing

    cheers!

  • 0
    Avatar
    Alan Dann

    Hi Nick,

    I'm really sorry this slipped through the net!

    Did you manage to work out how to get it working?  The tk-shotgun-folders app is a good example showing how to retrieve multiple selected entities from Shotgun.  When registering the command, it sets supports_multiple_selection to True:

    https://github.com/shotgunsoftware/tk-shotgun-folders/blob/master/app.py#L30

    And then the callback for the command accepts the entity type and a list of entity ids:

    https://github.com/shotgunsoftware/tk-shotgun-folders/blob/master/app.py#L86

    Thanks

    Alan

  • 0
    Avatar
    Hughes- Nick

    Hi Alan!

    No worries, had no idea what this email was in reference to a minute ago. That feels like years ago now. But we got round it thanks.

    Thank you for the email though, and those links. They will come in useful definitely!

    Hope you are well and if I don't speak to you before Christmas, have a great one and a great new year!

    Cheers

Please sign in to leave a comment.