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

NameTypeGetterSetterDescription
applicationNameStringgetApplicationName()setApplicationName(String)Name of the application that created the scene
applicationVendorStringgetApplicationVendor()setApplicationVendor(String)Vendor of the authoring application
applicationVersionStringgetApplicationVersion()setApplicationVersion(String)Version of the authoring application
unitNameStringgetUnitName()setUnitName(String)Unit name (e.g., "meter", "centimeter", "inch")
unitScaleFactordoublegetUnitScaleFactor()setUnitScaleFactor(double)Scale factor relative to meters. E.g., centimeters = 0.01
upVectorAxisgetUpVector()setUpVector(Axis)The “up” axis for the scene
coordinateSystemCoordinateSystemgetCoordinateSystem()setCoordinateSystem(CoordinateSystem)Handedness: RIGHT_HANDED or LEFT_HANDED
creationTimeStringgetCreationTime()setCreationTime(String)ISO date-time when the scene was created
modificationTimeStringgetModificationTime()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");

See Also