mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
remove obsolete plugin attribute imprint.
This commit is contained in:
parent
86d00621ee
commit
88b7d8dbcf
1 changed files with 0 additions and 30 deletions
|
|
@ -11,43 +11,13 @@ ValidateSceneOrder = pyblish.api.ValidatorOrder + 0.2
|
|||
ValidateMeshOrder = pyblish.api.ValidatorOrder + 0.3
|
||||
|
||||
|
||||
def imprint_attributes(plugin):
|
||||
"""
|
||||
Load presets by class and set them as attributes (if found)
|
||||
|
||||
:param plugin: plugin instance
|
||||
:type plugin: instance
|
||||
"""
|
||||
file = inspect.getfile(plugin.__class__)
|
||||
file = os.path.normpath(file)
|
||||
plugin_kind = file.split(os.path.sep)[-2:-1][0]
|
||||
plugin_host = file.split(os.path.sep)[-3:-2][0]
|
||||
plugin_name = type(plugin).__name__
|
||||
try:
|
||||
settings = get_project_settings(os.environ['AVALON_PROJECT'])
|
||||
settings_data = settings[plugin_host][plugin_kind][plugin_name] # noqa: E501
|
||||
print(settings_data)
|
||||
except KeyError:
|
||||
print("preset not found")
|
||||
return
|
||||
|
||||
for option, value in settings_data.items():
|
||||
if option == "enabled" and value is False:
|
||||
setattr(plugin, "active", False)
|
||||
else:
|
||||
setattr(plugin, option, value)
|
||||
print("setting {}: {} on {}".format(option, value, plugin_name))
|
||||
|
||||
|
||||
class ContextPlugin(pyblish.api.ContextPlugin):
|
||||
def process(cls, *args, **kwargs):
|
||||
imprint_attributes(cls)
|
||||
super(ContextPlugin, cls).process(cls, *args, **kwargs)
|
||||
|
||||
|
||||
class InstancePlugin(pyblish.api.InstancePlugin):
|
||||
def process(cls, *args, **kwargs):
|
||||
imprint_attributes(cls)
|
||||
super(InstancePlugin, cls).process(cls, *args, **kwargs)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue