Aspose.3D for .NET 21.2 Release Notes

Improvements and Changes

KeySummaryCategory
THREEDNET-825Add USDZ import support.New feature
THREEDNET-824Add texture support in USDZTask
THREEDNET-811Implement an evaluation version related Exception in the APIImprovement
THREEDNET-813Technical details are required on Material and Texture API limitations - API doesn’t provide a way to discover textures on materialsImprovement
THREEDNET-817Add support for texture byte[] in case of glb, gltf, objImprovement
THREEDAPP-80Improve the page loading speed of web rendererImprovement
THREEDNET-814Triangle indices are not correctBug fix
THREEDNET-809FBX Save Exception: Unsupported attribute typeBug fix
THREEDNET-810Filesize is getting bigger while reusing the same textureBug fix
THREEDNET-816Incorrect mesh while loading OBJBug fix
THREEDNET-807There is no texture in the exported FBXBug fix
THREEDNET-815Materials with shader model = Unknown will failed to render.Bug fix
THREEDNET-823Multiple mesh attached to same node is not rendering.Bug fix
THREEDNET-647Add scaling control UI in web renderer.Task
THREEDNET-646Add rotation control UI in web renderer.Task

API changes

Added class Aspose.ThreeD.Shading.TextureSlot

This exposed the internal texture slots in materials, in order to access all available texture slots from a material, use foreach statement:

var mat = new PbrMaterial();
foreach(var textureSlot in mat)
{
    Console.WriteLine(textureSlot.SlotName);
    Console.WriteLine(textureSlot.Texture);
}

Added class Aspose.ThreeD.TrialException

From 21.2, when the unlicensed usage reached the license restriction, a TrialException will be thrown to notify the license restriction, and how to apply for a temporary license.

You can simply ignore this by surround try/catch block on the Save/Open operation, or turn this exception off by:

TrialException.SuppressTrialException = true;

Turn this message off will not lift the restrictions(Like extra nodes are ignored by exporter/importer).

In order to get all full feature, please request a temporary license or buy a full feature license.

Added methods to Aspose.ThreeD.Entities.TriMesh

public Aspose.ThreeD.Utilities.Vector4 ReadVector4(int idx, Aspose.ThreeD.Utilities.VertexField field);
public Aspose.ThreeD.Utilities.FVector4 ReadFVector4(int idx, Aspose.ThreeD.Utilities.VertexField field);
public Aspose.ThreeD.Utilities.Vector3 ReadVector3(int idx, Aspose.ThreeD.Utilities.VertexField field);
public Aspose.ThreeD.Utilities.FVector3 ReadFVector3(int idx, Aspose.ThreeD.Utilities.VertexField field);
public Aspose.ThreeD.Utilities.Vector2 ReadVector2(int idx, Aspose.ThreeD.Utilities.VertexField field);
public Aspose.ThreeD.Utilities.FVector2 ReadFVector2(int idx, Aspose.ThreeD.Utilities.VertexField field);
public double ReadDouble(int idx, Aspose.ThreeD.Utilities.VertexField field);
public float ReadFloat(int idx, Aspose.ThreeD.Utilities.VertexField field);

These methods allow you to read vertex’s field without allocating extra memory, the traditional way of accessing vertex from TriMesh actually generates a lot of temporary object, these can provide fast and low-memory footprint access.

Scene s = new Scene(@"test.STL");
var mesh = (Mesh)s.RootNode.ChildNodes[0].Entity;

//Create a new VertexDeclaration, so the TriMesh we constructed later will use this memory layout.
var vd = new VertexDeclaration();
var pos = vd.AddField(VertexFieldDataType.FVector3, VertexFieldSemantic.Position);
var normal = vd.AddField(VertexFieldDataType.FVector3, VertexFieldSemantic.Normal);
var uv = vd.AddField(VertexFieldDataType.FVector2, VertexFieldSemantic.UV);
//create a TriMesh instance from Mesh instance with manually specified vertex declaration
var m = TriMesh.FromMesh(vd, mesh);
for(int i = 0; i < m.VerticesCount; i++)
{
    //access each field
    var v_pos = m.ReadFVector3(i, pos);
    var v_normal = m.ReadFVector3(i, normal);
    var v_uv = m.ReadFVector3(i, uv);
    Console.WriteLine($"({v_pos}), ({v_uv}), ({v_normal})");
}

Added new file format in Aspose.ThreeD.FileFormat

/// <summary>
/// Compressed Universal Scene Description
/// </summary>
public static readonly FileFormat USDZ;

Aspose.3D 21.2 can load USDZ format now.

Fixed the inconsistent APIs:

These old classes will be kept for a while, and new classes are introduced to replace them:

Old ClassNew Class
Aspose.ThreeD.Formats.A3DWSaveOptionsAspose.ThreeD.Formats.A3dwSaveOptions
Aspose.ThreeD.Formats.AMFSaveOptionsAspose.ThreeD.Formats.AmfSaveOptions
Aspose.ThreeD.Formats.Discreet3DSLoadOptionsAspose.ThreeD.Formats.Discreet3dsLoadOptions
Aspose.ThreeD.Formats.Discreet3DSSaveOptionsAspose.ThreeD.Formats.Discreet3dsSaveOptions
Aspose.ThreeD.Formats.FBXLoadOptionsAspose.ThreeD.Formats.FbxLoadOptions
Aspose.ThreeD.Formats.FBXSaveOptionsAspose.ThreeD.Formats.FbxSaveOptions
Aspose.ThreeD.Formats.GLTFLoadOptionsAspose.ThreeD.Formats.GltfLoadOptions
Aspose.ThreeD.Formats.GLTFSaveOptionsAspose.ThreeD.Formats.GltfSaveOptions
Aspose.ThreeD.Formats.HTML5SaveOptionsAspose.ThreeD.Formats.Html5SaveOptions
Aspose.ThreeD.Formats.STLLoadOptionsAspose.ThreeD.Formats.StlLoadOptions
Aspose.ThreeD.Formats.STLSaveOptionsAspose.ThreeD.Formats.StlSaveOptions
Aspose.ThreeD.Formats.U3DLoadOptionsAspose.ThreeD.Formats.U3dLoadOptions