Ok, I got near the end and now I'm stuck again.
Where the MEL script is run in the Maya script editor with the following:
- Code: Select all
//<?---------------------------------------------------------
// Purpose: Compile mdl's for Half-Life 2 within Maya.
// Author: Stieffers - Stieffers@Gmail.com
// Version: v1.0.3 Date: 12-15-07
//-----------------------------------------------------------
/*if ( `window -ex $myWindow`)
{
print ( "// Window deleted.\n" );
deleteUI $myWindow;
}*/
string $myWindow = `window -wh 532 118 -t "Compile Model" -s false`;
columnLayout;
rowLayout -columnWidth 1 55 -columnWidth 2 20 -columnWidth 3 275 -columnWidth 4 85 -height 23 -numberOfColumns 5 -width 180;
text -label "Qc Path: " -align "right";
textField -w 20 -text "C:" text_Qc_01;
textField -w 275 -enable false -text "\\Program Files\\Valve\\Steam\\Steamapps\\SourceMods\\" text_Qc_02; // Double slashes nessecary.
textField -w 85 -text "(Mod)_src" text_Qc_03;
textField -w 90 -enable false -text "\\modelsrc\\" text_Qc_04; // Again, double slashes nessecary.
setParent ..;
rowLayout -columnWidth 1 55 -numberOfColumns 2;
text -label "Qc File: " -align "right";
textField -w 470 -text "(Filename).qc" text_filename_01;
setParent ..;
rowLayout -columnWidth 1 55 -columnWidth 2 20 -columnWidth 3 209 -columnWidth 4 151 -height 23 -numberOfColumns 5 -width 180;
text -label "StudioMdl: " -align "right";
textField -w 20 -text "C:" text_studio_01;
textField -w 209 -enable false -text "\\Program Files\\Valve\\Steam\\Steamapps\\" text_studio_02; // Again, double slashes nessecary.
textField -w 151 -text "(Email)" text_studio_03;
textField -w 90 -enable false -text "\\source_sdk\\bin\\" text_studio_04; // Again, double slashes nessecary.
setParent ..;
separator -w 532;
rowLayout -columnWidth 1 100 -numberOfColumns 2;
button -label "Custom" -al "center" -width 100 -c proc_setSourceForts -aop true;
button -label "Compile" -al "center" -width 425 -c proc_main;
setParent ..;
showWindow $myWindow;
// Run studiomdl.exe and compile the model.
proc proc_main ()
{
$pathQc = `textField -q -text text_Qc_01`
+ `textField -q -text text_Qc_02`
+ `textField -q -text text_Qc_03`
+ `textField -q -text text_Qc_04`
+ `textField -q -text text_filename_01`;
$pathStudio = `textField -q -text text_studio_01`
+ `textField -q -text text_studio_02`
+ `textField -q -text text_studio_03`
+ `textField -q -text text_studio_04`
+ "studiomdl.exe";
// Console output.
print ( "\n-PATHS---------------------------\n" );
print ( $pathStudio + "\n" );
print ( $pathQc + "\n\n" );
// Open a command prompt.
string $run = `system ( "cmd.exe" )`;
print $run;
// Change the directory and then run studiomdl.exe
string $run = `system ( "dir \"" + $pathStudio + "\"" )`;
print $run;
string $run = `system ( "studiomdl.exe " + "\"" + $pathQc +"\"" )`;
print $run;
// Finish message.
print ( "Completed compiling " + $pathQc );
}
// Set some of the text fields with default values that correspond with SourceForts
proc proc_setSourceForts ()
{
// Console output.
print ( "\n-CONFIG: testmod-----------------\n" );
print ( "testmod_src\n" );
print ( "andy4729\n\n" );
// Update the text field values.
textField -e -text "testmod_src" text_Qc_03; // Ex: textField -e -text "sourceforts_src" text_Qc_03;
textField -e -text "andy4729" text_studio_03; // Ex: textField -e -text "Stieffers" text_studio_03;
}
// Resize the window....
window -e -wh 532 118 $myWindow;
When I run this code to compile the model, i get the following output:
-PATHS---------------------------
C:\Program Files\Valve\Steam\Steamapps\andy4729\source_sdk\bin\studiomdl.exe
C:\Program Files\Valve\Steam\Steamapps\SourceMods\testmod_src\modelsrc\cube.qc
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Program Files (x86)\Steam\steamapps\SourceMods\testmod_src\materialsrc\models>The system cannot find the path specified.
'studiomdl.exe' is not recognized as an internal or external command,
operable program or batch file.
Completed compiling C:\Program Files\Valve\Steam\Steamapps\SourceMods\testmod_src\modelsrc\cube.qc
I have Steam running and the SourceSDK open with testmod as the current toolset.