Browse our Products

Aspose.3D for Java 24.2 Release Notes

Improvements and Changes

KeySummaryCategory
THREEDJAVA-329Add native InputStream/OutputStream for Scene’s IO operationsImprovement
THREEDNET-1499OBJ to GLTF - large number of verticesImprovement
THREEDNET-1509Upgrade .net 7.0 support to .net 8.0Improvement
THREEDNET-1460Fbx exported skeleton nodes don’t have transformation but have pose insteadBug fixing
THREEDNET-1494Added KHR_mesh_quantization extension support in GLTF importBug fixing
THREEDNET-1495Export animations from GLB to FBX may cause Slerp failedBug fixing
THREEDNET-1496Unsupported attribute type may cause Maya importer stopBug fixing
THREEDNET-1497Primitive without a valid property value may failed to load in USDBug fixing
THREEDNET-14983MF external reference issue in build elementBug fixing

API changes

This version is mainly a bug fixing version, a few API changes:

Added members to class com.aspose.threed.Mesh:

    /**
     *  Return triangulated mesh
     *
     * @return Current mesh if current mesh is already triangulated, otherwise a new triangulated mesh will be calculated and returned
     *
     */
    public Mesh triangulate()

This function allows you to triangulate a mesh in simple way.

Sample code

        //The plane mesh has only one polygon with 4 control points
        Mesh mesh = (new Plane()).toMesh();
        //After triangulated, the new mesh's rectangle will become 2 triangles.
        Mesh triangulated = mesh.triangulate();

Added members to class com.aspose.threed.TriMesh:

    /**
     *  Add a new triangle
     *
     * @param a The index of first vertex
     * @param b The index of second vertex
     * @param c The index of third vertex
     */
    public void addTriangle(int a, int b, int c);

    /**    
     * Write vertices data to the specified stream    
     *    
     * @param stream The stream that the vertices data will be written to    
     */    
    public void writeVerticesTo(OutputStream stream)    throws IOException;

    /**    
     * Write the indices data as 16bit integer to the stream    
     *    
     * @param stream     
     * </pre>    
     *    
     */    
    public void write16bIndicesTo(OutputStream stream)    throws IOException;
        
    /**    
     * Write the indices data as 32bit integer to the stream    
     *    
     * @param stream     
     */    
    public void write32bIndicesTo(OutputStream stream)    throws IOException;

This function allows you to manually add triangle to the TriMesh.

Sample code

  int[] indices = new int[] { 0,  1,  2 };
  byte[] vertices = new byte[]{
      0, 0, 0, 191,
      0, 0, 0, 0,
      0, 0, 0, 191,
      0, 0, 0, 191,
      0, 0, 0, 0,
      0, 0, 0, 63,
      0, 0, 0, 63,
      0, 0, 0, 0,
      0, 0, 0, 63
  };

  VertexDeclaration vd = new VertexDeclaration();
  vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.POSITION);
  //create an empty TriMesh with specified vertex declaration
  var triMesh = new TriMesh("", vd);
  //load vertices directly from bytes
  triMesh.loadVerticesFromBytes(vertices);
  triMesh.addTriangle(0, 1, 2);

