Convert FBX to OBJ in C#

An FBX file is a format used to exchange 3D geometry and animation data. You can use Aspose.CAD to open and export high-fidelity 2D and 3D files. Specifically, we can create and save designs for construction projects such as highways, bridges, and buildings in a FBX file. In certain cases, we may need to export drawings from FBX files to OBJ documents programmatically. Such conversions allow sharing of drawings in a portable format. In this article, we will learn how to convert a FBX file to a OBJ in C#.

The following topics shall be covered in this article:

  1. C# FBX to OBJ Converter – Free Download
  2. Steps to Convert FBX File to OBJ Document
  3. Convert FBX to OBJ Programmatically
  4. Export FBX to OBJ with Options

C# FBX to OBJ Converter – Free Download

We will be using the Aspose.CAD for.NET API to convert an FBX file to an OBJ document. The ability to create, edit, and manipulate FBX files as well as a number of other file formats is provided.

All types of drawings are subclasses of the API’s Image class. FBX images are represented by the class FbxImage. The CadRasterizationOptions class allows us to set the PageWidth and PageHeight properties. The OBJ options can be specified using the API’s ObjOptions class.

Please either download the DLL of the API or install it using NuGet.

PM> Install-Package Aspose.CAD

How to Convert FBX File to OBJ using C#

We can easily convert a FBX file to a OBJ document using Aspose.CAD for .NET by following the steps given below:

  • Load a FBX drawing file.
  • Save FBX as OBJ.

Now, let’s see how to perform these steps in C# to convert a FBX file to a OBJ document.

Convert FBX to OBJ Programmatically in C#

Please follow the steps given below to convert a FBX to a OBJ:

  1. Firstly, load an input FBX file using the Image class.
  2. After that, create an instance of the ObjOptions class.
  3. Finally, call Save() method to save it as a OBJ. It takes the output OBJ file path and ObjOptions as arguments.

The following code sample shows how to convert a FBX file to a OBJ document using C#.

Export FBX to OBJ with Options in C#

We can specify OBJ save options while converting a FBX file to a OBJ document by following the steps given below:

  1. Have used the Image class to load an input FBX file first.
  2. Next, create a new instance of the class CadRasterizationOptions.
  3. Now, set the width and height of the page.
  4. The next step is to make an instance of the ObjOptions class.
  5. Next, select CadRasterizationOptions for the VectorRasterizationOptions property.
  6. To save it as an OBJ, utilize the Save() method. It accepts two arguments: ObjOptions and the path of the output OBJ file.

The following code sample shows how to specify the page height and width while saving a FBX file as a OBJ document using C#.

Get Free Temporary License

You can get a free temporary license to try the library without evaluation limitations.

Conclusion

In this article, we have learned how to:

  • load an existing FBX drawing file;
  • specify page height and width;
  • define save options;
  • save FBX as a OBJ in C#.

Developers use FBX models to exchange detailed geometry data and animation data, including textures and colors, between applications and platforms. Besides converting a FBX to a OBJ in C#, you can learn more about Aspose.CAD for .NET API using the documentation. In case of any ambiguity, please feel free to contact us on our free support forum.

See Also