Noticed this when upgrading from 21.6.0 to 21.10.0. I’ve isolated it to 21.9.0
Following code should show the issue:
[TestFixture]
public class Tests
{
[ OneTimeSetUp ]
public void Setup()
{
var l = new License();
l.SetLicense(@"<my license file>");
}
[Test, Parallelizable(ParallelScope.All)]
public void SimpleScene_SaveAndOpen_FileStream_Successful([ValueSource(nameof(FBXTestFormats))] FileFormat fileFormat)
{
Scene scene = new Scene();
var cubeNode = scene.RootNode.CreateChildNode("Cube Node");
cubeNode.Entities.Add(new Box(10, 10, 10).ToMesh());
string fileName = Path.ChangeExtension(Path.GetRandomFileName(), ".fbx");
string temporaryFilePath = Path.Combine(TestContext.CurrentContext.WorkDirectory, fileName);
using (var fs = File.Create(temporaryFilePath))
scene.Save(fs, fileFormat);
Scene openScene = new Scene();
using (var fs = File.OpenRead(temporaryFilePath))
openScene.Open(fs, fileFormat);
Node outCube = openScene.RootNode.GetChild("Cube Node");
Assert.NotNull(outCube);
Assert.NotNull(outCube.GetEntity<Mesh>());
}
public static IEnumerable<FileFormat> FBXTestFormats()
{
yield return FileFormat.FBX7500ASCII;
yield return FileFormat.FBX7500Binary;
yield return FileFormat.FBX7400ASCII;
yield return FileFormat.FBX7400Binary;
yield return FileFormat.FBX7700Binary;
yield return FileFormat.FBX7700ASCII;
}
}
Happens for binary formats only. ASCII is fine.