diff --git a/pype/tools/launcher/models.py b/pype/tools/launcher/models.py index 3e869f3e4a..c38e809c74 100644 --- a/pype/tools/launcher/models.py +++ b/pype/tools/launcher/models.py @@ -129,10 +129,6 @@ class ActionModel(QtGui.QStandardItemModel): def discover(self): """Set up Actions cache. Run this for each new project.""" - if not self.dbcon.Session.get("AVALON_PROJECT"): - self._registered_actions = list() - return - # Discover all registered actions actions = api.discover(api.Action) @@ -144,6 +140,9 @@ class ActionModel(QtGui.QStandardItemModel): def get_application_actions(self): actions = [] + if not self.dbcon.Session.get("AVALON_PROJECT"): + return actions + project_doc = self.dbcon.find_one({"type": "project"}) if not project_doc: return actions @@ -185,6 +184,8 @@ class ActionModel(QtGui.QStandardItemModel): self._groups.clear() + self.discover() + actions = self.filter_compatible_actions(self._registered_actions) self.beginResetModel() diff --git a/pype/tools/launcher/window.py b/pype/tools/launcher/window.py index 55635e2139..ac4558df8b 100644 --- a/pype/tools/launcher/window.py +++ b/pype/tools/launcher/window.py @@ -186,6 +186,7 @@ class AssetsPanel(QtWidgets.QWidget): # signals project_bar.project_changed.connect(self.on_project_changed) assets_widget.selection_changed.connect(self.on_asset_changed) + assets_widget.refreshed.connect(self.on_asset_changed) btn_back.clicked.connect(self.back_clicked) # Force initial refresh for the assets since we might not be @@ -206,9 +207,6 @@ class AssetsPanel(QtWidgets.QWidget): self.dbcon.Session["AVALON_PROJECT"] = project_name self.assets_widget.refresh() - # Force asset change callback to ensure tasks are correctly reset - self.assets_widget.refreshed.connect(self.on_asset_changed) - def on_asset_changed(self): """Callback on asset selection changed