Main Index : Reference :

BaseObject


Description

The object base class.

Definition

[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);
}

Explanation

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).

Allocation

AllocObject( type )

[BaseObject] AllocObject([int] type);

Allocates a BaseObject of the specified type: (Types in italic cannot be allocated with AllocObject().)

TypeDescription

Obase

Base object.

Opoint

Point object. (PointObject)

Opolygon

Polygon object. (PolygonObject)

Ospline

Spline object. (SplineObject)

Olight

Light.

Ocamera

Camera.

Ofloor

Floor.

Osky

Sky.

Oenvironment

Environment.

Oloft

Loft NURBS.

Offd

FFD.

Oparticle

Particle emitter.

Odeflector

Particle deflector.

Ogravitation

Particle gravitation.

Orotation

Particle rotation.

Owind

Particle wind.

Ofriction

Particle friction.

Oturbulence

Particle turbulence.

Oextrude

Extrude NURBS.

Olathe

Lathe NURBS.

Osweep

Sweep NURBS.

Oattractor

Particle attractor.

Obezier

Bezier NURBS.

Oforeground

Foreground.

Obackground

Background.

Obone

Bone.

Odestructor

Particle destructor.

Ometaball

Metaball.

Oinstance

Instance.

Ohypernurbs

Hyper NURBS.

Obend

Bend deformer.

Obulge

Bulge deformer.

Oshear

Shear deformer.

Otaper

Taper deformer.

Otwist

Twist deformer.

Owave

Wave deformer.

Ostage

Stage.

Oline

Line.

Omicrophone

Microphone.

Oloudspeaker

Loadspeaker.

Onull

Null object.

Osymmetry

Symmetry object.

Owrap

Wrap deformer.

Oboole

Boolean.

Oexplosion

Explosion deformer.

Oformula

Formula deformer.

Omelt

Melt deformer.

Oshatter

Shatter deformer.

Owinddeform

Wind deformer.

Oarray

Array.

Oheadphone

Headphone.

Oconplane

Construction plane.

Oplugin

Plugin object.

Obasedeform

Base deform object.

Opolyreduction

Polygon reduction object.

Ocube

Cube object.

Osphere

Sphere object.

Oplatonic

Platonic object.

Ocone

Cone object.

Otorus

Torus object.

Odisc

Disc object.

Otube

Tube object.

Ofigure

Figure object.

Opyramid

Pyramid object.

Oplane

Plane object.

Ofractal

Fractal object.

Ocylinder

Cylinder object.

Ocapsule

Capsule object.

Ooiltank

Oil-tank object.

Orelief

Relief object.

Osinglepoly

Single polygon object.

Osplineprofile

Profile spline object.

Osplineflower

Flower spline object.

Osplineformula

Formula spline object.

Osplinetext

Text spline object.

Osplinenside

N-sided spline object.

Ospline4side

4-sided spline object.

Osplinecircle

Circle spline object.

Osplinearc

Arc spline object.

Osplinecissoid

Cissoid spline object.

Osplinecycloid

Cycloid spline object.

Osplinehelix

Helix spline object.

Osplinerectangle

Rectangle spline object.

Osplinestar

Star spline object.

Osplinecogwheel

Wheel spline object.

Osplinecontour

Contour spline object.

Oselection

Selection object.

Osds

SDS object.

Osplinedeformer

Spline deformer object.

Osplinerail

Spline rail object.

Oatomarray

Atom array object.

Ospherify

Spherify object.

Oexplosionfx

Explosion FX object.

Members

GetContainer()

[BaseContainer] GetContainer();

Returns the object's container.

SetContainer( bc )

[bool] SetContainer([BaseContainer] bc);

Sets the object's container to bc.


GetDocument()

[BaseDocument] GetDocument();

Returns the document that the object belongs to, or NULL if the object is loose.


GetFirstTag()

[BaseTag] GetFirstTag();

Returns the first tag of the object, or NULL if there are no tags.

InsertTag( tag, [prev] )

[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.


GetName()

[string] GetName();

Returns the name of the object.

SetName( name )

[bool] SetName([string] name);

Sets the name of the object to name. Returns TRUE if successful.


GetPosition()

[vector] GetPosition();

Returns the object's position.

GetScale()

[vector] GetScale();

Returns the object's scale.

GetRotation()

[vector] GetRotation();

Returns the object's HPB rotation.


SetPosition( p )

[bool] SetPosition([vector] p);

Sets the object's position to p. Returns TRUE if successful.

SetScale( s )

[bool] SetScale([vector] s);

Sets the object's scale to s. Returns TRUE if successful.

SetRotation( r )

[bool] SetRotation([vector] r);

Sets the object's HPB rotation to r. Returns TRUE if successful.


GetMl()

[Matrix] GetMl();

Returns the object's local matrix.

GetMln()

[Matrix] GetMln();

Returns the object's local matrix normalized.

GetMg()

[Matrix] GetMg();

Returns the object's global matrix.

GetMgn()

[Matrix] GetMgn();

Returns the object's global matrix normalized.

GetUpMg()

[Matrix] GetUpMg();

Returns the parent's global matrix. If the object is at the topmost level this will be a unit matrix.


SetMl( ml )

[bool] SetMl([Matrix] ml);

Sets the object's local matrix to ml. Returns TRUE if successful.

SetMg( mg )

[bool] SetMg([Matrix] mg);

Sets the object's global matrix to ml. Returns TRUE if successful.


GetEditorMode()

[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

GetRenderMode()

[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

GetDeformMode()

[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


MultiMessage( type, [data] )

[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.


CopyTo( dest, flags )

[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.

GetClone( flags )

[BaseObject] GetClone([int] flags);

Returns a copy of the object.

Example

// 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);