forked from gameboy12615/MMD4Maya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMMD4Maya.py
48 lines (40 loc) · 1.35 KB
/
MMD4Maya.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import maya.cmds as cmds
import maya.mel as mel
import maya.OpenMayaUI as OpenMayaUI
from MMD4Maya.Scripts.UI.MainWindow import *
def ShowMainWindow(*args):
MainWindow()
def ShowHelp(*args):
cmds.confirmDialog(title = "Help", message = "\
Steps to import:\n\
1. Select a pmx/pmd file.\n\
2. Select one or multiple vmd files.\n\
3. Check the terms of use then click Process.\n\
\n\
Attention:\n\
1. The file name of fbx file and texture files should not be japanese or chinese.\n\
2. You can only import one model at a time, please save your model as the standard fbx file, then create a new scene to import another one.\n\
\n\
Enjoy! >_< \n\
\n\
Author: Takamachi Marisa\n\
Contact: http://weibo.com/u/2832212042",\
icon = "information")
def CustomMayaMenu():
gMainWindow = mel.eval('$temp1=$gMainWindow')
menus = cmds.window(gMainWindow, q = True, menuArray = True)
found = False
for menu in menus:
label = cmds.menu(menu, q = True, label = True)
if label == "MMD4Maya":
found = True
if found == False:
customMenu = cmds.menu(parent=gMainWindow, label = 'MMD4Maya')
cmds.menuItem(parent = customMenu, label = "Open MMD4Maya", c = ShowMainWindow)
cmds.menuItem(parent = customMenu, label = "Help", c = ShowHelp)
# Initialize the plug-in
def initializePlugin(plugin):
CustomMayaMenu()
# Uninitialize the plug-in
def uninitializePlugin(plugin):
pass