Discreet3dsSaveOptions

Inheritance: java.lang.Object, com.aspose.threed.IOConfig, com.aspose.threed.SaveOptions

public class Discreet3dsSaveOptions extends SaveOptions

3DS 文件的保存选项。

构造函数

构造函数描述
Discreet3dsSaveOptions()Discreet3dsSaveOptions 的构造函数

方法

方法描述
equals(Object arg0)
getClass()
getDuplicatedNameCounterBase()用于为重复名称生成新名称的计数器,默认值为 2。
getDuplicatedNameCounterFormat()重复计数器的格式,默认值为空字符串。
getDuplicatedNameSeparator()对象名称与重复计数器之间的分隔符,默认值为 “_"。
getEncoding()获取基于文本的文件的默认编码。
getExportCamera()获取是否导出场景中的所有相机。
getExportLight()获取是否导出场景中的所有灯光。
getExportTextures()尝试将场景中使用的纹理复制到输出目录。
getFileFormat()获取当前保存/加载选项中指定的文件格式。
getFileName()导出/导入场景的文件名。
getFileSystem()允许用户处理在加载/保存期间如何管理外部依赖项。
getFileSystemFactory()获取 FileSystem 的工厂类。
getFlipCoordinateSystem()获取在导入/导出期间翻转控制点/法线的坐标系。
getGammaCorrectedColor()3ds 文件可能包含同一属性的原始颜色和伽马校正颜色,将此设置为 true 时,如果可能将使用伽马校正颜色,否则 Aspose.3D 将尝试使用原始颜色。
getHighPreciseColor()如果此值为 true,生成的 3ds 文件将使用高精度颜色,即红、绿、蓝每个通道均为 32 位浮点数。
getLookupPaths()某些文件(如 OBJ)依赖外部文件,查找路径将允许 Aspose.3D 查找并加载外部文件。
getMasterScale()获取导出时使用的主比例。
hashCode()
notify()
notifyAll()
setDuplicatedNameCounterBase(int value)用于为重复名称生成新名称的计数器,默认值为 2。
setDuplicatedNameCounterFormat(String value)重复计数器的格式,默认值为空字符串。
setDuplicatedNameSeparator(String value)对象名称与重复计数器之间的分隔符,默认值为 “_"。
setEncoding(Charset value)设置基于文本的文件的默认编码。
setExportCamera(boolean value)设置是否导出场景中的所有相机。
setExportLight(boolean value)设置是否导出场景中的所有灯光。
setExportTextures(boolean value)尝试将场景中使用的纹理复制到输出目录。
setFileName(String value)导出/导入场景的文件名。
setFileSystem(FileSystem value)允许用户处理在加载/保存期间如何管理外部依赖项。
setFileSystemFactory(FileSystemFactory value)设置 FileSystem 的工厂类。
setFlipCoordinateSystem(boolean value)设置在导入/导出期间翻转控制点/法线的坐标系。
setGammaCorrectedColor(boolean value)3ds 文件可能包含同一属性的原始颜色和伽马校正颜色,将此设置为 true 时,如果可能将使用伽马校正颜色,否则 Aspose.3D 将尝试使用原始颜色。
setHighPreciseColor(boolean value)如果此值为 true,生成的 3ds 文件将使用高精度颜色,即红、绿、蓝每个通道均为 32 位浮点数。
setLookupPaths(ArrayList value)某些文件(如 OBJ)依赖外部文件,查找路径将允许 Aspose.3D 查找并加载外部文件。
setMasterScale(double value)设置导出时使用的主比例。
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

Discreet3dsSaveOptions()

public Discreet3dsSaveOptions()

Discreet3dsSaveOptions 的构造函数

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

参数类型描述
arg0java.lang.Object

Returns: 布尔

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getDuplicatedNameCounterBase()

public int getDuplicatedNameCounterBase()

用于为重复名称生成新名称的计数器,默认值为 2。

Returns: int - 用于为重复名称生成新名称的计数器,默认值为 2。

getDuplicatedNameCounterFormat()

public String getDuplicatedNameCounterFormat()

重复计数器的格式,默认值为空字符串。

Returns: java.lang.String - 重复计数器的格式,默认值为空字符串。

getDuplicatedNameSeparator()

