1/******************************************************************************
2	NintendoWare for CTR Maya Plugin
3
4	File:         NW4C_BatchExport.mel
5	Description:  batch export
6	Date:         2010/02/04
7	Author:       Takashi Endo
8
9	Copyright (C)2009-2010 Nintendo Co., Ltd. / HAL Laboratory, Inc. All rights reserved.
10******************************************************************************/
11
12/******************************************************************************
13	main
14******************************************************************************/
15global proc NW4C_BatchExport(string $c3beFile)
16{
17	//-----------------------------------------------------------------------------
18	// source scripts
19	source NW4C_CommonProc;
20	source NW4C_ExpDialog;
21
22	//-----------------------------------------------------------------------------
23	// load plugin
24	if (!`pluginInfo -q -l "NW4C_Export.mll"`)
25	{
26		loadPlugin("NW4C_Export.mll");
27	}
28
29	//-----------------------------------------------------------------------------
30	// expand environment varieble
31	if (substring($c3beFile, 1, 1) == "$")
32	{
33		string $env = substring($c3beFile, 2, size($c3beFile));
34		$c3beFile = getenv($env);
35		// cut both end double quote
36		$c3beFile = substitute("^\"", $c3beFile, "");
37		$c3beFile = substitute("\"$", $c3beFile, "");
38		//trace ("env: " + $env + ", [" + $c3beFile + "]");
39	}
40
41	//-----------------------------------------------------------------------------
42	// execute
43	string $cmd = "NW4C_BatchExportCmd -b \"" + $c3beFile + "\"";
44	eval($cmd);
45}
46