Hey,
So I’m currently using WPF and Monogame together to make a sort of rendering software for myself. What I’m trying to do right now is make FBX models loadable directly through my software. I have MGCB.exe imported along with all the .dlls, and it says that the build has been started. Interestingly, I can’t find outputted .xnb files anywhere. I’ve scoured my whole harddrive to no avail.
Here’s a picture of the console when the program is run:
Here’s the code handling all the converting:
//A correct file was found and the path is valid.
if (_filePath != null)
{
//Go to current domain and then go to premade directory with pipeline.
var fn = AppDomain.CurrentDomain.BaseDirectory + "\\FBX Converter\\MGCB.exe";
var process = new Process();
process.StartInfo.FileName = $"\"{fn}\"";
process.StartInfo.WorkingDirectory = "D:\\Downloads\\bigboss";
process.StartInfo.Arguments =
"/outputDir:bin /intermediateDir:obj /platform:Windows /config: /profile:Reach /compress:False " +
"/importer:FbxImporter /processor:ModelProcessor /processorParam:ColorKeyColor=0,0,0,0 " +
"/processorParam:ColorKeyEnabled=True /processorParam:DefaultEffect=BasicEffect " +
"/processorParam:GenerateMipmaps=True /processorParam:GenerateTangentFrames=False " +
"/processorParam:PremultiplyTextureAlpha=True /processorParam:PremultiplyVertexColors=True " +
"/processorParam:ResizeTexturesToPowerOfTwo=False /processorParam:RotationX=0 " +
"/processorParam:RotationY=0 /processorParam:RotationZ=0 /processorParam:Scale=1 " +
"/processorParam:SwapWindingOrder=False " +
"/processorParam:TextureFormat=Compressed /build:VertexColorTree.fbx";
process.Start();
}
And here’s the entire method if you happen to need it (some code is irrelevant to this);
private void ButtonOpen_OnClick(object sender, RoutedEventArgs e)
{
string _filePath = null;
// Create OpenFileDialog
Microsoft.Win32.OpenFileDialog _dlg = new Microsoft.Win32.OpenFileDialog();
// Set filter for file extension and default file extension
_dlg.DefaultExt = ".fbx";
_dlg.Filter = "FBX Files (*.fbx)|*.fbx"; //FORMAT: "Description Shown In Editor|.AllowedExtension"
// Display OpenFileDialog by calling ShowDialog method
Nullable<bool> _result = _dlg.ShowDialog();
// Get the selected file name and display in a TextBox
if (_result.HasValue && _result.Value)
{
// Get document path.
_filePath = _dlg.FileName;
}
//A correct file was found and the path is valid.
if (_filePath != null)
{
//Go to current domain and then go to premade directory with pipeline.
var fn = AppDomain.CurrentDomain.BaseDirectory + "\\FBX Converter\\MGCB.exe";
var process = new Process();
process.StartInfo.FileName = $"\"{fn}\"";
process.StartInfo.WorkingDirectory = "D:\\Downloads\\bigboss";
process.StartInfo.Arguments =
"/outputDir:bin /intermediateDir:obj /platform:Windows /config: /profile:Reach /compress:False " +
"/importer:FbxImporter /processor:ModelProcessor /processorParam:ColorKeyColor=0,0,0,0 " +
"/processorParam:ColorKeyEnabled=True /processorParam:DefaultEffect=BasicEffect " +
"/processorParam:GenerateMipmaps=True /processorParam:GenerateTangentFrames=False " +
"/processorParam:PremultiplyTextureAlpha=True /processorParam:PremultiplyVertexColors=True " +
"/processorParam:ResizeTexturesToPowerOfTwo=False /processorParam:RotationX=0 " +
"/processorParam:RotationY=0 /processorParam:RotationZ=0 /processorParam:Scale=1 " +
"/processorParam:SwapWindingOrder=False " +
"/processorParam:TextureFormat=Compressed /build:VertexColorTree.fbx";
process.Start();
}
}
DLLs and all that jazz:
Why isn’t the builder exporting an .xnb file as it should? I’m trying to build a file called VertexColorTree.fbx if that helps.