Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Existing subsets hints in creator #333

Merged
merged 8 commits into from
May 12, 2021
2 changes: 2 additions & 0 deletions avalon/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
registered_plugin_paths,
registered_root,

last_discovered_plugins,

deregister_plugin,
deregister_plugin_path,

Expand Down
8 changes: 7 additions & 1 deletion avalon/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
self._is_installed = False
self._config = None
self.data = {}
# The currently registered plugins from the last `discover` call.
self.last_discovered_plugins = {}

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -803,7 +805,11 @@ def discover(superclass):
print("Warning: Overwriting %s" % plugin.__name__)
plugins[plugin.__name__] = plugin

return sorted(plugins.values(), key=lambda Plugin: Plugin.__name__)
sorted_plugins = sorted(
plugins.values(), key=lambda Plugin: Plugin.__name__
)
self.last_discovered_plugins[superclass.__name__] = sorted_plugins
return sorted_plugins


def plugin_from_module(superclass, module):
Expand Down
6 changes: 3 additions & 3 deletions avalon/tools/creator/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,9 @@ def _on_data_changed(self):
defaults = list(plugin.defaults)

# Replace
compare_regex = re.compile(
subset_name.replace(user_input_text, "(.+)")
)
compare_regex = re.compile(re.sub(
user_input_text, "(.+)", subset_name, flags=re.IGNORECASE
))
subset_hints = set()
if user_input_text:
for _name in existing_subset_names:
Expand Down
1 change: 1 addition & 0 deletions avalon/tvpaint/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def groups_data():

output = parse_group_data(data)
os.remove(output_filepath)
return output


def get_layers_pre_post_behavior(layer_ids):
Expand Down