Main Index : Reference :
[BaseObject] AllocObject([int] type);
class BaseObject : BaseList4D
{
public:
BaseObject();
[BaseContainer] GetContainer();
[bool] SetContainer([BaseContainer] bc);
[BaseDocument] GetDocument();
[BaseTag] GetFirstTag();
[bool] InsertTag([BaseTag] tag, [[BaseTag] prev]);
[string] GetName();
[bool] SetName([string] name);
[vector] GetPosition();
[vector] GetScale();
[vector] GetRotation();
[bool] SetPosition([vector] p);
[bool] SetScale([vector] s);
[bool] SetRotation([vector] r);
[Matrix] GetMl();
[Matrix] GetMln();
[Matrix] GetMg();
[Matrix] GetMgn();
[Matrix] GetUpMg();
[bool] SetMl([Matrix] ml);
[bool] SetMg([Matrix] mg);
[int] GetEditorMode();
[int] GetRenderMode();
[int] GetDeformMode();
[bool] MultiMessage([int] type, [[any type] data = NULL]);
[bool] CopyTo([BaseObject] dest, [int] flags);
[BaseObject] GetClone([int] flags);
}
This is the class that all objects in C4D are derived from. It contains functions for the object's position, scale and rotation, as well as for accessing the sub-items of the object (tags and animation tracks).
[BaseObject] AllocObject([int] type);
Allocates a BaseObject of the specified type: (Types in italic cannot be allocated with AllocObject().)
| Type | Description |
|---|---|
|
|
Base object. |
|
|
Point object. (PointObject) |
|
|
Polygon object. (PolygonObject) |
|
|
Spline object. (SplineObject) |
|
|
Light. |
|
|
Camera. |
|
|
Floor. |
|
|
Sky. |
|
|
Environment. |
|
|
Loft NURBS. |
|
|
FFD. |
|
|
Particle emitter. |
|
|
Particle deflector. |
|
|
Particle gravitation. |
|
|
Particle rotation. |
|
|
Particle wind. |
|
|
Particle friction. |
|
|
Particle turbulence. |
|
|
Extrude NURBS. |
|
|
Lathe NURBS. |
|
|
Sweep NURBS. |
|
|
Particle attractor. |
|
|
Bezier NURBS. |
|
|
Foreground. |
|
|
Background. |
|
|
Bone. |
|
|
Particle destructor. |
|
|
Metaball. |
|
|
Instance. |
|
|
Hyper NURBS. |
|
|
Bend deformer. |
|
|
Bulge deformer. |
|
|
Shear deformer. |
|
|
Taper deformer. |
|
|
Twist deformer. |
|
|
Wave deformer. |
|
|
Stage. |
|
|
Line. |
|
|
Microphone. |
|
|
Loadspeaker. |
|
|
Null object. |
|
|
Symmetry object. |
|
|
Wrap deformer. |
|
|
Boolean. |
|
|
Explosion deformer. |
|
|
Formula deformer. |
|
|
Melt deformer. |
|
|
Shatter deformer. |
|
|
Wind deformer. |
|
|
Array. |
|
|
Headphone. |
|
|
Construction plane. |
|
|
Plugin object. |
|
|
Base deform object. |
|
|
Polygon reduction object. |
|
|
Cube object. |
|
|
Sphere object. |
|
|
Platonic object. |
|
|
Cone object. |
|
|
Torus object. |
|
|
Disc object. |
|
|
Tube object. |
|
|
Figure object. |
|
|
Pyramid object. |
|
|
Plane object. |
|
|
Fractal object. |
|
|
Cylinder object. |
|
|
Capsule object. |
|
|
Oil-tank object. |
|
|
Relief object. |
|
|
Single polygon object. |
|
|
Profile spline object. |
|
|
Flower spline object. |
|
|
Formula spline object. |
|
|
Text spline object. |
|
|
N-sided spline object. |
|
|
4-sided spline object. |
|
|
Circle spline object. |
|
|
Arc spline object. |
|
|
Cissoid spline object. |
|
|
Cycloid spline object. |
|
|
Helix spline object. |
|
|
Rectangle spline object. |
|
|
Star spline object. |
|
|
Wheel spline object. |
|
|
Contour spline object. |
|
|
Selection object. |
|
|
SDS object. |
|
|
Spline deformer object. |
|
|
Spline rail object. |
|
|
Atom array object. |
|
|
Spherify object. |
|
|
Explosion FX object. |
[BaseContainer] GetContainer();
Returns the object's container.
[bool] SetContainer([BaseContainer] bc);
Sets the object's container to bc.
[BaseDocument] GetDocument();
Returns the document that the object belongs to, or NULL if the object is loose.
[BaseTag] GetFirstTag();
Returns the first tag of the object, or NULL if there are no tags.
[bool] InsertTag([BaseTag] tag, [[BaseTag] prev = NULL]);
Inserts tag into the object's tag list. Optionally one can specify the insertion position with the prev parameter, giving the tag before (just to the left of) the wanted position. Otherwise the tag is inserted at the first position in the list. Returns TRUE if successful.
[string] GetName();
Returns the name of the object.
[bool] SetName([string] name);
Sets the name of the object to name. Returns TRUE if successful.
[vector] GetPosition();
Returns the object's position.
[vector] GetScale();
Returns the object's scale.
[vector] GetRotation();
Returns the object's HPB rotation.
[bool] SetPosition([vector] p);
Sets the object's position to p. Returns TRUE if successful.
[bool] SetScale([vector] s);
Sets the object's scale to s. Returns TRUE if successful.
[bool] SetRotation([vector] r);
Sets the object's HPB rotation to r. Returns TRUE if successful.
[Matrix] GetMl();
Returns the object's local matrix.
[Matrix] GetMln();
Returns the object's local matrix normalized.
[Matrix] GetMg();
Returns the object's global matrix.
[Matrix] GetMgn();
Returns the object's global matrix normalized.
[Matrix] GetUpMg();
Returns the parent's global matrix. If the object is at the topmost level this will be a unit matrix.
[bool] SetMl([Matrix] ml);
Sets the object's local matrix to ml. Returns TRUE if successful.
[bool] SetMg([Matrix] mg);
Sets the object's global matrix to ml. Returns TRUE if successful.
[int] GetEditorMode();
Returns the state of the editor dot:
| Mode | Meaning |
MODE_ON |
Editor dot green |
MODE_OFF |
Editor dot red |
MODE_UNDEF |
Editor dot grey |
[int] GetRenderMode();
Returns the state of the render dot:
| Mode | Meaning |
MODE_ON |
Render dot green |
MODE_OFF |
Render dot red |
MODE_UNDEF |
Render dot grey |
[int] GetDeformMode();
Returns the state of the deformation/generator tick:
| Mode | Meaning |
MODE_ON |
Green tick (on) |
MODE_OFF |
Red cross (off) |
NOTOK |
Object has no tick |
[bool] MultiMessage([int] type, [[any type] data = NULL]);
Sends a message to all child elements of the object, i.e. all tags and tracks. The same message syntax as for BaseList2D's Message() function is used.
[bool] CopyTo([BaseObject] dest, [int] flags);
Copies the object to dest. Valid flags are:
| Flag | Explanation |
CL_NO_BITS |
Copy no BaseList2D bits (e.g. selection bits). |
CL_ONLY_VISIBLETAGS |
Copy only tags that are visible in the object manager. |
CL_NO_TRACKS |
Copy no tracks. |
CL_NO_HIERARCHY |
Copy only object without children. |
[BaseObject] GetClone([int] flags);
Returns a copy of the object.
// Moves the object to Y = 100 m
var obj = doc->FindObject("MyObject");
var pos = obj->GetPosition();
pos.y = 100;
obj->SetPosition(pos);
obj->MultiMessage(MSG_UPDATE);