A 3D scene is represented as a BaseDocument. A BaseDocument can store objects, materials, takes etc. Cinema 4D can handle multiple documents at once. The document display in the viewport is the active document that can be accessed with GetActiveDocument(). This active document must only be modified in the context of user interaction from the main thread. It must not be edited from within the execution pipeline or from a thread that is not the main thread.
After the active document has been edited, one must call EventAdd() to inform Cinema 4D that something has changed.
See also
BaseObject is the base class of all scene objects. Such scene objects can be polygon objects or splines but also generators, deformers, camera objects or lights.
To create a new object one must know the object type's ID. E.g. the ID for a "Cube" is Ocube. A newly created object can simply be inserted into a BaseDocument that will take ownership.
See also Scene Elements Overview.
The BaseObject class is based on C4DAtom. This means that parameters of objects can be accessed using C4DAtom::SetParameter() and C4DAtom::GetParameter().
For each element type, there is typically a header file that includes the parameter IDs. E.g. for the Ocube object type there is the ocube.h header file.
Different objects are based on fundamental base classes. Ocube is based on Obase so it inherits the base class' parameters which are defined in the corresponding header file (e.g. obase.h).
See C4DAtom Manual.
Materials and shaders can be created like objects. Materials must be inserted into the host BaseDocument. A new shader instance must be inserted into a host object. This is typically the material using the shader. BaseMaterial is the base class of all materials. Material is the class representing the standard Cinema 4D material.
See Materials and Shaders Overview.
Tags are used to add arbitrary data or additional functionality to given BaseObject. Tags that store information are e.g. NormalTag or UVWTag. A TextureTag is used to assign a material to a BaseObject.
See BaseTag and VariableTag Manual and TextureTag Manual.
There are many different ways to access the objects, materials or tags that are stored in a BaseDocument. The user can select objects, materials and tags. The BaseDocument class gives access to these "active" elements. Additionally it is also possible to search for objects by name.
The objects of a scene are organized in a tree. For iterating such a tree see Navigation in Lists and Trees.
See BaseDocument Manual.
A PolygonObject stores point and polygon data. Such a PolygonObject is created and inserted into the BaseDocument like any other object.
The function RenderDocument() can be used to render a given BaseDocument.