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

Minimize code in userSetup.py #93

Merged
merged 1 commit into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions release/scripts/mgear/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,74 @@ def install(label, commands, parent=menuId, image=""):
pm.displayError(message)


def install_main_menu():
"""Create top level mGear menu"""

# Install mGear Menu
import mgear
mgear.install()

# Install Dag Menu option
import mgear.core.dagmenu
mgear.core.dagmenu.install()

# Install Shifter Menu
import mgear.shifter.menu
mgear.shifter.menu.install()

# Install Simple Rig Menu
import mgear.simpleRig.menu
mgear.simpleRig.menu.install()

# Install Skinning Menu
import mgear.core.menu
mgear.core.menu.install_skinning_menu()

# Install Rigbits Menu
import mgear.rigbits.menu
mgear.rigbits.menu.install()

# Install Animbits Menu
import mgear.animbits.menu
mgear.animbits.menu.install()

# Install CFXbits Menu
import mgear.cfxbits.menu
mgear.cfxbits.menu.install()

# Install Crank Menu
import mgear.crank.menu
mgear.crank.menu.install()

# Install Anim Picker Menu
import mgear.anim_picker.menu
mgear.anim_picker.menu.install()

# Install Synoptic Menu
import mgear.synoptic.menu
mgear.synoptic.menu.install()

# Install Flex Menu
import mgear.flex.menu
mgear.flex.menu.install()

# Install Utilities Menu
import mgear.menu
m = mgear.menu.install_utils_menu()
mgear.core.menu.install_utils_menu(m)
mgear.rigbits.menu.install_utils_menu(m)

# install dragdrop override in utilities
import mgear.core.dragdrop
mgear.core.dragdrop.install_utils_menu(m)

# Install Help Menu
mgear.menu.install_help_menu()

# from cvwrap.menu import create_menuitems
# create_menuitems()


str_web = """
import webbrowser
webbrowser.open("http://www.mgear-framework.com/")
Expand Down
76 changes: 4 additions & 72 deletions release/scripts/userSetup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@

# imports
from maya import cmds
from pymel import mayautils
# from cvwrap.menu import create_menuitems

print("""
print(r"""
____________________________________
| _____ |
| / ____| |
Expand All @@ -17,71 +13,7 @@
""")


def mGear_menu_loader():
"""Create mGear menu"""

# Install mGear Menu
import mgear
mgear.install()

# Install Dag Menu option
import mgear.core.dagmenu
mgear.core.dagmenu.install()

# Install Shifter Menu
import mgear.shifter.menu
mgear.shifter.menu.install()

# Install Simple Rig Menu
import mgear.simpleRig.menu
mgear.simpleRig.menu.install()

# Install Skinning Menu
import mgear.core.menu
mgear.core.menu.install_skinning_menu()

# Install Rigbits Menu
import mgear.rigbits.menu
mgear.rigbits.menu.install()

# Install Animbits Menu
import mgear.animbits.menu
mgear.animbits.menu.install()

# Install CFXbits Menu
import mgear.cfxbits.menu
mgear.cfxbits.menu.install()

# Install Crank Menu
import mgear.crank.menu
mgear.crank.menu.install()

# Install Anim Picker Menu
import mgear.anim_picker.menu
mgear.anim_picker.menu.install()

# Install Synoptic Menu
import mgear.synoptic.menu
mgear.synoptic.menu.install()

# Install Flex Menu
import mgear.flex.menu
mgear.flex.menu.install()

# Install Utilities Menu
import mgear.menu
m = mgear.menu.install_utils_menu()
mgear.core.menu.install_utils_menu(m)
mgear.rigbits.menu.install_utils_menu(m)

# install dragdrop override in utilities
import mgear.core.dragdrop
mgear.core.dragdrop.install_utils_menu(m)

# Install Help Menu
mgear.menu.install_help_menu()


if not cmds.about(batch=True):
mayautils.executeDeferred(mGear_menu_loader)
# mayautils.executeDeferred(create_menuitems)
from pymel import mayautils
import mgear.menu
mayautils.executeDeferred(mgear.menu.install_main_menu)