Skip to content

Commit

Permalink
Add message for no creator plugin been found
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlatwe committed Dec 16, 2019
1 parent 1c641d3 commit 2961b44
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions avalon/tools/creator/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = (
Expand Down

0 comments on commit 2961b44

Please sign in to comment.