AssetInfo — Aspose.3D FOSS for Java
Overview
AssetInfo stores metadata about the scene – the authoring application, unit name and scale factor, coordinate system, and creation/modification timestamps. Access it via scene.getAssetInfo().
Package: com.aspose.threed
import com.aspose.threed.AssetInfo;Properties
| Name | Type | Getter | Setter | Description |
|---|---|---|---|---|
applicationName | String | getApplicationName() | setApplicationName(String) | Name of the application that created the scene |
applicationVendor | String | getApplicationVendor() | setApplicationVendor(String) | Vendor of the authoring application |
applicationVersion | String | getApplicationVersion() | setApplicationVersion(String) | Version of the authoring application |
unitName | String | getUnitName() | setUnitName(String) | Unit name (e.g., "meter", "centimeter", "inch") |
unitScaleFactor | double | getUnitScaleFactor() | setUnitScaleFactor(double) | Scale factor relative to meters. E.g., centimeters = 0.01 |
upVector | Axis | getUpVector() | setUpVector(Axis) | The “up” axis for the scene |
coordinateSystem | CoordinateSystem | getCoordinateSystem() | setCoordinateSystem(CoordinateSystem) | Handedness: RIGHT_HANDED or LEFT_HANDED |
creationTime | String | getCreationTime() | setCreationTime(String) | ISO date-time when the scene was created |
modificationTime | String | getModificationTime() | setModificationTime(String) | ISO date-time when the scene was last modified |
Example
import com.aspose.threed.Scene;
import com.aspose.threed.AssetInfo;
Scene scene = Scene.fromFile("model.glb");
AssetInfo info = scene.getAssetInfo();
if (info != null) {
System.out.println("Application: " + info.getApplicationName());
System.out.println("Unit: " + info.getUnitName()
+ " (scale=" + info.getUnitScaleFactor() + ")");
System.out.println("Up vector: " + info.getUpVector());
System.out.println("Coordinate system: " + info.getCoordinateSystem());
}
// Set custom asset info
AssetInfo custom = new AssetInfo();
custom.setApplicationName("MyApp");
custom.setUnitName("meter");
custom.setUnitScaleFactor(1.0);
scene.setAssetInfo(custom);
scene.save("output.glb");