Link Search Menu Expand Document

Attributes in arena-py

Attributes are used to specify parameters for ARENA Objects.

See object definition reference.

Accessing Object Attributes

See Appendix for all types of Attributes.

Usually, attributes (except for object_id, persist, ttl, and parent) are under the data field:

obj.object_id
obj.persist
...
obj.data.position
obj.data.rotation
...
obj.data.material
# etc etc

Additional Attributes (which are just specified as numbers or strings) may include persist, ttl, [clickable], etc:

persist=True
ttl=30  # seconds
clickable=True
# click_listener=True works too
# etc.

Generic Attribute

For attributes that are not specified by the library, you can use this (put anything you want in the “…”)! Inherit from this class to create custom attributes.

Attribute(...)

All Attributes

These attributes may be applied to any ARENA object.

Position

The [position] of an object can be specified by:

position=Position(x, y, z)
# or
position=(x, y, z)

Rotation

The [rotation] (in euler coordinates) of an object can be specified by:

rotation=Rotation(x, y, z)
# or
rotation=(x, y, z)

The [rotation] (in quaternions) of an object can be specified by:

rotation=Rotation(x, y, z, w) # note the additional "w" field
# or
rotation=(x, y, z, w)

Scale

The [scale] of an object can be specified by:

scale=Scale(x, y, z)
# or
scale=(x, y, z)

Animation

An [animation] can be added to an object:

See Animations and Morphs.

More Attributes

The table of contents for the Python Attributes section includes links below to Python examples to create an manipulate all attribute types.


Table of contents