Skip to content

Commit

Permalink
Merge pull request #490 from davidlatwe/fix-no-creator
Browse files Browse the repository at this point in the history
Prompt proper message if no creator plugin been found
  • Loading branch information
davidlatwe committed Dec 20, 2019
2 parents bc5e2f6 + 2961b44 commit cc0574c
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 cc0574c

Please sign in to comment.