add placeholder menu to maya

This commit is contained in:
Thomas Fricard 2022-05-24 17:28:42 +02:00
parent 15e51cd6a6
commit c8c36144cb
2 changed files with 21 additions and 1 deletions

View file

@ -3,7 +3,7 @@ import maya.cmds as cmds
import qargparse
from openpype.tools.utils.widgets import OptionDialog
from lib import get_main_window, imprint
from .lib import get_main_window, imprint
# To change as enum
build_types = ["context_asset", "linked_asset", "all_assets"]

View file

@ -11,8 +11,10 @@ from openpype.settings import get_project_settings
from openpype.pipeline import legacy_io
from openpype.tools.utils import host_tools
from openpype.hosts.maya.api import lib
from .lib import get_main_window, IS_HEADLESS
from .commands import reset_frame_range
from .lib_template_builder import create_placeholder, update_placeholder
log = logging.getLogger(__name__)
@ -139,6 +141,24 @@ def install():
parent_widget
)
)
builder_menu = cmds.menuItem(
"Template Builder",
subMenu=True,
tearOff=True,
parent=MENU_NAME
)
cmds.menuItem(
"Create Placeholder",
parent=builder_menu,
command=lambda *args: create_placeholder()
)
cmds.menuItem(
"Update Placeholder",
parent=builder_menu,
command=lambda *args: update_placeholder()
)
cmds.setParent(MENU_NAME, menu=True)
def add_scripts_menu():