Hi,
I am trying to convert .obj
files to .glb
, but I am facing Exceptions:
Caused by: com.aspose.threed.ExportException at com.aspose.threed.c.a(SourceFile:19117) at com.aspose.threed.Scene.save(SourceFile:573) at com.aspose.threed.Scene.save(SourceFile:636) at com.aspose.threed.Scene.save(SourceFile:649)
After Debugging into Aspose, I was able to get the following Stacktrace inside the catch block, where the ExportException is thrown.
java.lang.NullPointerException at com.aspose.threed.dk.a(SourceFile:8315) at com.aspose.threed.dk.a(SourceFile:16742) at com.aspose.threed.dk.a(SourceFile:1167) at com.aspose.threed.dk.a(SourceFile:23120) at com.aspose.threed.dk.b(SourceFile:1210) at com.aspose.threed.dk.a(SourceFile:3237) at com.aspose.threed.c.a(SourceFile:19105) at com.aspose.threed.Scene.save(SourceFile:573) at com.aspose.threed.Scene.save(SourceFile:636) at com.aspose.threed.Scene.save(SourceFile:649)
Here is my Code:
`var filePath = “C:\develop\test\”;
var fileName = “al.obj”;
FileFormat fileFormat = FileFormat.detect(filePath + fileName);
Scene scene = new Scene();
scene.open(filePath + fileName, fileFormat);
GLTFSaveOptions gltfSaveOptions = new GLTFSaveOptions(FileContentType.BINARY);
scene.save(filePath + FilenameUtils.getBaseName(fileName) + “.glb”,
gltfSaveOptions);`
I used the Maven artifact version 19.2 and took the al.obj
file for testing from here: OBJ Files - A 3D Object Format
What am I doing wrong? Thank you for your help.