About
The class BaseList2D is based on C4DAtom and GeListNode . It is a base class for many entities of the classic Cinema 4D API and adds additional functionality.
BaseList2D objects are an instance of Tbaselist2d
.
Allocation/Deallocation
BaseList2D elements can be created with the usual tools:
Note For most BaseList2D based classes dedicated "Alloc" and "Free" functions exist.
if (multipass == nullptr )
Read-Only Properties
The following properties can be accessed:
Properties
Data
BaseList2D based objects store an internal BaseContainer . This BaseContainer can store various information, like for example (but not restricted to) the values of parameters of an object or tag.
See BaseContainer Manual .
{
if (node == nullptr || !SUPER::Init(node))
return false ;
BaseObject *
const obj = static_cast<BaseObject*>(node);
data.
SetBool (EXAMPLE_GENERATOR_PARAMETER_BOOL,
true );
data.
SetInt32 (EXAMPLE_GENERATOR_PARAMETER_VALUE, 123);
Note Typically one should use C4DAtom::SetParameter() and C4DAtom::GetParameter() to access parameters, instead of accessing the BaseContainer directly. See C4DAtom Parameters .
Bits
Various properties are not stored in parameters but are set using bits. See BIT .
if (rd == nullptr )
if (vp != nullptr )
See also GeListNode NBits .
Name
A BaseList2D based element can have a name. Often this name is used in Cinema 4D 's UI, like names of objects in the Object Manager:
if (object == nullptr )
object ->SetName("This is the selected object" _s);
Note While BaseDocument is as well derived from BaseList2D , the "name" of a document is a Filename set with BaseDocument::SetDocumentName() . See BaseDocument Document Name and Path .
Shader
By default a BaseList2D based element can host a list of shaders. If a new shader is created and used by the element, it must be inserted into the element's shader list.
See also GeListNode Lists and Trees .
Marker
A BaseList2D based element owns a GeMarker object.
See GeMarker Manual for more information.
const String objectName =
object ->GetName();
const GeMarker & marker =
object ->GetMarker();
if (foundObject != nullptr )
{
if (foundObjectMarker.
Compare (marker) == 0)
else
}
Unique ID
BaseList2D based elements can store an array of unique IDs. These IDs are typically used to identify scenes and elements written by external applications using the Melange library.
const Int32 ID = 1111111;
object ->AddUniqueID(ID, (
Char *)&value,
sizeof (
Int32 ));
const Char * memory =
nullptr ;
for (
Int32 i = 0; i <
object ->GetUniqueIDCount(); ++i)
{
{
if (bytes ==
sizeof (
Int32 ))
{
}
}
}
Animation Tracks
BaseList2D based elements store a list of CTrack objects (see also Heads and Branches ). A CTrack stores the animation data for a given parameter.
if (track != nullptr )
if (track == nullptr )
See Animation Overview .
Keyframe Selection
Parameters can be part of a so called keyframe selection:
if (description == nullptr )
{
while (description->
GetNext (handle, &bc,
id , gid))
{
{
}
}
}
See also C4DAtom Parameter Properties and Animate .
Layer
A BaseList2D based element can be part of a layer:
if (layer != nullptr )
{
const LayerData *
const ld =
object ->GetLayerData(doc);
if (ld != nullptr )
{
else
}
}
See also Layer Manual .
DescID State
For each parameter ID a certain state can be defined. This is typically managed by the Xref or Take system.
The flags are:
Functionality
BaseList2D based elements can be edited with these functions:
BaseObject *
const clone = static_cast<BaseObject*>(atomClone);
if (clone == nullptr )
object ->TransferGoal(clone, false );
Further Reading
Bool KeyframeSelectionContent()
Definition: c4d_basechannel.h:31
static CTrack * Alloc(BaseList2D *bl, const DescID &id)
void InsertObject(BaseObject *op, BaseObject *parent, BaseObject *pred, Bool checknames=false)
BaseObject * SearchObject(const maxon::String &str)
Definition: c4d_basedocument.h:218
Bool GetUniqueIDIndex(Int32 idx, Int32 &id, const Char *&mem, Int &bytes) const
Definition: c4d_baselist.h:2354
maxon::Int Int
Definition: ge_sys_math.h:49
C4DAtom * GetClone(COPYFLAGS flags, AliasTrans *trn)
Definition: c4d_baselist.h:1373
Definition: c4d_baseobject.h:220
Definition: lib_description.h:315
void SetInt32(Int32 id, Int32 l)
Definition: c4d_basecontainer.h:501
Bool GetDescription(Description *description, DESCFLAGS_DESC flags)
return OK
Definition: apibase.h:2462
const GeMarker & GetMarker() const
Definition: c4d_baselist.h:2306
BaseVideoPost * GetFirstVideoPost()
Bool SetDescIDState(const DescID &id, DESCIDSTATE descidstate)
Int32 Compare(const GeMarker &m) const
Definition: c4d_baselist.h:1250
void InsertTrackSorted(CTrack *track)
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:66
CTrack * FindCTrack(const DescID &id)
void SetBit(Int32 mask)
Definition: c4d_baselist.h:2149
void SetBool(Int32 id, Bool b)
Definition: c4d_basecontainer.h:494
void InsertMultipass(MultipassObject *obj, MultipassObject *pred=nullptr)
Definition: c4d_canimation.h:635
Definition: mmaterial.h:272
static BaseList2D * Alloc(Int32 type)
#define Xbrick
Brick.
Definition: ge_prepass.h:1158
Represents a C4DAtom that resides in a 4D list.
Definition: c4d_baselist.h:1723
Bool view
Visible in editor view.
Definition: c4d_basedocument.h:319
Definition: c4d_string.h:36
A unique marker that identifies an object.
Definition: c4d_baselist.h:1212
static String IntToString(Int32 v)
Definition: c4d_string.h:493
Bool GetNext(void *handle, const BaseContainer **bc, DescID &id, DescID &groupid)
Bool SetParameter(const DescID &id, const GeData &t_data, DESCFLAGS_SET flags)
Definition: c4d_basedocument.h:284
LayerObject * GetLayerObject(BaseDocument *doc)
const BaseContainer & GetDataInstanceRef() const
Definition: c4d_baselist.h:2240
static BaseShader * Alloc(Int32 type)
Represents a level within a DescID.
Definition: lib_description.h:274
Definition: c4d_videopost.h:19
Definition: c4d_baselist.h:1287
maxon::Int32 Int32
Definition: ge_sys_math.h:45
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:209
#define VPBUFFER_OBJECTBUFFER
Object buffer multipass channel.
Definition: c4d_videopostdata.h:136
#define BIT_VPDISABLED
Videopost is disabled.
Definition: ge_prepass.h:866
RenderData * GetActiveRenderData(void)
Bool Scale(Float scale)
Definition: c4d_baselist.h:2424
Definition: ge_autoptr.h:32
String GetString(Int32 id, const maxon::String &preset=maxon::String()) const
Definition: c4d_basecontainer.h:383
String Name for standalone use.
Definition: lib_description.h:87
Definition: c4d_basedocument.h:109
Definition: zmultipass.h:8
Definition: c4d_basedocument.h:78
maxon::Bool Bool
Definition: ge_sys_math.h:40
BaseObject * GetActiveObject(void)
String GetName() const
Definition: c4d_baselist.h:2259
#define Zmultipass
Definition: ge_prepass.h:1128
Description element is locked.
Float
Definition: lib_description.h:64
Bool FindKeyframeSelection(const DescID &id)
maxon::Char Char
Definition: ge_sys_math.h:41
DESCIDSTATE GetDescIDState(const DescID &id, Bool tolerant) const
Definition: c4d_basecontainer.h:42
void InsertShader(BaseShader *shader, BaseShader *pred=nullptr)
Definition: c4d_baselist.h:2469
DESCIDSTATE
Definition: ge_prepass.h:5105
Definition: zmultipass.h:6