@@ -352,6 +352,7 @@ public int ConfigureMaya(string mayaPath)
352
352
myProcess . StartInfo . WindowStyle = System . Diagnostics . ProcessWindowStyle . Hidden ;
353
353
myProcess . StartInfo . CreateNoWindow = true ;
354
354
myProcess . StartInfo . UseShellExecute = false ;
355
+ myProcess . StartInfo . RedirectStandardError = true ;
355
356
356
357
string commandString ;
357
358
@@ -386,6 +387,14 @@ public int ConfigureMaya(string mayaPath)
386
387
ExitCode = myProcess . ExitCode ;
387
388
Debug . Log ( string . Format ( "Ran maya: [{0}]\n With args [{1}]\n Result {2}" ,
388
389
mayaPath , myProcess . StartInfo . Arguments , ExitCode ) ) ;
390
+
391
+ // see if we got any error messages
392
+ if ( ExitCode != 0 ) {
393
+ string stderr = myProcess . StandardError . ReadToEnd ( ) ;
394
+ if ( ! string . IsNullOrEmpty ( stderr ) ) {
395
+ Debug . LogError ( string . Format ( "Maya installation error (exit code: {0}): {1}" , ExitCode , stderr ) ) ;
396
+ }
397
+ }
389
398
}
390
399
else
391
400
{
@@ -625,6 +634,7 @@ public static int InstallMaxPlugin(string maxExe){
625
634
myProcess . StartInfo . WindowStyle = System . Diagnostics . ProcessWindowStyle . Hidden ;
626
635
myProcess . StartInfo . CreateNoWindow = true ;
627
636
myProcess . StartInfo . UseShellExecute = false ;
637
+ myProcess . StartInfo . RedirectStandardOutput = true ;
628
638
629
639
myProcess . StartInfo . Arguments = string . Format ( "-q -silent -mxs \" {0}\" " , installScript ) ;
630
640
@@ -644,6 +654,14 @@ public static int InstallMaxPlugin(string maxExe){
644
654
ExitCode = 0 ;
645
655
}
646
656
657
+ // print any errors
658
+ if ( ExitCode != 0 ) {
659
+ string stderr = myProcess . StandardOutput . ReadToEnd ( ) ;
660
+ if ( ! string . IsNullOrEmpty ( stderr ) ) {
661
+ Debug . LogError ( string . Format ( "3ds Max installation error (exit code: {0}): {1}" , ExitCode , stderr ) ) ;
662
+ }
663
+ }
664
+
647
665
Debug . Log ( string . Format ( "Ran max: [{0}]\n With args [{1}]\n Result {2}" ,
648
666
maxExe , myProcess . StartInfo . Arguments , ExitCode ) ) ;
649
667
}
0 commit comments