implemented 'get_workfile_build_placeholder_plugins' for maya

This commit is contained in:
Jakub Trllo 2022-09-09 13:31:55 +02:00
parent 5ccda391e4
commit e5654595a8
2 changed files with 10 additions and 4 deletions

View file

@ -35,6 +35,7 @@ from openpype.hosts.maya import MAYA_ROOT_DIR
from openpype.hosts.maya.lib import copy_workspace_mel
from . import menu, lib
from .new_template_builder import MayaLoadPlaceholderPlugin
from .workio import (
open_file,
save_file,
@ -123,6 +124,11 @@ class MayaHost(HostBase, IWorkfileHost, ILoadHost):
def get_containers(self):
return ls()
def get_workfile_build_placeholder_plugins(self):
return [
MayaLoadPlaceholderPlugin
]
@contextlib.contextmanager
def maintained_selection(self):
with lib.maintained_selection():

View file

@ -75,15 +75,15 @@ class AbstractTemplateLoader:
def get_placeholder_plugin_classes(self):
"""Get placeholder plugin classes that can be used to build template.
Default implementation looks for 'get_placeholder_plugin_classes' on
host.
Default implementation looks for method
'get_workfile_build_placeholder_plugins' on host.
Returns:
List[PlaceholderPlugin]: Plugin classes available for host.
"""
if hasattr(self._host, "get_placeholder_plugin_classes"):
return self._host.get_placeholder_plugin_classes()
if hasattr(self._host, "get_workfile_build_placeholder_plugins"):
return self._host.get_workfile_build_placeholder_plugins()
return []
@property