Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions avalon/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ def create(name, asset, family, options=None, data=None):
Arguments:
name (str): Name of subset
asset (str): Name of asset
family (str): Name of family
family (str, Creator): Name of family, or a Creator plugin class
options (dict, optional): Additional options from GUI
data (dict, optional): Additional data from GUI

Expand All @@ -878,12 +878,14 @@ def create(name, asset, family, options=None, data=None):

host = registered_host()

plugins = list()
for Plugin in discover(Creator):
has_family = family == Plugin.family
if issubclass(family, Creator):
# Allow passing in a specific Creator to run only that plug-in
Plugins = [family]
else:
Plugins = [P for P in discover(Creator) if family == P.family]

if not has_family:
continue
plugins = list()
for Plugin in Plugins:

Plugin.log.info(
"Creating '%s' with '%s'" % (name, Plugin.__name__)
Expand Down
4 changes: 2 additions & 2 deletions avalon/tools/creator/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,13 +436,13 @@ def on_create(self):

subset_name = result.text()
asset = asset.text()
family = item.data(FamilyRole)
Plugin = item.data(PluginRole)
use_selection = self.data["Use Selection Checkbox"].isChecked()

try:
api.create(subset_name,
asset,
family,
Plugin,
options={"useSelection": use_selection})

except NameError as e:
Expand Down