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;
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.
Node
BaseList2D contain function to deal with NimbusRef.
- Note
- The returned result should be assign to a NimbusBaseRef.
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:
if (clone == nullptr)
object->TransferGoal(clone, false);
Further Reading
Bool KeyframeSelectionContent()
Definition: c4d_basechannel.h:35
@ MATERIAL_COLOR_SHADER
Definition: mmaterial.h:272
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:251
Bool GetUniqueIDIndex(Int32 idx, Int32 &id, const Char *&mem, Int &bytes) const
Definition: c4d_baselist.h:2443
maxon::Int Int
Definition: ge_sys_math.h:64
C4DAtom * GetClone(COPYFLAGS flags, AliasTrans *trn)
Definition: c4d_baselist.h:1447
Definition: c4d_baseobject.h:224
Definition: lib_description.h:328
void SetInt32(Int32 id, Int32 l)
Definition: c4d_basecontainer.h:505
Bool GetDescription(Description *description, DESCFLAGS_DESC flags)
return OK
Definition: apibase.h:2620
const GeMarker & GetMarker() const
Definition: c4d_baselist.h:2395
BaseVideoPost * GetFirstVideoPost()
Bool SetDescIDState(const DescID &id, DESCIDSTATE descidstate)
Int32 Compare(const GeMarker &m) const
Definition: c4d_baselist.h:1324
void InsertTrackSorted(CTrack *track)
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:67
CTrack * FindCTrack(const DescID &id)
void SetBit(Int32 mask)
Definition: c4d_baselist.h:2230
void SetBool(Int32 id, Bool b)
Definition: c4d_basecontainer.h:498
void InsertMultipass(MultipassObject *obj, MultipassObject *pred=nullptr)
Definition: c4d_canimation.h:659
@ MULTIPASSOBJECT_OBJECTBUFFER
Definition: zmultipass.h:8
static BaseList2D * Alloc(Int32 type)
#define Xbrick
Brick.
Definition: ge_prepass.h:1199
Represents a C4DAtom that resides in a 4D list.
Definition: c4d_baselist.h:1797
Bool view
Visible in editor view.
Definition: c4d_basedocument.h:352
Definition: c4d_string.h:38
A unique marker that identifies an object.
Definition: c4d_baselist.h:1286
static String IntToString(Int32 v)
Definition: c4d_string.h:495
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:317
LayerObject * GetLayerObject(BaseDocument *doc)
const BaseContainer & GetDataInstanceRef() const
Definition: c4d_baselist.h:2329
static BaseShader * Alloc(Int32 type)
Represents a level within a DescID.
Definition: lib_description.h:287
Definition: c4d_videopost.h:23
@ MULTIPASSOBJECT_TYPE
Definition: zmultipass.h:6
Definition: c4d_baselist.h:1361
maxon::Int32 Int32
Definition: ge_sys_math.h:60
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:210
#define VPBUFFER_OBJECTBUFFER
Object buffer multipass channel.
Definition: c4d_videopostdata.h:140
#define BIT_VPDISABLED
Videopost is disabled.
Definition: ge_prepass.h:901
RenderData * GetActiveRenderData(void)
Bool Scale(Float scale)
Definition: c4d_baselist.h:2513
Definition: ge_autoptr.h:36
String GetString(Int32 id, const maxon::String &preset=maxon::String()) const
Definition: c4d_basecontainer.h:387
@ DESC_NAME
String Name for standalone use.
Definition: lib_description.h:91
Definition: c4d_basedocument.h:142
Definition: c4d_basedocument.h:111
maxon::Bool Bool
Definition: ge_sys_math.h:55
BaseObject * GetActiveObject(void)
String GetName() const
Definition: c4d_baselist.h:2348
@ PRIM_SPHERE_RAD
Definition: osphere.h:6
#define Zmultipass
Definition: ge_prepass.h:1169
@ LOCKED
Description element is locked.
@ DTYPE_REAL
Float
Definition: lib_description.h:68
Bool FindKeyframeSelection(const DescID &id)
maxon::Char Char
Definition: ge_sys_math.h:56
DESCIDSTATE GetDescIDState(const DescID &id, Bool tolerant) const
Definition: c4d_basecontainer.h:46
void InsertShader(BaseShader *shader, BaseShader *pred=nullptr)
Definition: c4d_baselist.h:2558
DESCIDSTATE
Definition: ge_prepass.h:5318