1/******************************************************************************
2	NintendoWare for CTR Maya Plugin
3
4	File:         NW4C_CreateMenu.mel
5	Description:  create menu
6	Date:         2010/04/28
7
8	Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc.  All rights reserved.
9******************************************************************************/
10
11/******************************************************************************
12	show plugin version
13******************************************************************************/
14global proc NW4C_ShowPluginVersion()
15{
16	string $supportVer = getApplicationVersionAsFloat();
17
18	string $pluginVer = "?";
19	if (`pluginInfo -q -l "NW4C_Export.mll"`)
20	{
21		$pluginVer = eval("NW4C_ExportInfoCmd -p");
22	}
23
24	confirmDialog -t "NW4C Maya Plugin Version"
25		-m ("NintendoWare for CTR\n"
26			+ "Maya " + $supportVer + " Plugin  "
27			+ "Ver " + $pluginVer + "\n\n"
28			+ "Copyright (C)2009-2011 Nintendo Co., Ltd. / HAL Laboratory, Inc.\n"
29			+ "All rights reserved.")
30		-b "OK" -db "OK" -ma "center";
31}
32
33/******************************************************************************
34	main
35******************************************************************************/
36global proc NW4C_CreateMenu()
37{
38	global string $gMainWindow;
39
40	//-----------------------------------------------------------------------------
41	// check UI exist
42	if ($gMainWindow == "" || !`window -ex $gMainWindow`)
43	{
44		return;
45	}
46
47	//-----------------------------------------------------------------------------
48	// get version
49	float $mayaVer = getApplicationVersionAsFloat();
50
51	//-----------------------------------------------------------------------------
52	// set parent
53	setParent $gMainWindow;
54
55	//-----------------------------------------------------------------------------
56	// delete old menu
57	if (`menu -q -ex nw4cMainMenu`)
58	{
59		deleteUI nw4cMainMenu;
60	}
61
62	//-----------------------------------------------------------------------------
63	// create menu
64	menu -p $gMainWindow -l "NW4C"
65	     -allowOptionBoxes 0 -tearOff 1
66	     nw4cMainMenu;
67
68		//-----------------------------------------------------------------------------
69		// export
70		menuItem -l "NW4C Export"
71			-ann "Export intermediate files & Use CreativeStudio"
72			-c "NW4C_ExpDirect";
73
74		menuItem -l "NW4C Export with Setting..."
75			-ann "NW4C Export Options"
76			-c "NW4C_ExpDialog";
77
78		menuItem -d 1;
79
80		//-----------------------------------------------------------------------------
81		// material attr
82		menuItem -l "NW4C Set Material Attribute..."
83			-ann "Set material attributes of selected shadingEngine (material) node"
84			-c "NW4C_SetMaterialAttr";
85
86		//-----------------------------------------------------------------------------
87		// render priority
88		menuItem -l "NW4C Set Render Priority..."
89			-ann "Set render priority of selected shadingEngine (material) node"
90			-c "NW4C_SetRenderPriority";
91
92		//-----------------------------------------------------------------------------
93		// normal mapping attr
94//		menuItem -l "NW4C Set Normal Mapping Attribute..."
95//			-ann "Set normal mapping attributes of selected file node"
96//			-c "NW4C_SetNormalMappingAttr";
97
98		menuItem -d 1;
99
100		//-----------------------------------------------------------------------------
101		// no compress node
102		menuItem -l "NW4C Set No Compress Node..."
103			-ann "Set no compress flag of selected transform node"
104			-c "NW4C_SetNoCompressNode";
105
106		//-----------------------------------------------------------------------------
107		// billboard
108		menuItem -l "NW4C Set Billboard..."
109			-ann "Set billboard mode of selected transform node"
110			-c "NW4C_SetBillboard";
111
112		//-----------------------------------------------------------------------------
113		// combine group
114		menuItem -l "NW4C Set Combine Group..."
115			-ann "Set combine group of selected transform node"
116			-c "NW4C_SetCombineGroup";
117
118		//-----------------------------------------------------------------------------
119		// force export key
120		menuItem -l "NW4C Set Force Export Key..."
121			-ann "Set force export key of selected transform node"
122			-c "NW4C_SetForceExportKey";
123
124		//-----------------------------------------------------------------------------
125		// primitive type
126//		menuItem -l "NW4C Set Primitive Type..."
127//			-ann "Set primitive type of selected mesh object"
128//			-c "NW4C_SetPrimitiveType";
129
130		menuItem -d 1;
131
132		//-----------------------------------------------------------------------------
133		// animation
134		menuItem -l "NW4C Set Animation Range..."
135			-ann "Set animation range attributes"
136			-c "NW4C_SetAnimRange";
137		menuItem -l "NW4C Set Frame Extension List..."
138			-ann "Set output frame extension list for texture pattern animation"
139			-c "NW4C_SetFrameExtensionList";
140//		menuItem -l "NW4C Set Shape Anim Attribute..."
141//			-ann "Set shape anim attributes of selected blendShape (transform) node"
142//			-c "NW4C_SetShapeAnimAttr";
143
144		menuItem -d 1;
145
146		//-----------------------------------------------------------------------------
147		// scene
148		menuItem -l "NW4C Set Camera Fovy..."
149			-ann "Set camera fovy of selected camera (transform) node"
150			-c "NW4C_SetCameraFovy";
151
152		menuItem -d 1;
153
154		//-----------------------------------------------------------------------------
155		// other
156		menuItem -l "NW4C Set User Data..."
157			-ann "Set user data of selected transform node & shadingEngine (material) node"
158			-c "NW4C_SetUserData";
159
160		menuItem -d 1;
161
162		//-----------------------------------------------------------------------------
163		// help
164		menuItem -l "Help Index..."
165			-ann "Show help index"
166			-c "NW4C_ShowHelp \"MayaPlugin.html\" \"\"";
167
168		menuItem -l "Plugin Version..."
169			-ann "Show plugin version"
170			-c "NW4C_ShowPluginVersion";
171
172	setParent -m ..;
173}
174