public String getDuplicatedNameSeparator()

对象名称与重复计数器之间的分隔符,默认值为 “_"。当场景包含使用相同名称的对象时,Aspose.3D 3DS 导出器将为该对象生成不同的名称。例如有两个名为 “Box” 的节点,第一个节点的名称为 “Box”,第二个节点将在默认配置下获得新名称 “Box_2”。

Returns: java.lang.String - 对象名称与重复计数器之间的分隔符,默认值为 “_"。当场景包含使用相同名称的对象时,Aspose.3D 3DS 导出器将为该对象生成不同的名称。例如有两个名为 “Box” 的节点,第一个节点的名称为 “Box”,第二个节点将在默认配置下获得新名称 “Box_2”。

getEncoding()

public Charset getEncoding()

获取基于文本的文件的默认编码。默认值为 null,表示导入器/导出器将决定使用哪种编码。

Returns: java.nio.charset.Charset - 基于文本的文件的默认编码。默认值为 null,表示导入器/导出器将决定使用哪种编码。

getExportCamera()

public boolean getExportCamera()

获取是否导出场景中的所有相机。

Returns: boolean - 是否导出场景中的所有相机。

getExportLight()

public boolean getExportLight()

获取是否导出场景中的所有灯光。

Returns: boolean - 是否导出场景中的所有灯光。

getExportTextures()

public boolean getExportTextures()

尝试将场景中使用的纹理复制到输出目录。

Returns: boolean - 尝试将场景中使用的纹理复制到输出目录。

getFileFormat()

public FileFormat getFileFormat()

获取当前保存/加载选项中指定的文件格式。

Returns: FileFormat - the file format that specified in current Save/Load option.

getFileName()

public String getFileName()

导出/导入场景的文件名。此项是可选的,但在序列化外部资源(如 OBJ 的材质)时很有用。

Returns: java.lang.String - 导出/导入场景的文件名。此项是可选的,但在序列化外部资源(如 OBJ 的材质)时很有用。

getFileSystem()

public FileSystem getFileSystem()

允许用户处理在加载/保存期间如何管理外部依赖项。

Returns: FileSystem - Allow user to handle how to manage the external dependencies during load/save. Example: The default FileSystem is LocalFileSystem, it is not safe in environment like server side, But you can override the file system access by specifying a different implementation. Aspose.3D provides different FileSystem implementation like:

  • Memory-based file system
  • Directory-based file system
  • Dummy file system
  • Zip file system

您也可以使用自己的实现。

Scene scene = new Scene();
             var material = new PhongMaterial();
             var boxNode = scene.getRootNode().createChildNode(new Box());
             boxNode.setMaterial(material);
 
             var opt = new ObjSaveOptions();
             var memFs = new HashMap<string, MemoryStream>();
             opt.setFileSystem(FileSystem.createMemoryFileSystem(memFs));
 			opt.setFileName("output.obj");
             try(var output = new ByteArrayOutputStream()) {
 				scene.save(output, opt);
 				//The material will be written to variable memFs named output.mtl
 				var materialInBytes = memFs["output.mtl"].toArray();
             }

getFileSystemFactory()

public static FileSystemFactory getFileSystemFactory()

获取 FileSystem 的工厂类。默认工厂将创建 com.aspose.threed.LocalFileSystem,但它不适用于服务器环境。

Returns: FileSystemFactory - the factory class for FileSystem. The default factory will create com.aspose.threed.LocalFileSystem which is not suitable for server environment. Example: The default FileSystem in SaveOptions/LoadOptions is directory-based file system, You can override the default implementation by specify it through IOConfig.FileSystemFactory:

IOConfig.setFileSystemFactory(new FileSystemFactory() {
 				@Override
 				public FileSystem call() {
 					return FileSystem.createDummyFileSystem();
 				}
 			});
 
             Scene scene = new Scene();
             var material = new PhongMaterial();
             var boxNode = scene.getRootNode().createChildNode(new Box());
             boxNode.setMaterial(material);
 
             //opt.FileSystem would be dummy file system now
             var opt = new ObjSaveOptions();
             scene.Save("output.obj", opt);
             //the material file output.mtl will not be written to any places because we've configured a dummy file system as default implementation.

getFlipCoordinateSystem()

