Troubleshooting Aspose.3D for .NET

Troubleshooting Aspose.3D for .NET

Troubleshooting Aspose.3D for .NET

This page covers the most common problems encountered when working with Aspose.3D for .NET and how to resolve them.


Loading Problems

Exception: “File format not supported” or unknown extension

Aspose.3D auto‑detects the format from the file extension. If the extension is missing or non‑standard, specify the format explicitly:

var scene = new Scene();

Note: The Camera API has been modified in this release; see the updated Camera documentation for the new constructors and members. scene.Open(“model.bin”, FileFormat.GLTF2_Binary);


#### Scene loads but contains no geometry

The file loaded successfully but `scene.RootNode.ChildNodes` is empty or all nodes have no entities.

| Cause | Fix |
|---|---|
| File is a valid container but content uses unsupported extensions | Inspect the file with a hex editor; ensure the format is in the [supported format list](../developer-guide/format-support) |
| glTF file is missing its `.bin` buffer | Keep all `.bin` and texture files in the same directory as the `.gltf` file |
| FBX version too old (pre-2013) | Re-export from source application using FBX 2013 or later |

#### `IOException` when loading a stream

Ensure the stream is positioned at the start before passing it to `Scene.Open`:

```csharp
stream.Seek(0, SeekOrigin.Begin);
scene.Open(stream, FileFormat.STLBinary);

Saving Problems

Output file is empty or zero bytes

This usually means the scene had no geometry when saved.

// Verify before saving
Console.WriteLine("Nodes: " + scene.RootNode.ChildNodes.Count);
scene.Save("output.gltf");

glTF output references missing textures

When saving as .gltf (non-binary), textures are written as separate files. If you need a single portable file, save as GLB:

scene.Save("output.glb", FileFormat.GLTF2_Binary);

Rendering Problems

Rendered image is solid black

A black output image means either no lights are in the scene or the camera is positioned inside geometry.

// Always add at least one light
var light = new Light("sun") { LightType = LightType.Directional };
var lightNode = scene.RootNode.CreateChildNode("sun", light);
lightNode.Transform.EulerAngles = new Vector3(45, -30, 0);

Object is not visible in the rendered image

The camera may be pointing away from the geometry. Use LookAt to aim the camera at the scene origin or the bounding centre of the model:

cameraNode.Transform.EulerAngles = new Vector3(-30, 0, 0); // tilt down toward scene

Rendered image dimensions are wrong

The Size parameter passed to Scene.Render controls the output pixel dimensions. Verify both the Size argument and the ImageFormat:

scene.Render(camera, "output.png",
    new Vector2(1280, 720),
    "png");

Installation Problems

dotnet add package reports “package not found”

Confirm the exact package name and version:

dotnet add package Aspose.3D.FOSS

If the package is not in the default NuGet feed, add the Aspose NuGet source:

dotnet nuget add source https://releases.aspose.com/net/repo/ --name Aspose

Diagnostic Checklist

Before opening a support issue, run through this checklist:

  1. Confirm the format is supported — check Format Support.
  2. Check the scene node countscene.RootNode.ChildNodes.Count > 0 after loading.
  3. Add a light before rendering — any LightType.Directional at non-zero EulerAngles.
  4. Verify camera position — call LookAt with the scene centre coordinates.
  5. Use a memory stream to isolate file I/O — if loading from disk fails, try loading into a MemoryStream first.

Related Resources


## See Also

- [Aspose.3D for .NET — Enterprise Knowledge Base](https://kb.aspose.com/3d/net/)