Added members to class com.aspose.threed.Scene:

    /**    
     *  Opens the scene from given stream using specified file format.    
     *    
     * @param stream Input stream, user is responsible for closing the stream.    
     * @param format File format.    
     * @param cancellationToken Cancellation token to the load task    
     *    
     */    
    public static Scene fromStream(InputStream stream, FileFormat format, Cancellation cancellationToken)    
            throws IOException    
    /**    
     *  Opens the scene from given stream using specified file format.    
     *    
     * @param stream Input stream, user is responsible for closing the stream.    
     * @param format File format.    
     *    
     */    
    public static Scene fromStream(InputStream stream, FileFormat format)    
            throws IOException    
    /**    
     *  Opens the scene from given stream using specified IO config.    
     *    
     * @param stream Input stream, user is responsible for closing the stream.    
     * @param options More detailed configuration to open the stream.    
     * @param cancellationToken Cancellation token to the load task    
     *    
     */    
    public static Scene fromStream(InputStream stream, LoadOptions options, Cancellation cancellationToken)    
            throws IOException    
    /**    
     *  Opens the scene from given stream using specified IO config.    
     *    
     * @param stream Input stream, user is responsible for closing the stream.    
     * @param options More detailed configuration to open the stream.    
     */    
    public static Scene fromStream(InputStream stream, LoadOptions options)    
            throws IOException    
    /**    
     *   Opens the scene from given stream    
     *    
     * @param stream Input stream, user is responsible for closing the stream.    
     * @param cancellationToken Cancellation token to the load task    
     *    
     */    
    public static Scene fromStream(InputStream stream, Cancellation cancellationToken)    
            throws IOException    
    /**    
     *   Opens the scene from given stream    
     *    
     * @param stream Input stream, user is responsible for closing the stream.    
     *    
     */    
    public static Scene fromStream(InputStream stream)    
            throws IOException    
    /**    
     *  Opens the scene from given stream using specified file format.    
     *    
     * @param stream Input stream, user is responsible for closing the stream.    
     * @param format File format.    
     * @param cancellationToken Cancellation token to the load task    
     *    
     */    
    public void open(InputStream stream, FileFormat format, Cancellation cancellationToken)    
            throws IOException    
    /**    
     *  Opens the scene from given stream using specified file format.    
     *    
     * @param stream Input stream, user is responsible for closing the stream.    
     * @param format File format.    
     *    
     */    
    public void open(InputStream stream, FileFormat format)    
            throws IOException    
    /**    
     *  Opens the scene from given stream using specified IO config.    
     *    
     * @param stream Input stream, user is responsible for closing the stream.    
     * @param options More detailed configuration to open the stream.    
     * @param cancellationToken Cancellation token to the load task    
     *    
     */    
    public void open(InputStream stream, LoadOptions options, Cancellation cancellationToken)    
            throws IOException    
    /**    
     *  Opens the scene from given stream using specified IO config.    
     *    
     * @param stream Input stream, user is responsible for closing the stream.    
     * @param options More detailed configuration to open the stream.    
     *    
     */    
    public void open(InputStream stream, LoadOptions options)    
            throws IOException    
    /**    
     *   Opens the scene from given stream    
     *    
     * @param stream Input stream, user is responsible for closing the stream.    
     *    
     */    
    public void open(InputStream stream)    
            throws IOException    
    /**    
     *   Opens the scene from given stream    
     *    
     * @param stream Input stream, user is responsible for closing the stream.    
     * @param cancellationToken Cancellation token to the load task    
     *    
     */    
    public void open(InputStream stream, Cancellation cancellationToken)    
            throws IOException    
    /**    
     *  Saves the scene to stream using specified file format.    
     *    
     * @param stream Input stream, user is responsible for closing the stream.    
     * @param format Format.    
     *    
     */    
    public void save(OutputStream stream, FileFormat format)    
            throws IOException    
    /**    
     *  Saves the scene to stream using specified file format.    
     *    
     * @param stream Input stream, user is responsible for closing the stream.    
     * @param format Format.    
     * @param cancellationToken Cancellation token to the save task    
     */    
    public void save(OutputStream stream, FileFormat format, Cancellation cancellationToken)    
            throws IOException    
    /**    
     *  Saves the scene to stream using specified file format.    
     *    
     * @param stream Input stream, user is responsible for closing the stream.    
     * @param options More detailed configuration to save the stream.    
     *    
     */    
    public void save(OutputStream stream, SaveOptions options)    
            throws IOException    
    /**    
     *  Saves the scene to stream using specified file format.    
     *    
     * @param stream Input stream, user is responsible for closing the stream.    
     * @param options More detailed configuration to save the stream.    
     * @param cancellationToken Cancellation token to the save task    
     *    
     */    
    public void save(OutputStream stream, SaveOptions options, Cancellation cancellationToken)    
            throws IOException    

There were only Stream version of save/open/fromStream before, now we support InputStream/OutputStream from JDK.