public boolean getFlipCoordinateSystem()

获取在导入/导出期间翻转控制点/法线的坐标系。

Returns: boolean - 在导入/导出期间翻转控制点/法线的坐标系。

getGammaCorrectedColor()

public boolean getGammaCorrectedColor()

3ds 文件可能包含同一属性的原始颜色和伽马校正颜色,将此设置为 true 时,如果可能将使用伽马校正颜色,否则 Aspose.3D 将尝试使用原始颜色。

Returns: boolean - 3ds 文件可能包含相同属性的原始颜色和伽马校正颜色,设置为 true 时如果可能将使用伽马校正颜色,否则 Aspose.3D 将尝试使用原始颜色。

getHighPreciseColor()

public boolean getHighPreciseColor()

如果为 true,生成的 3ds 文件将使用高精度颜色,即红/绿/蓝每个通道使用 32 位浮点数。否则,生成的文件将使用 24 位颜色,每个通道使用 8 位字节。默认值为 false,因为并非所有应用程序都支持高精度颜色。

Returns: boolean - 如果为 true,生成的 3ds 文件将使用高精度颜色,即红/绿/蓝每个通道为 32 位浮点。否则生成的文件将使用 24 位颜色,每个通道为 8 位字节。默认值为 false,因为并非所有应用程序都支持高精度颜色。

getLookupPaths()

public ArrayList<String> getLookupPaths()

某些文件(如 OBJ)依赖外部文件,查找路径将允许 Aspose.3D 查找并加载外部文件。

Returns: java.util.ArrayList<java.lang.String> - 某些文件(如 OBJ)依赖外部文件,查找路径将允许 Aspose.3D 查找并加载外部文件。示例: 以下代码展示了如何手动指定查找纹理,以便导入器能够找到。

var opt = new ObjLoadOptions();
             //Specify the lookup paths, so the textures can be located.
             opt.getLookupPaths().add("textures");
             var scene = Scene.fromFile("input.obj", opt);
             scene.save("output.glb");

getMasterScale()

public double getMasterScale()

获取导出时使用的主比例。

Returns: double - 导出时使用的主比例。

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setDuplicatedNameCounterBase(int value)

public void setDuplicatedNameCounterBase(int value)

用于为重复名称生成新名称的计数器,默认值为 2。

Parameters:

参数类型描述
int新值

setDuplicatedNameCounterFormat(String value)

public void setDuplicatedNameCounterFormat(String value)

重复计数器的格式,默认值为空字符串。

Parameters:

参数类型描述
java.lang.String新值

setDuplicatedNameSeparator(String value)

public void setDuplicatedNameSeparator(String value)

对象名称与重复计数器之间的分隔符,默认值为 “_"。当场景包含使用相同名称的对象时,Aspose.3D 3DS 导出器将为该对象生成不同的名称。例如有两个名为 “Box” 的节点,第一个节点的名称为 “Box”,第二个节点将在默认配置下获得新名称 “Box_2”。

Parameters:

参数类型描述
java.lang.String新值

setEncoding(Charset value)

public void setEncoding(Charset value)

设置基于文本文件的默认编码。默认值为 null,表示导入器/导出器将决定使用哪种编码。

Parameters:

参数类型描述
java.nio.charset.Charset新值

setExportCamera(boolean value)

public void setExportCamera(boolean value)

设置是否导出场景中的所有相机。

Parameters:

参数类型描述
布尔新值

setExportLight(boolean value)

public void setExportLight(boolean value)

设置是否导出场景中的所有灯光。

Parameters:

参数类型描述
布尔新值

setExportTextures(boolean value)

public void setExportTextures(boolean value)

尝试将场景中使用的纹理复制到输出目录。

Parameters:

参数类型描述
布尔新值

setFileName(String value)

public void setFileName(String value)

导出/导入场景的文件名。此项是可选的,但在序列化外部资源(如 OBJ 的材质)时很有用。

Parameters:

参数类型描述
java.lang.String新值

setFileSystem(FileSystem value)

public void setFileSystem(FileSystem value)

允许用户处理在加载/保存期间如何管理外部依赖项。

Parameters:

参数类型描述
valueFileSystem
  • Memory-based file system
  • Directory-based file system
  • Dummy file system
  • Zip file system

