We have written blender python script which is used for creating stl file. This script is working fine and using GPU when we are running it using command line. We have integrated script in c# code and code is deployed on IIS. On IIS server script is not using GPU and create malformed object sometime. Can we call GPU within IIS server? Please help me.
Below is the C# code:
using (var process = new Process())
{
string command = string.Empty;
command = @"--debug-all --background --python " + """ + scriptFilePath + """ + " " + """ + stlFilePath + """ + " "
+ """ + newStlFilePath + """ + " " + """ + fileName + """ + " "
+ rows + " " + columns + " " + numberofcoin + " "" + coinDiameter + """ + " "" + printerTypeId + """ + " "" + objectType + """;
process.StartInfo.FileName = blenderExePath;
process.StartInfo.Arguments = $"{command}";
process.StartInfo.CreateNoWindow = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.OutputDataReceived += (sender, data) => Console.WriteLine(data.Data);
//process.OutputDataReceived += (Object _sender, DataReceivedEventArgs _args) => Process_OutputDataReceived(_sender, _args);
//process.ErrorDataReceived += (sender, data) => Console.WriteLine(data.Data);
process.ErrorDataReceived += (Object _sender, DataReceivedEventArgs _args) => Process_ErrorDataReceived(_sender, _args);
//Console.WriteLine("starting");
process.Start();
process.BeginOutputReadLine();
process.BeginErrorReadLine();
process.WaitForExit(1000 * 5); // (optional) wait up to 5 seconds
}
1