Move -noAutoLoadPlugins flag to separate hook.

This commit is contained in:
Toke Stuart Jepsen 2023-03-27 16:42:35 +01:00
parent 4bfb4aa757
commit 6d2a45e951
2 changed files with 16 additions and 6 deletions

View file

@ -44,15 +44,10 @@ class AddLastWorkfileToLaunchArgs(PreLaunchHook):
# Determine whether to open workfile post initialization.
if self.host_name == "maya":
maya_settings = self.data["project_settings"]["maya"]
if maya_settings["explicit_plugins_loading"]["enabled"]:
self.log.debug("Explicit plugins loading.")
self.launch_context.launch_args.append("-noAutoloadPlugins")
keys = [
"open_workfile_post_initialization", "explicit_plugins_loading"
]
maya_settings = self.data["project_settings"]["maya"]
values = [maya_settings[k] for k in keys]
if any(values):
self.log.debug("Opening workfile post initialization.")

View file

@ -0,0 +1,15 @@
from openpype.lib import PreLaunchHook
class PreAutoLoadPlugins(PreLaunchHook):
"""Define -noAutoloadPlugins command flag."""
# Execute before workfile argument.
order = 0
app_groups = ["maya"]
def execute(self):
maya_settings = self.data["project_settings"]["maya"]
if maya_settings["explicit_plugins_loading"]["enabled"]:
self.log.debug("Explicit plugins loading.")
self.launch_context.launch_args.append("-noAutoloadPlugins")