AssetInfo — Aspose.3D FOSS for Python API Reference

Example

AssetInfo 是一个元数据容器,附加在 Scene 通过 Scene.asset_info (或到 Node 通过 Node.asset_info). 它存储有关文件来源的信息:创建它的工具、计量单位、创建/修改时间戳,以及可选的坐标系设置。.

AssetInfo 继承自 A3DObject.

Example: aspose.threed

from aspose.threed import AssetInfo

Example

ExampleExample
AssetInfo()构造函数,所有字段为空/默认
AssetInfo(name)构造函数,可选对象名称

Example

所有字段都是可读写的属性。.

创作与标识

ExampleExampleExample
titlestr资产的人类可读标题
subjectstr资产的主题或话题
authorstr文件作者的姓名
keywordsstr与资产关联的关键词
revisionstr版本或修订字符串
commentstr自由格式的注释或描述
copyrightstr版权声明
urlstr来源 URL 或参考 URI

应用程序信息

ExampleExampleExample
application_namestr创作应用程序的名称(例如,., "Blender")
application_vendorstr创作应用程序的供应商
application_versionstr创作应用程序的版本字符串

Example

ExampleExampleExample
creation_time`datetimeNone`
modification_time`datetimeNone`

Example

ExampleExampleExample
unit_namestr测量单位的名称(例如,., "centimeter", "meter")
unit_scale_factorfloat用于将文件单位转换为米的比例因子;默认值为 1.0

坐标系(存根属性)

以下属性已存在,但返回 None 在当前的 FOSS 发行版中。它们保留用于未来的轴重新映射支持。.

ExampleExample
coordinate_system手性约定(右手或左手)
up_vector哪个轴指向上方
front_vector哪个轴指向前方
axis_system组合轴系描述符
ambient场景环境颜色

Example

from aspose.threed import Scene, AssetInfo
from datetime import datetime

# Load a scene and inspect its metadata
scene = Scene.from_file("model.fbx")
info = scene.asset_info

if info is not None:
    print(info.application_name)    # e.g. "Blender"
    print(info.unit_name)           # e.g. "centimeter"
    print(info.unit_scale_factor)   # e.g. 0.01

# Create metadata for an exported scene
out_scene = Scene()
out_info = AssetInfo()
out_info.title = "My Model"
out_info.author = "Alice"
out_info.application_name = "MyPipeline"
out_info.unit_name = "meter"
out_info.unit_scale_factor = 1.0
out_info.creation_time = datetime.now()
out_scene.asset_info = out_info

out_scene.save("output.glb")

另见

 中文