Free Support Forum - aspose.com

Error when reading a GLB and saving as FBX

TestGlbToFbx.zip (14.5 KB)

When I try to load the attached GLB file and then save it back down as an FBX, an exception is thrown.

Here is my test code:

		static void Main(string[] args)
	{
		Console.WriteLine("Setting license");
		Aspose.ThreeD.License license = new Aspose.ThreeD.License();
		license.SetLicense("Aspose.3D.lic");

		System.Reflection.Assembly asm = System.Reflection.Assembly.GetAssembly(typeof(Aspose.ThreeD.Scene));
		Console.WriteLine("Aspose.3d Version: " + asm.FullName);

		asm = System.Reflection.Assembly.GetAssembly(typeof(System.Int32));
		Console.WriteLine(".Net Core Version: " + asm.FullName);


		try
		{
			string fileName = "TestGlbToFbx.glb";
			Console.WriteLine("Reading " + fileName);
			var scene = new Scene(fileName);
			Console.WriteLine("Read!");

			fileName += ".fbx";

			Console.WriteLine("Saving " + fileName);
			var saveOpts = new FBXSaveOptions(FileFormat.FBX7500Binary);
			scene.Save(fileName, saveOpts);
			Console.WriteLine("Saved!");
		}
		catch (Exception ex)
		{
			Console.WriteLine(ex.ToString());
		}

	}

And here is the output:

Setting license

Aspose.3d Version: Aspose.3D, Version=20.3.0.0, Culture=neutral, PublicKeyToken=f071c641d0b4582b
.Net Core Version: System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e

Reading TestGlbToFbx.glb
Read!
Saving TestGlbToFbx.glb.fbx
Exception thrown: ‘Aspose.ThreeD.ExportException’ in Aspose.3D.dll
Aspose.ThreeD.ExportException: Cannot create object Aspose.ThreeD.Shading.PbrMaterial
at #=zKZbeNQzlV19VeA_Matl33uo=.#=zHxDe$3M=(Scene #=zpIsVcXk=, Stream #=zlbX2_To=, SaveOptions #=z8YlLCD8=, CancellationToken #=z9ASrcXk=)
at #=q8DPXuEs2ruzrYn5Bb93t6wjuL8f98bYMff_$IEAtBQY=.#=zZe9mOnEyqVoNm_y4lMqQC3Q=(Object #=zaAIvjJ0=)
at #=q8DPXuEs2ruzrYn5Bb93t6wjuL8f98bYMff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vjJ0=, Type[] #=zwkTkcdc=, Type[] #=zSRoULHQ=, Object[] #=zfZwWqww=)
at #=q8DPXuEs2ruzrYn5Bb93t6wjuL8f98bYMff_$IEAtBQY=.#=zcceGdLqXjZMNH3N8gYa3ErPA8JLidJScEIvScSs=(Stream #=zaAIvjJ0=, Int32 #=zwkTkcdc=, Object[] #=zSRoULHQ=, Type[] #=zfZwWqww=, Type[] #=z1hNr3J0=, Object[] #=zjAPv_nM=)
at #=q8DPXuEs2ruzrYn5Bb93t6wjuL8f98bYMff_$IEAtBQY=.#=zUFMGaay0XQGDuV3Nq$APwfkeqrrPi5tAUQ==(Int32 #=zaAIvjJ0=, Type[] #=zwkTkcdc=, Type[] #=zSRoULHQ=, Boolean #=zfZwWqww=)
at #=q8DPXuEs2ruzrYn5Bb93t6wjuL8f98bYMff_$IEAtBQY=.#=z7MmO3MRALB9EGG9iO_Ljrabfk$Bx(#=q8DPXuEs2ruzrYn5Bb93t6wjuL8f98bYMff_$IEAtBQY= #=zaAIvjJ0=, #=qlKkeiAvo0QRcbCQqKaJMLMkV0qkM0wmG6hDxVUUhb7w= #=zwkTkcdc=)
at #=q8DPXuEs2ruzrYn5Bb93t6wjuL8f98bYMff_$IEAtBQY=.#=zpz4uTgnNhrvcbv9ZiWrawxRDCCRFUCBLzZUkHU8=()
at #=q8DPXuEs2ruzrYn5Bb93t6wjuL8f98bYMff_$IEAtBQY=.#=zNlnkWizUQQASpzm8$hQZzgw=(Boolean #=zaAIvjJ0=)
at #=q8DPXuEs2ruzrYn5Bb93t6wjuL8f98bYMff_$IEAtBQY=.#=zZe9mOnEyqVoNm_y4lMqQC3Q=(Object #=zaAIvjJ0=)
at #=q8DPXuEs2ruzrYn5Bb93t6wjuL8f98bYMff_$IEAtBQY=.#=zQ_P3OSyhfB5bI8stHkUJkSw=()
at #=q8DPXuEs2ruzrYn5Bb93t6wjuL8f98bYMff_$IEAtBQY=.#=z2xJ00b6RwbsoHkmsHQ==(#=q8DPXuEs2ruzrY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f98bYMff_$IEAtBQY=.#=zbvsM6fgWngqt6CvJhsEQ9iQ=(Stream #=zaAIvjJ0=, String #=zwkTkcdc=, Object[] #=zSRoULHQ=, Type[] #=zfZwWqww=, Type[] #=z1hNr3J0=, Object[] #=zjAPv_nM=)
at #=q8DPXuEs2ruzrYn5Bb93t6wjuL8f98bYMff_$IEAtBQY=.#=zPkNlGY34lMYeZq8tEiofYIdIsQfo(Stream #=zaAIvjJ0=, String #=zwkTkcdc=, Object[] #=zSRoULHQ=)
at #=q8DPXuEs2ruzrYn5Bb93t6wjuL8f98bYMff_$IEAtBQY=.#=zuwgqBTGXGTN39tEPmsdx0Jc=(Stream #=zaAIvjJ0=, String #=zwkTkcdc=, Object[] #=zSRoULHQ=)
at Aspose.ThreeD.Scene.Save(String fileName, SaveOptions options, CancellationToken cancellationToken)
at Aspose3dTest.Program.Main(String[] args) in D:\Projects\Aspose3dTest\Program.cs:line 37

@OBCad,

We were able to reproduce the issue in our environment while using Aspose.3D for .NET 20.5 and logged it as THREEDNET-687 in our issue tracking system. We will further look into its details and keep you posted with the status of its rectification. Please be patient and spare us some time.

We are sorry for the inconvenience.

Issue THREEDNET-687 has a status of resolved, but I don’t see it referenced in the 20.5 release notes, and the error still occurs in 20.5.

Do you know when the release will come out, or could you share a link to the appropriate release?

@OBCad

The ticket THREEDNET-687 has been resolved in the upcoming version i.e. Aspose.3D for .NET 20.6 which is not released yet. We will surely inform you as soon as fix-in version is available for download which is expected next week.

The issues you have found earlier (filed as THREEDNET-687) have been fixed in Aspose.3D for .NET 20.6.