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)
renderData->InsertMultipass(multipass);
Definition: c4d_basecontainer.h:48
void SetInt32(Int32 id, Int32 l)
Definition: c4d_basecontainer.h:587
const BaseContainer & GetDataInstanceRef() const
Definition: c4d_baselist.h:2517
static BaseList2D * Alloc(Int32 type)
Definition: c4d_basedocument.h:112
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:67
#define VPBUFFER_OBJECTBUFFER
Object buffer multipass channel.
Definition: c4d_videopostdata.h:141
#define Zmultipass
Definition: ge_prepass.h:1294
@ MULTIPASSOBJECT_TYPE
Definition: zmultipass.h:6
@ MULTIPASSOBJECT_OBJECTBUFFER
Definition: zmultipass.h:8
Read-Only Properties
The following properties can be accessed:
if (object == nullptr)
Definition: c4d_baseobject.h:248
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:204
const char * doc
Definition: pyerrors.h:226
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, isCloneInit))
return false;
data.
SetBool(EXAMPLE_GENERATOR_PARAMETER_BOOL,
true);
data.
SetInt32(EXAMPLE_GENERATOR_PARAMETER_VALUE, 123);
void SetBool(Int32 id, Bool b)
Definition: c4d_basecontainer.h:580
Represents a C4DAtom that resides in a 4D list.
Definition: c4d_baselist.h:1975
PyObject * obj
Definition: complexobject.h:60
maxon::Bool Bool
Definition: ge_sys_math.h:51
- 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)
void SetBit(Int32 mask)
Definition: c4d_baselist.h:2433
Definition: c4d_videopost.h:24
Definition: c4d_basedocument.h:143
BaseVideoPost * GetFirstVideoPost()
#define BIT_VPDISABLED
Videopost is disabled.
Definition: ge_prepass.h:927
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.
if (shader == nullptr)
material->InsertShader(shader);
Definition: c4d_basechannel.h:36
static BaseShader * Alloc(Int32 type)
#define Xbrick
Brick.
Definition: ge_prepass.h:1324
#define ConstDescID(...)
Definition: lib_description.h:594
@ MATERIAL_COLOR_SHADER
Definition: mmaterial.h:294
Represents a level within a DescID.
Definition: lib_description.h:298
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();
const BaseObject*
const foundObject =
doc->SearchObject(objectName);
if (foundObject != nullptr)
{
if (foundObjectMarker.
Compare(marker) == 0)
else
}
const GeMarker & GetMarker() const
Definition: c4d_baselist.h:2590
A unique marker that identifies an object.
Definition: c4d_baselist.h:1445
Int32 Compare(const GeMarker &m) const
Definition: c4d_baselist.h:1482
Definition: c4d_string.h:41
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;
const Char* memory =
nullptr;
for (
Int32 i = 0;
i <
object->GetUniqueIDCount(); ++
i)
{
{
{
}
}
}
Py_ssize_t i
Definition: abstract.h:645
PyObject * value
Definition: abstract.h:715
static String IntToString(Int32 v)
Definition: c4d_string.h:497
void const void * bytes
Definition: bytesobject.h:117
maxon::Char Char
Definition: ge_sys_math.h:52
maxon::Int32 Int32
Definition: ge_sys_math.h:56
maxon::Int Int
Definition: ge_sys_math.h:60
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)
sphere->InsertTrackSorted(track);
const CTrack * FindCTrack(const DescID &id) const
Definition: c4d_baselist.h:2883
Definition: c4d_canimation.h:671
static CTrack * Alloc(BaseList2D *bl, const DescID &id)
Definition: lib_description.h:355
return OK
Definition: apibase.h:2735
@ DTYPE_REAL
Float
Definition: lib_description.h:68
@ PRIM_SPHERE_RAD
Definition: osphere.h:6
See Animation Overview.
Keyframe Selection
Parameters can be part of a so called keyframe selection:
if (description == nullptr)
if (
object->KeyframeSelectionContent())
{
void* handle = description->BrowseInit();
while (description->GetNext(handle, &bc, id, gid))
{
if (
object->FindKeyframeSelection(
id) && bc)
{
}
}
}
Definition: ge_autoptr.h:37
String GetString(Int32 id, const maxon::String &preset=maxon::String()) const
Definition: c4d_basecontainer.h:432
@ DESC_NAME
String Name for standalone use.
Definition: lib_description.h:91
See also C4DAtom Parameter Properties and Animate.
Layer
A BaseList2D based element can be part of a layer:
if (layer != nullptr)
{
if (ld != nullptr)
{
else
}
}
LayerObject * GetLayerObject(const BaseDocument *doc)
Definition: c4d_baselist.h:2822
Definition: c4d_basedocument.h:252
Definition: c4d_basedocument.h:318
Bool view
Visible in editor view.
Definition: c4d_basedocument.h:352
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:
else
DESCIDSTATE
Definition: ge_prepass.h:5525
@ LOCKED
Description element is locked.
Functionality
BaseList2D based elements can be edited with these functions:
if (clone == nullptr)
doc->InsertObject(clone,
nullptr,
nullptr);
object->TransferGoal(clone, false);
Bool Scale(Float scale)
Definition: c4d_baselist.h:2715
Definition: c4d_baselist.h:1520
C4DAtom * GetClone(COPYFLAGS flags, AliasTrans *trn) const
Definition: c4d_baselist.h:1605
Further Reading