Aspose.3D for Java 21.6发行说明

改进和变更

钥匙摘要类别
THREEDNET-870添加USDC出口支持。新功能
THREEDNET-891暴露zip归档文件系统新功能
THREEDNET-892允许FBX导出器在导出期间嵌入纹理。新功能
THREEDNET-895修复节点名称中的某些字符将导致生成的GLB文件无法通过验证错误修复
THREEDNET-896修复了空场景无法导出到有效的glb文件错误修复
THREEDNET-890在USDC中添加材质/纹理导出改进
THREEDNET-899为FBX纹理公开RelativeFilename的属性改进

API更改

将USD添加为导出类型

从21.6,您可以通过以下方式将场景导出到USD文件中:

    Scene scene = new Scene();
    //...prepare your scene
    scene.save("test.usd", FileFormat.USD);

添加了新的类com.aspose.threed.ZipArchiveFileSystem

glb/fbx和其他支持纹理嵌入的文件格式可以通过使用ZipArchiveFileSystem保存options.FileSystem通过zip文件访问外部资产。

将新属性添加到类com.aspose.threed.FbxSaveOptions

    /**
     * Gets whether to embed the texture to the final output file.
     * FBX Exporter will try to find the texture's raw data from {@link com.aspose.threed.IOConfig#getFileSystem}, and embed the file to final FBX file.
     * Default value is false.
     */
    public boolean getEmbedTextures();
    
    /**
     * Sets whether to embed the texture to the final output file.
     * FBX Exporter will try to find the texture's raw data from {@link com.aspose.threed.IOConfig#getFileSystem}, and embed the file to final FBX file.
     * Default value is false.
     * @param value New value
     */
    public void setEmbedTextures(boolean value);

示例代码:

    var scene = new Scene();
    var opt = new FbxSaveOptions(FileFormat.FBX7700ASCII);
    opt.setEmbedTextures(true);
    var tex = new Texture();
    tex.setFileName("test.png");
    var mat = new PhongMaterial();
    mat.setTexture(Material.MAP_DIFFUSE, tex);
    var planeNode = scene.getRootNode().createChildNode(new Plane());
    planeNode.setMaterial(mat);
    scene.save("plane-with-texture.fbx", opt);