AssetInfo — Aspose.3D FOSS for Python API Reference

Properties

AssetInfo là một container siêu dữ liệu được gắn vào một Scene qua Scene.asset_info (hoặc tới một Node qua Node.asset_info). Nó lưu trữ thông tin về nguồn gốc của tệp: công cụ đã tạo ra nó, đơn vị đo lường, dấu thời gian tạo/điều chỉnh, và các cài đặt hệ trục tùy chọn.

AssetInfo kế thừa từ A3DObject.

Properties: aspose.threed

from aspose.threed import AssetInfo

Properties

PropertiesProperties
AssetInfo()Khởi tạo với tất cả các trường trống/mặc định
AssetInfo(name)Khởi tạo với một tên đối tượng tùy chọn

Properties

Tất cả các trường đều là các thuộc tính có thể đọc và ghi.

Tạo nội dung và Nhận dạng

PropertiesPropertiesProperties
titlestrTiêu đề dễ đọc cho con người của tài sản
subjectstrChủ đề hoặc đề tài của tài sản
authorstrTên của tác giả tệp
keywordsstrCác từ khóa liên quan đến tài sản
revisionstrChuỗi phiên bản hoặc sửa đổi
commentstrBình luận hoặc mô tả tự do
copyrightstrThông báo bản quyền
urlstrURL nguồn hoặc URI tham chiếu

Thông tin Ứng dụng

PropertiesPropertiesProperties
application_namestrTên của ứng dụng tạo nội dung (ví dụ,., "Blender")
application_vendorstrNhà cung cấp của ứng dụng tạo nội dung
application_versionstrChuỗi phiên bản của ứng dụng tạo nội dung

Properties

PropertiesPropertiesProperties
creation_time`datetimeNone`
modification_time`datetimeNone`

Properties

PropertiesPropertiesProperties
unit_namestrTên đơn vị đo lường (ví dụ,., "centimeter", "meter")
unit_scale_factorfloatHệ số tỷ lệ để chuyển đổi từ đơn vị của tệp sang mét; mặc định là 1.0

Hệ tọa độ (các thuộc tính mẫu)

Các thuộc tính sau tồn tại nhưng trả về None trong bản phát hành FOSS hiện tại. Chúng được dành riêng cho hỗ trợ tái ánh xạ trục trong tương lai.

PropertiesProperties
coordinate_systemQuy ước tay (tay phải hoặc tay trái)
up_vectorTrục nào hướng lên
front_vectorTrục nào hướng về phía trước
axis_systemMô tả hệ trục kết hợp
ambientMàu môi trường của cảnh

Properties

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")

Xem thêm

 Tiếng Việt