Property — Aspose.3D FOSS for Python API Reference

Overview

Property represents a single named, typed metadata field attached to any A3DObject (including Node, Mesh, AnimationClip, etc.). Properties are accessed through the PropertyCollection returned by obj.properties. You can read, write, and enumerate properties to store user-defined data alongside scene elements.

Package: aspose.threed

from aspose.threed import Property

Constructor

Property objects are not normally constructed directly by application code. They are created by calling A3DObject.get_property() or found via A3DObject.find_property().

ParameterTypeDescription
namestrProperty name
valueAnyInitial value (optional)

Properties

NameTypeDescription
namestrRead-only name of the property
valueAnyCurrent value; readable and writable
value_typetypePython type of the current value; returns type(None) when value is None

Methods

MethodReturn TypeDescription
get_extra(name)AnyGets a named extra metadata field stored on this property
set_extra(name, value)NoneSets a named extra metadata field
get_bind_point(anim, create)BindPoint | NoneReturns the animation bind point for this property in the given AnimationNode; pass create=True to create one if absent
get_keyframe_sequence(anim, create)KeyframeSequence | NoneReturns the keyframe sequence for this property in the given AnimationNode

Example

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"

See Also