From 2961b4488d19a495fe87480f20ccd5c97ec020cf Mon Sep 17 00:00:00 2001 From: David Lai Date: Mon, 16 Dec 2019 20:55:19 +0800 Subject: [PATCH] Add message for no creator plugin been found --- avalon/tools/creator/app.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/avalon/tools/creator/app.py b/avalon/tools/creator/app.py index f548f07c8..1bfdaef2d 100644 --- a/avalon/tools/creator/app.py +++ b/avalon/tools/creator/app.py @@ -295,10 +295,11 @@ def _on_data_changed(self): # Get the asset from the database which match with the name asset = io.find_one({"name": asset_name, "type": "asset"}, projection={"_id": 1}) + # Get plugin + plugin = item.data(PluginRole) - if asset: - # Get plugin and family - plugin = item.data(PluginRole) + if asset and plugin: + # Get family family = plugin.family.rsplit(".", 1)[-1] # Get all subsets of the current asset @@ -340,7 +341,11 @@ def _on_data_changed(self): else: self._build_menu([]) item.setData(ExistsRole, False) - self.echo("Asset '%s' not found .." % asset_name) + + if not plugin: + self.echo("No registered families ..") + else: + self.echo("Asset '%s' not found .." % asset_name) # Update the valid state valid = (