Property
Methods
Property 어떤 객체에든 첨부되는 단일 명명된, 타입이 지정된 메타데이터 필드를 나타냅니다 A3DObject (포함 Node, Mesh, AnimationClip, 등). 속성은 다음을 통해 접근합니다 PropertyCollection 에 의해 반환된 obj.properties. 속성을 읽고, 쓰고, 열거하여 사용자 정의 데이터를 씬 요소와 함께 저장할 수 있습니다.
Methods: aspose.threed
from aspose.threed import PropertyMethods
Property 객체는 일반적으로 애플리케이션 코드에서 직접 생성되지 않습니다. 호출하여 생성됩니다. A3DObject.get_property() 또는 다음을 통해 찾을 수 있습니다 A3DObject.find_property().
| Methods | Methods | Methods |
|---|---|---|
name | str | 속성 이름 |
value | Any | 초기값 (선택 사항) |
Methods
| Methods | Methods | Methods |
|---|---|---|
name | str | 속성의 읽기 전용 이름 |
value | Any | 현재 값; 읽기 및 쓰기 가능 |
value_type | type | Python type 현재 값의; 반환합니다 type(None) 언제 value 이다 None |
Methods
| Methods | 반환 유형 | Methods |
|---|---|---|
get_extra(name) | Any | 이 속성에 저장된 명명된 추가 메타데이터 필드를 가져옵니다 |
set_extra(name, value) | None | 이름이 지정된 추가 메타데이터 필드를 설정합니다 |
get_bind_point(anim, create) | `BindPoint | None` |
get_keyframe_sequence(anim, create) | `KeyframeSequence | None` |
Methods
from aspose.threed import Scene
scene = Scene()
node = scene.root_node.create_child_node("tagged_node")
# Access the property collection
props = node.properties
# Get a property by name (read raw value)
val = node.get_property("name")
print(val) # "tagged_node"
# Find a property object
prop = node.find_property("name")
if prop is not None:
print(prop.name) # "name"
print(prop.value) # "tagged_node"
print(prop.value_type) # <class 'str'>
# Enumerate all properties
for p in props:
print(f" {p.name} = {p.value!r}")
# Store a custom value on a property (extra metadata)
if prop:
prop.set_extra("ui_label", "Scene Origin Node")
label = prop.get_extra("ui_label")
print(label) # "Scene Origin Node"