您也可以使用自己的实现。

Scene scene = new Scene();
             var material = new PhongMaterial();
             var boxNode = scene.getRootNode().createChildNode(new Box());
             boxNode.setMaterial(material);
 
             var opt = new ObjSaveOptions();
             var memFs = new HashMap<string, MemoryStream>();
             opt.setFileSystem(FileSystem.createMemoryFileSystem(memFs));
 			opt.setFileName("output.obj");
             try(var output = new ByteArrayOutputStream()) {
 				scene.save(output, opt);
 				//The material will be written to variable memFs named output.mtl
 				var materialInBytes = memFs["output.mtl"].toArray();
             }
``` |

### setFileSystemFactory(FileSystemFactory value) {#setFileSystemFactory-com.aspose.threed.FileSystemFactory-}

public static void setFileSystemFactory(FileSystemFactory value)



设置 FileSystem 的工厂类。默认工厂将创建 com.aspose.threed.LocalFileSystem,但它不适用于服务器环境。

**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
|  | value | [FileSystemFactory](../../com.aspose.threed/filesystemfactory) | 新值 **示例:** SaveOptions/LoadOptions 中的默认 FileSystem 是基于目录的文件系统,您可以通过 IOConfig.FileSystemFactory 指定来覆盖默认实现: |

IOConfig.setFileSystemFactory(new FileSystemFactory() { @Override public FileSystem call() { return FileSystem.createDummyFileSystem(); } });

         Scene scene = new Scene();
         var material = new PhongMaterial();
         var boxNode = scene.getRootNode().createChildNode(new Box());
         boxNode.setMaterial(material);

         //opt.FileSystem would be dummy file system now
         var opt = new ObjSaveOptions();
         scene.Save("output.obj", opt);
         //the material file output.mtl will not be written to any places because we've configured a dummy file system as default implementation.

### setFlipCoordinateSystem(boolean value) {#setFlipCoordinateSystem-boolean-}

public void setFlipCoordinateSystem(boolean value)



设置在导入/导出期间翻转控制点/法线的坐标系。

**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| 值 | 布尔 | 新值 |

### setGammaCorrectedColor(boolean value) {#setGammaCorrectedColor-boolean-}

public void setGammaCorrectedColor(boolean value)



3ds 文件可能包含同一属性的原始颜色和伽马校正颜色,将此设置为 true 时,如果可能将使用伽马校正颜色,否则 Aspose.3D 将尝试使用原始颜色。

**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| 值 | 布尔 | 新值 |

### setHighPreciseColor(boolean value) {#setHighPreciseColor-boolean-}

public void setHighPreciseColor(boolean value)



如果为 true,生成的 3ds 文件将使用高精度颜色,即红/绿/蓝每个通道使用 32 位浮点数。否则,生成的文件将使用 24 位颜色,每个通道使用 8 位字节。默认值为 false,因为并非所有应用程序都支持高精度颜色。

**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| 值 | 布尔 | 新值 |

### setLookupPaths(ArrayList<String> value) {#setLookupPaths-java.util.ArrayList-java.lang.String--}

public void setLookupPaths(ArrayList value)



某些文件(如 OBJ)依赖外部文件,查找路径将允许 Aspose.3D 查找并加载外部文件。

**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
|  | 值 | java.util.ArrayList<java.lang.String> | 新值 **示例:** 以下代码展示了如何手动指定查找纹理,以便导入器能够找到。 |

var opt = new ObjLoadOptions(); //Specify the lookup paths, so the textures can be located. opt.getLookupPaths().add(“textures”); var scene = Scene.fromFile(“input.obj”, opt); scene.save(“output.glb”);


### setMasterScale(double value) {#setMasterScale-double-}

public void setMasterScale(double value)



设置导出时使用的主比例。

**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| 值 | double | 新值 |

### toString() {#toString--}

public String toString()





**Returns:**
java.lang.String
### wait() {#wait--}

public final void wait()





### wait(long arg0) {#wait-long-}

public final void wait(long arg0)





**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| arg0 | long |  |

### wait(long arg0, int arg1) {#wait-long-int-}

public final void wait(long arg0, int arg1)





**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| arg0 | long |  |
| arg1 | int |  |