0

tk-multi-starterapp init from tk-shotgun with selected entity

Hi,

I would like to retrieve the shotgun browser entity selection inside the appDialog. and i didn't find out a way to instanciate this AppDialog.

I try to register a command with a callback as a lambda that pass the entity_type and entity_ids to show_dialog()

But it seems, as soon as I add other/new argument to the show_dialog, the appInstance.engine.show_dialog fail... even though I let as default the

app_instance.engine.show_dialog("Show Starter Template App...", app_instance, AppDialog  )

Is there a reason for that ? what did I missed ?

I add in attachement my zipped app and the exectution log....

 

Here a snipset of the initialisation with a custom callback


############### /app.py #############

from sgtk.platform import Application
class StgkStarterApp(Application):
    
    def init_app(self):
        app_payload = self.import_module("app")
        
        p = {
            "title": "Show my starter app",
            "supports_multiple_selection": True
        }

        callback = lambda entity_type, entity_ids : app_payload.dialog.show_dialog( self, entity_type, entity_ids )
        self.engine.register_command("Show Starter Template App...", callback , p)

 

############### python/app/dialog.py ################

def show_dialog( appInstance, entity_type, entity_ids) :
    app_instance.log_info(str("ENTITY_IDS : ") + str(entity_ids ))
    app_instance.engine.show_dialog("Show Starter Template App...", app_instance, AppDialog  )



tk_multi_toDoNote.zip
tk_multi_starterapp.txt

0 条评论

请先登录再写评论。