Skip to content

Instantly share code, notes, and snippets.

@aspose-cloud
Last active October 24, 2021 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-cloud/be9433f750cf8f650ec6a4525060cce0 to your computer and use it in GitHub Desktop.
Save aspose-cloud/be9433f750cf8f650ec6a4525060cce0 to your computer and use it in GitHub Desktop.
This Gist contains code snippets related to conversion FBX file to OBJ format using Aspose.3D Cloud SDK for .NET
This Gist contains code snippets related to conversion FBX file to OBJ format using Aspose.3D Cloud SDK for .NET
// Get ClientID from https://dashboard.aspose.cloud/
string clientSecret = "d757548a9f2558c39c2feebdf85b4c44";
string clientID = "4db2f826-bf9c-42e7-8b2a-8cbca2d15553";
// name of input FBX file
String inputFileName = "Wolf-Blender-2.82a.fbx";
// resultant file format
String newFormat = "wavefrontobj";
// name of output file
String newFileName = "resultant.obj";
// create an instance of ThreeDCloud API
ThreeDCloudApi threeDCloudApi = new ThreeDCloudApi("client_credentials", clientID, clientSecret);
try
{
// load input FBX from local drive
using (var inputStream = new FileStream("C:\\Users\\nayyer\\Downloads\\" + inputFileName, FileMode.Open))
{
// upload file to Cloud storage
threeDCloudApi.UploadFile(inputFileName, inputStream);
// initiate the file conversion operation
var response = threeDCloudApi.PostConvertByFormatWithHttpInfo(inputFileName, newFormat, newFileName, null, isOverwrite: true, null);
// print success message if conversion is successful
if (response != null && response.Equals("OK"))
{
Console.WriteLine("Successfully converted FBX to OBJ !");
Console.ReadKey();
}
}
}catch (Exception ex)
{
Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment