Prev: An Advanced Scripted Object Next: Tool Scripts
6. Object3D and ObjectInfo
Let's take a break from writing scripts, and learn a bit more about how Art of Illusion
represents the objects in a scene. You have already encountered two object classes:
Sphere and Tube. There are many others: Cube, TriangleMesh, SplineMesh, PointLight,
SpotLight, and so on.
All of these classes are subclasses of artofillusion.object.Object3D. An Object3D defines the geometry
or other internal properties of an object. The Object3D class defines properties which
are common to many types of objects:
- Its Texture and TextureMapping
- Its Material and MaterialMapping
- The values of any texture parameters
It also includes abstract methods for many operations that can be performed on objects. Some of the
most commonly used include:
- Converting it to a TriangleMesh
- Getting a RenderingMesh which can be used to render it
- Saving it to disk
- Getting the bounding box which contains its geometry
- Displaying a user interface for editing it
Another important class to know about is artofillusion.object.ObjectInfo. An ObjectInfo
is a "wrapper" around an Object3D, and describes the role of that object within the scene:
- Its name
- Its CoordinateSystem (that is, its position and orientation)
- Whether it is currently visible
- The list of animation tracks which have been attached to it
It is possible for several different ObjectInfos
to all reference the same Object3D. In that case, they are "live duplicates" of
each other: any change to one object will automatically affect all of them.
Prev: An Advanced Scripted Object Next: Tool Scripts