@@ -345,6 +345,7 @@ public int ConfigureMaya(string mayaPath)
345
345
myProcess . StartInfo . WindowStyle = System . Diagnostics . ProcessWindowStyle . Hidden ;
346
346
myProcess . StartInfo . CreateNoWindow = true ;
347
347
myProcess . StartInfo . UseShellExecute = false ;
348
+ myProcess . StartInfo . RedirectStandardError = true ;
348
349
349
350
string commandString ;
350
351
@@ -379,6 +380,14 @@ public int ConfigureMaya(string mayaPath)
379
380
ExitCode = myProcess . ExitCode ;
380
381
Debug . Log ( string . Format ( "Ran maya: [{0}]\n With args [{1}]\n Result {2}" ,
381
382
mayaPath , myProcess . StartInfo . Arguments , ExitCode ) ) ;
383
+
384
+ // see if we got any error messages
385
+ if ( ExitCode != 0 ) {
386
+ string stderr = myProcess . StandardError . ReadToEnd ( ) ;
387
+ if ( ! string . IsNullOrEmpty ( stderr ) ) {
388
+ Debug . LogError ( string . Format ( "Maya installation error (exit code: {0}): {1}" , ExitCode , stderr ) ) ;
389
+ }
390
+ }
382
391
}
383
392
else
384
393
{
@@ -618,6 +627,7 @@ public static int InstallMaxPlugin(string maxExe){
618
627
myProcess . StartInfo . WindowStyle = System . Diagnostics . ProcessWindowStyle . Hidden ;
619
628
myProcess . StartInfo . CreateNoWindow = true ;
620
629
myProcess . StartInfo . UseShellExecute = false ;
630
+ myProcess . StartInfo . RedirectStandardError = true ;
621
631
622
632
myProcess . StartInfo . Arguments = string . Format ( "-q -silent -mxs \" {0}\" " , installScript ) ;
623
633
@@ -637,6 +647,14 @@ public static int InstallMaxPlugin(string maxExe){
637
647
ExitCode = 0 ;
638
648
}
639
649
650
+ // print any errors
651
+ if ( ExitCode != 0 ) {
652
+ string stderr = myProcess . StandardError . ReadToEnd ( ) ;
653
+ if ( ! string . IsNullOrEmpty ( stderr ) ) {
654
+ Debug . LogError ( string . Format ( "3ds Max installation error (exit code: {0}): {1}" , ExitCode , stderr ) ) ;
655
+ }
656
+ }
657
+
640
658
Debug . Log ( string . Format ( "Ran max: [{0}]\n With args [{1}]\n Result {2}" ,
641
659
maxExe , myProcess . StartInfo . Arguments , ExitCode ) ) ;
642
660
}
0 commit comments