diff --git a/pype/lib.py b/pype/lib.py index 7009743c97..6eee38f6d8 100644 --- a/pype/lib.py +++ b/pype/lib.py @@ -467,10 +467,18 @@ def filter_pyblish_plugins(plugins): host = api.current_host() + presets = config.get_presets().get('plugins', {}).get(host, {}).get( + "publish", {} + ) + # iterate over plugins for plugin in plugins[:]: + # skip if there are no presets to process + if not presets: + continue + try: - config_data = config.get_presets()['plugins'][host]["publish"][plugin.__name__] # noqa: E501 + config_data = presets[plugin.__name__] # noqa: E501 except KeyError: continue @@ -483,3 +491,7 @@ def filter_pyblish_plugins(plugins): option, value, plugin.__name__)) setattr(plugin, option, value) + + # Remove already processed plugins from dictionary + # WARNING Requires plugins with unique names + presets.pop(plugin.__name__)