c4d.BaseList2D

class c4d.BaseList2D

Methods Signatures

Magic Methods

BaseList2D.__init__(self, type)

type type

int

BaseList2D.__str__(self)

Returns the BaseList2D as string. Called if str() is wrapped around an instance of BaseList2D. (See __str__.)

Bit Handler

BaseList2D.DelBit(self, mask)

Deletes the object bits denoted by mask, i.e. sets the corresponding bit to 0.

BaseList2D.GetAllBits(self)

Returns all of the object’s bits.

BaseList2D.GetBit(self, mask)

Gets the state of the object bits denoted by mask.

BaseList2D.SetAllBits(self, mask)

Sets all the object’s bits at once.

BaseList2D.SetBit(self, mask)

Sets the object bits denoted by mask.

BaseList2D.ToggleBit(self, mask)

Toggles the state of the object bits denoted by mask.

Data

BaseList2D.GetData(self)

Returns a copy of the object’s container.

BaseList2D.GetDataInstance(self)

This method returns the original container of the object.

BaseList2D.SetData(self, bc[, add])

Sets the object container.

Keyframes

BaseList2D.ClearKeyframeSelection(self)

Clears the current keyframe selection.

BaseList2D.FindKeyframeSelection(self, id)

Checks if id is included in the keyframe selection.

BaseList2D.KeyframeSelectionContent(self)

Checks if there are any active keyframe selections.

BaseList2D.SetKeyframeSelection(self, id, selection)

Sets the keyframe selection status of id to selection.

Layer

BaseList2D.GetLayerData(self, doc[, rawdata])

Get the layer data for this object.

BaseList2D.GetLayerObject(self, doc)

Get the layer of this object.

BaseList2D.SetLayerData(self, doc, data)

Set the layer data for this object.

BaseList2D.SetLayerObject(self, layer)

Set the layer of this object.

Name and Description

BaseList2D.GetBubbleHelp(self)

Returns the bubble help of the object.

BaseList2D.GetName(self)

Returns the name of the object.

BaseList2D.GetTypeName(self)

The name of the object category, for example Phong, Spline, Bone, etc.

BaseList2D.SetName(self, name)

Set the name of the object.

Nodes

BaseList2D.GetAllNimbusRefs(self)

Retrieve a list of tuple of all NodeSpace ID and NimbusRef of the current BaseList is holding.

BaseList2D.GetNimbusRef(self, spaceId)

Return the owning NimbusBaseRef corresponding to the provided NodeSpace Id.

BaseList2D.IsNodeBased(self)

Checks whether the object contains nodes.

BaseList2D.RemoveNimbusRef(self, spaceId)

Remove the NimbusRef and therefore the owned graph, corresponding to the provided NodeSpace Id.

Private

BaseList2D.AddEventNotification(self, bl, eventid, ...)

Private.

BaseList2D.FindEventNotification(self, doc, bl, eventid)

Private.

BaseList2D.RemoveEventNotification(self, doc, bl, eventid)

Private.

Shader

BaseList2D.GetFirstShader(self)

Returns the first shader of the object.

BaseList2D.InsertShader(self, shader[, pred])

Inserts a shader in the object’s shader list.

Tracks

BaseList2D.FindCTrack(self, id)

Find the track for the specified description id.

BaseList2D.GetCTrackRoot(self)

Returns the track root of the object. To get the tracks of an object use GetCTracks() instead.

BaseList2D.GetCTracks(self)

Returns all CTracks of an object.

BaseList2D.GetFirstCTrack(self)

Returns the first CTrack of the object.

BaseList2D.InsertTrackSorted(self, track)

Inserts a track and automatically places it at the right place (so that Y comes after Y etc.)

User Data

BaseList2D.AddUserData(self, datadescription)

Allocates a new user data and return its ID.

BaseList2D.GetUserDataContainer(self)

Browse through the user data container sequence.

BaseList2D.RemoveUserData(self, id)

Removes a userdata element. There are several ways how to delete a user data.

BaseList2D.SetUserDataContainer(self, descid, ...)

Insert a new user data with the specified ID.

Uncategorized

BaseList2D.GetNodeData(self)

Returns the NodeData part of the BaseList2D.

BaseList2D.GetMain(self)

Goes up the next level, e.g. from tag to object or Xpresso node to tag, or object to document, etc.

BaseList2D.GetIcon(self)

Returns the original bitmap pattern.

BaseList2D.GetIconEx(self)

Returns the original bitmap pattern.

BaseList2D.GetInfo(self)

Returns the information flags for the object. The interpretation depends on the object type.

BaseList2D.TransferGoal(self, dst, undolink)

Transfer goals from this object to dst.

BaseList2D.GetNLARoot(self)

Private.

BaseList2D.Scale(self, scale)

Scale the object.

BaseList2D.Edit(self)

Triggers the edit action for this object.

BaseList2D.SetAnimatedParameter(self, track, id, ...)

Normally not used. Used by the animator to set the interpolated value along with the right and left values.

BaseList2D.GetAnimatedParameter(self, id, flags)

Normally not used. Used by the animator to set the interpolated value along with the right and left values.

Inheritance

Parent Class:

Children Classes:

Methods Documentation

BaseList2D.__init__(self, type)
Parameters

type (int) – The id of the object, e.g: (Ocube). See also: Descriptions in Cinema 4D.

BaseList2D.__str__(self)

Returns the BaseList2D as string. Called if str() is wrapped around an instance of BaseList2D. (See __str__.)

Return type

str

Returns

The string representation of BaseList2D.

BaseList2D.DelBit(self, mask)

Deletes the object bits denoted by mask, i.e. sets the corresponding bit to 0.

Parameters

mask (int) –

The bit mask of the bits:

BIT_ACTIVE

Active element.

BIT_ACTIVE2

Private.

BIT_ACTIVE3

New in version R17.032: Private.

BIT_ACTIVERENDERDATA

Active render data.

BIT_ACTIVESELECTIONDRAW

Draws active selection.

BIT_ANIM_CONSTANTVELOCITY

Constant velocity of the track.

BIT_ANIM_OFF

Inactive sequence.

BIT_ANIM_SOLO

Solo track.

BIT_BP_FOLDLAYERS

Fold layers in material manager.

BIT_CONTROLOBJECT

Internal bit set by generators.

BIT_DOCUMENT_CHECKREWIND

Check rewind.

BIT_EDITOBJECT

Private.

BIT_ENABLEPAINT

Enable painting.

BIT_FORCE_UNOPTIMIZED

Private.

BIT_HIGHLIGHT

Private.

BIT_IGNOREDRAW

Ignore object during draw.

BIT_IGNOREDRAWBOX

Ignore object drawing box.

BIT_MATMARK

Marked material.

BIT_MFOLD

Folded in material manager.

BIT_OFOLD

Folded in object manager.

BIT_RECALCPREVIEW

Recalculate preview.

BIT_RECMARK

Private.

BIT_TEMPDRAW_VISIBLE_CACHECHILD

Private.

BIT_TEMPDRAW_VISIBLE_CHILD

Private.

BIT_TEMPDRAW_VISIBLE_DEFCACHECHILD

Private.

BIT_TRACKPROCESSED

Track has been processed, avoid recursions.

BIT_VPDISABLED

Videopost is disabled.

BaseList2D.GetAllBits(self)

Returns all of the object’s bits.

Return type

int

Returns

The object’s bits:

BIT_ACTIVE

Active element.

BIT_ACTIVE2

Private.

BIT_ACTIVE3

New in version R17.032: Private.

BIT_ACTIVERENDERDATA

Active render data.

BIT_ACTIVESELECTIONDRAW

Draws active selection.

BIT_ANIM_CONSTANTVELOCITY

Constant velocity of the track.

BIT_ANIM_OFF

Inactive sequence.

BIT_ANIM_SOLO

Solo track.

BIT_BP_FOLDLAYERS

Fold layers in material manager.

BIT_CONTROLOBJECT

Internal bit set by generators.

BIT_DOCUMENT_CHECKREWIND

Check rewind.

BIT_EDITOBJECT

Private.

BIT_ENABLEPAINT

Enable painting.

BIT_FORCE_UNOPTIMIZED

Private.

BIT_HIGHLIGHT

Private.

BIT_IGNOREDRAW

Ignore object during draw.

BIT_IGNOREDRAWBOX

Ignore object drawing box.

BIT_MATMARK

Marked material.

BIT_MFOLD

Folded in material manager.

BIT_OFOLD

Folded in object manager.

BIT_RECALCPREVIEW

Recalculate preview.

BIT_RECMARK

Private.

BIT_TEMPDRAW_VISIBLE_CACHECHILD

Private.

BIT_TEMPDRAW_VISIBLE_CHILD

Private.

BIT_TEMPDRAW_VISIBLE_DEFCACHECHILD

Private.

BIT_TRACKPROCESSED

Track has been processed, avoid recursions.

BIT_VPDISABLED

Videopost is disabled.

BaseList2D.GetBit(self, mask)

Gets the state of the object bits denoted by mask.

Parameters

mask (int) –

The bit mask of the bits:

BIT_ACTIVE

Active element.

BIT_ACTIVE2

Private.

BIT_ACTIVE3

New in version R17.032: Private.

BIT_ACTIVERENDERDATA

Active render data.

BIT_ACTIVESELECTIONDRAW

Draws active selection.

BIT_ANIM_CONSTANTVELOCITY

Constant velocity of the track.

BIT_ANIM_OFF

Inactive sequence.

BIT_ANIM_SOLO

Solo track.

BIT_BP_FOLDLAYERS

Fold layers in material manager.

BIT_CONTROLOBJECT

Internal bit set by generators.

BIT_DOCUMENT_CHECKREWIND

Check rewind.

BIT_EDITOBJECT

Private.

BIT_ENABLEPAINT

Enable painting.

BIT_FORCE_UNOPTIMIZED

Private.

BIT_HIGHLIGHT

Private.

BIT_IGNOREDRAW

Ignore object during draw.

BIT_IGNOREDRAWBOX

Ignore object drawing box.

BIT_MATMARK

Marked material.

BIT_MFOLD

Folded in material manager.

BIT_OFOLD

Folded in object manager.

BIT_RECALCPREVIEW

Recalculate preview.

BIT_RECMARK

Private.

BIT_TEMPDRAW_VISIBLE_CACHECHILD

Private.

BIT_TEMPDRAW_VISIBLE_CHILD

Private.

BIT_TEMPDRAW_VISIBLE_DEFCACHECHILD

Private.

BIT_TRACKPROCESSED

Track has been processed, avoid recursions.

BIT_VPDISABLED

Videopost is disabled.

Return type

int

Returns

The state of the object bits.

BaseList2D.SetAllBits(self, mask)

Sets all the object’s bits at once.

Parameters

mask (int) –

The object’s bits to set:

BIT_ACTIVE

Active element.

BIT_ACTIVE2

Private.

BIT_ACTIVE3

New in version R17.032: Private.

BIT_ACTIVERENDERDATA

Active render data.

BIT_ACTIVESELECTIONDRAW

Draws active selection.

BIT_ANIM_CONSTANTVELOCITY

Constant velocity of the track.

BIT_ANIM_OFF

Inactive sequence.

BIT_ANIM_SOLO

Solo track.

BIT_BP_FOLDLAYERS

Fold layers in material manager.

BIT_CONTROLOBJECT

Internal bit set by generators.

BIT_DOCUMENT_CHECKREWIND

Check rewind.

BIT_EDITOBJECT

Private.

BIT_ENABLEPAINT

Enable painting.

BIT_FORCE_UNOPTIMIZED

Private.

BIT_HIGHLIGHT

Private.

BIT_IGNOREDRAW

Ignore object during draw.

BIT_IGNOREDRAWBOX

Ignore object drawing box.

BIT_MATMARK

Marked material.

BIT_MFOLD

Folded in material manager.

BIT_OFOLD

Folded in object manager.

BIT_RECALCPREVIEW

Recalculate preview.

BIT_RECMARK

Private.

BIT_TEMPDRAW_VISIBLE_CACHECHILD

Private.

BIT_TEMPDRAW_VISIBLE_CHILD

Private.

BIT_TEMPDRAW_VISIBLE_DEFCACHECHILD

Private.

BIT_TRACKPROCESSED

Track has been processed, avoid recursions.

BIT_VPDISABLED

Videopost is disabled.

BaseList2D.SetBit(self, mask)

Sets the object bits denoted by mask.

Parameters

mask (int) –

The bit mask of the bits:

BIT_ACTIVE

Active element.

BIT_ACTIVE2

Private.

BIT_ACTIVE3

New in version R17.032: Private.

BIT_ACTIVERENDERDATA

Active render data.

BIT_ACTIVESELECTIONDRAW

Draws active selection.

BIT_ANIM_CONSTANTVELOCITY

Constant velocity of the track.

BIT_ANIM_OFF

Inactive sequence.

BIT_ANIM_SOLO

Solo track.

BIT_BP_FOLDLAYERS

Fold layers in material manager.

BIT_CONTROLOBJECT

Internal bit set by generators.

BIT_DOCUMENT_CHECKREWIND

Check rewind.

BIT_EDITOBJECT

Private.

BIT_ENABLEPAINT

Enable painting.

BIT_FORCE_UNOPTIMIZED

Private.

BIT_HIGHLIGHT

Private.

BIT_IGNOREDRAW

Ignore object during draw.

BIT_IGNOREDRAWBOX

Ignore object drawing box.

BIT_MATMARK

Marked material.

BIT_MFOLD

Folded in material manager.

BIT_OFOLD

Folded in object manager.

BIT_RECALCPREVIEW

Recalculate preview.

BIT_RECMARK

Private.

BIT_TEMPDRAW_VISIBLE_CACHECHILD

Private.

BIT_TEMPDRAW_VISIBLE_CHILD

Private.

BIT_TEMPDRAW_VISIBLE_DEFCACHECHILD

Private.

BIT_TRACKPROCESSED

Track has been processed, avoid recursions.

BIT_VPDISABLED

Videopost is disabled.

BaseList2D.ToggleBit(self, mask)

Toggles the state of the object bits denoted by mask.

Parameters

mask (int) –

The bit mask of the bits:

BIT_ACTIVE

Active element.

BIT_ACTIVE2

Private.

BIT_ACTIVE3

New in version R17.032: Private.

BIT_ACTIVERENDERDATA

Active render data.

BIT_ACTIVESELECTIONDRAW

Draws active selection.

BIT_ANIM_CONSTANTVELOCITY

Constant velocity of the track.

BIT_ANIM_OFF

Inactive sequence.

BIT_ANIM_SOLO

Solo track.

BIT_BP_FOLDLAYERS

Fold layers in material manager.

BIT_CONTROLOBJECT

Internal bit set by generators.

BIT_DOCUMENT_CHECKREWIND

Check rewind.

BIT_EDITOBJECT

Private.

BIT_ENABLEPAINT

Enable painting.

BIT_FORCE_UNOPTIMIZED

Private.

BIT_HIGHLIGHT

Private.

BIT_IGNOREDRAW

Ignore object during draw.

BIT_IGNOREDRAWBOX

Ignore object drawing box.

BIT_MATMARK

Marked material.

BIT_MFOLD

Folded in material manager.

BIT_OFOLD

Folded in object manager.

BIT_RECALCPREVIEW

Recalculate preview.

BIT_RECMARK

Private.

BIT_TEMPDRAW_VISIBLE_CACHECHILD

Private.

BIT_TEMPDRAW_VISIBLE_CHILD

Private.

BIT_TEMPDRAW_VISIBLE_DEFCACHECHILD

Private.

BIT_TRACKPROCESSED

Track has been processed, avoid recursions.

BIT_VPDISABLED

Videopost is disabled.

BaseList2D.GetData(self)

Returns a copy of the object’s container.

Return type

c4d.BaseContainer

Returns

The container reference.

BaseList2D.GetDataInstance(self)
This method returns the original container of the object.
The container is only alive as long as the host object is alive.
If you access the container even the host object is dead, Python will raise a ReferenceError.

The elements of the container are type protected when you set touch them via GeListNode.__setitem__(),
that means, you can just overwrite an element with a new object when its of the same type. When you want to overwrite the element with another type, you need to delete the previous element
with del(bc[ELEMENT_ID]), or use the manual BaseContainer.Set* methods.
Raises
  • ReferenceError – If the container is dead. The container is just alive as long as the host object is alive. Access to a dead container leads to this error.

  • TypeError – When you set an element of the wrong expected type.

Return type

c4d.BaseContainer

Returns

The original container reference.

BaseList2D.SetData(self, bc, add=True)
Sets the object container.
By default the contents of bc are merged with the existing container.
You can control this behavior with add.

Note

Do not forget to send a C4DAtom.Message() if you change any settings.

Parameters
  • bc (c4d.BaseContainer) – The container.

  • add (bool) – If this is True the values are merged, otherwise the old values are discarded.

Return type

c4d.BaseContainer

Returns

The container reference.

BaseList2D.ClearKeyframeSelection(self)

Clears the current keyframe selection.

BaseList2D.FindKeyframeSelection(self, id)

Checks if id is included in the keyframe selection.

Parameters

id (c4d.DescID) – The description ID to check.

Return type

bool

Returns

True if the given id is selected, otherwise False.

BaseList2D.KeyframeSelectionContent(self)

Checks if there are any active keyframe selections.

Note

This is not the same as BIT_ACTIVE, it is the possibility to restrict autokeyframing to certain description parameters.
See “Animation->Add Keyframe Selection” in the Attributes Manager.
Return type

bool

Returns

True if there is a keyframe selection, otherwise False.

BaseList2D.SetKeyframeSelection(self, id, selection)

Sets the keyframe selection status of id to selection.

Parameters

id (c4d.DescID) – The description ID to set.

Returns

True to select the key, otherwise id is selected, otherwise False.

BaseList2D.GetLayerData(self, doc, rawdata=False)

Get the layer data for this object.

Changed in version R21: xref added to the dictionary.

Parameters
  • doc (c4d.documents.BaseDocument) – The document.

  • rawdata (bool) – Usually GetLayerData() takes special global modes like SOLO Layer automatically into account. But if you want to see the original layer values without any additional global changes you can set rawdata to True to get them.

Return type

dict{solo: bool, view: bool, render: bool, manager: bool, locked: bool, generators: bool, expressions: bool, animation: bool, color: Vector, xref: bool}

BaseList2D.GetLayerObject(self, doc)

Get the layer of this object.

Parameters

doc (c4d.documents.BaseDocument) – The document.

Return type

c4d.documents.LayerObject

Returns

The layer.

BaseList2D.SetLayerData(self, doc, data)

Set the layer data for this object.

Changed in version R21: xref added to the dictionary.

Parameters
  • doc (c4d.documents.BaseDocument) – The document.

  • data (dict{solo: bool, view: bool, render: bool, manager: bool, locked: bool, generators: bool, expressions: bool, animation: bool, color: c4d.Vector, xref: bool}) – The new layer data. it is possible to leave values in the dictionary out.

Return type

bool

Returns

True if successful, otherwise False.

BaseList2D.SetLayerObject(self, layer)

Set the layer of this object.

Parameters

layer (Optional[c4d.documents.LayerObject]) –

The new layer.

Changed in version R18.020: Can be None.

Return type

bool

Returns

True if successful, otherwise False.

BaseList2D.GetBubbleHelp(self)

Returns the bubble help of the object.

Return type

str

Returns

The bubble help.

BaseList2D.GetName(self)

Returns the name of the object.

Return type

str

Returns

The name.

BaseList2D.GetTypeName(self)

The name of the object category, for example Phong, Spline, Bone, etc.

Return type

str

Returns

The type name.

BaseList2D.SetName(self, name)

Set the name of the object.

Parameters

name (str) – Set the name.

BaseList2D.GetAllNimbusRefs(self)

Retrieve a list of tuple of all NodeSpace ID and NimbusRef of the current BaseList is holding.

New in version S24.

Returns

A list of tuple. | The first item of this tuple is a maxon.Id of the nodespace. | The second item of this tuple is the corresponding maxon.NimbusBaseRef.

Return type

List[Tuple[maxon.Id, maxon.NimbusBaseRef]]

BaseList2D.GetNimbusRef(self, spaceId)

Return the owning NimbusBaseRef corresponding to the provided NodeSpace Id.

New in version S24.

Parameters

spaceId (maxon.Id) – The NodeSpace ID.

Returns

Returns the owner of the node graph. None if the nimbusRef is not found

Return type

Optional[maxon.NimbusBaseRef]

BaseList2D.IsNodeBased(self)

Checks whether the object contains nodes.

New in version S24.

Returns

Return True if a maxon.NimbusBaseRef is attached to the current c4d.BaseList2D.

Return type

bool

BaseList2D.RemoveNimbusRef(self, spaceId)

Remove the NimbusRef and therefore the owned graph, corresponding to the provided NodeSpace Id.

New in version S24.

Parameters

spaceId (maxon.Id) – The NodeSpace ID.

BaseList2D.AddEventNotification(self, bl, eventid, flags, data)

Private.

BaseList2D.FindEventNotification(self, doc, bl, eventid)

Private.

BaseList2D.RemoveEventNotification(self, doc, bl, eventid)

Private.

BaseList2D.GetFirstShader(self)

Returns the first shader of the object.

Note

Normally you don’t have to deal with this list. But if you want to create or modify shader trees via the API you need to read the following lines:

  • If you are programming shader links you need to make sure that every shader is referenced only once; it is not allowed that a shader is referenced multiple times.

  • If the referencing object is a shader the referenced shader must be a child of it, otherwise it must be inserted via InsertShader().

  • Example 1: A tag references a shader. The shader must be inserted into the tag using tag.InsertShader().

  • Example 2: A shader (A) references another shader (B): shader B must be a child of shader A.

Return type

Optional[c4d.BaseList2D]

Returns

The first shader of the object, or None if there is no shader.

BaseList2D.InsertShader(self, shader, pred=None)

Inserts a shader in the object’s shader list.

# Get the first material in the document.
material = doc.GetFirstMaterial()
if material is None:
    raise MemoryError("Could not allocate material node.")

# Instantiate a bitmap shader and insert it into the material.
shader = c4d.BaseList2D(c4d.Xbitmap)
material.InsertShader(shader)

# Link the shader in the color channel.
material[c4d.MATERIAL_COLOR_SHADER] = shader
material.Message(c4d.MSG_UPDATE)
material.Update(True, True)

# Push an update event to Cinema 4D
c4d.EventAdd()
Parameters
  • shader (c4d.BaseList2D) – The shader to insert.

  • pred (Optional[c4d.BaseList2D]) – The shader to insert the new shader after, or None to insert the new shader first. This shader must already be inserted into the list.

BaseList2D.FindCTrack(self, id)

Find the track for the specified description id.

Parameters

id (c4d.DescID) – The description ID to check.

Return type

Optional[c4d.CTrack]

Returns

The track found, or None if there was no match.

BaseList2D.GetCTrackRoot(self)

Returns the track root of the object. To get the tracks of an object use GetCTracks() instead.

Return type

Optional[c4d.GeListHead]

Returns

The track root if there is one, otherwise None.

Changed in version R19.

The function now returns a c4d.GeListHead object.

BaseList2D.GetCTracks(self)

Returns all CTracks of an object.

Return type

List[c4d.CTrack]

Returns

The CTrack.

BaseList2D.GetFirstCTrack(self)

Returns the first CTrack of the object.

Return type

Optional[c4d.CTrack]

Returns

The first track, or None if there are no tracks.

BaseList2D.InsertTrackSorted(self, track)

Inserts a track and automatically places it at the right place (so that Y comes after Y etc.)

Parameters

track (c4d.CTrack) – The track to insert.

BaseList2D.AddUserData(self, datadescription)

Allocates a new user data and return its ID.

Use c4d.GetCustomDataTypeDefault() to create a default container for user data.

See also

The DESC documentation can be helpful to create an user data element form scratch.

# Create default container for the data type Int32.
bc = c4d.GetCustomDataTypeDefault(c4d.DTYPE_LONG)
# The display name of the element.
bc[c4d.DESC_NAME] = "Test"
# The minimum and maximum value of the element.
bc[c4d.DESC_MIN] = 0
bc[c4d.DESC_MAX] = 100

# Add the user data element, retrieving its DescId.
descId = op.AddUserData(bc)

# Write a new value with that DescId
op[descId] = 30
# Push an update event to Cinema 4D
c4d.EventAdd()
../../../../../_images/baselist2d_userdata.png
Parameters

datadescription (c4d.BaseContainer) – Settings of the new user data. See Description for more information on the description IDs.

Return type

c4d.DescID

Returns

The description ID. The first level is c4d.DESCID_DYNAMICSUB.

BaseList2D.GetUserDataContainer(self)

Browse through the user data container sequence.

>>> for cid, bc in op.GetUserDataContainer():
...     print(cid, bc)
...
((700, 5, 0), (1, 19, 0)) <c4d.BaseContainer object at 0x0000018AA3496840>
((700, 5, 0), (2, 23, 0)) <c4d.BaseContainer object at 0x0000018AA349EE80>
((700, 5, 0), (3, 400007013, 0)) <c4d.BaseContainer object at 0x0000018AA349B780>
Return type

List[c4d.DescID, c4d.BaseContainer]

Returns

A list of tuples with the Description ID and container for each user data.

BaseList2D.RemoveUserData(self, id)

Removes a userdata element. There are several ways how to delete a user data.

This function supports several types to identify a user data entry.

>>> # Removes user data element with the ID 1.
>>> op.RemoveUserData(1)
True
>>> # Removes user data element with the ID 2.
>>> op.RemoveUserData([c4d.ID_USERDATA, 2])
True
>>> # Removes user data element with the ID 3.
>>> descId = c4d.DescID(c4d.DescLevel(c4d.ID_USERDATA), c4d.DescLevel(3))
>>> op.RemoveUserData(descId)
True
Parameters

id (Union[int, List[int], c4d.DescID]) – The id of the userdata.

Return type

bool

Returns

True if the userdata is removed, otherwise False.

BaseList2D.SetUserDataContainer(self, descid, datadescription)

Insert a new user data with the specified ID.

Parameters
Return type

True if the user data was inserted, otherwise False.

BaseList2D.GetNodeData(self)

Returns the NodeData part of the BaseList2D.

Note

Only Python defined node.

Return type

any

Returns

The established NodeData.

BaseList2D.GetMain(self)

Goes up the next level, e.g. from tag to object or Xpresso node to tag, or object to document, etc.

Return type

Optional[c4d.BaseList2D]

Returns

The main object of this object or None.

BaseList2D.GetIcon(self)

Returns the original bitmap pattern.

Warning

Please, never edit the returned bitmap - read only.

An example

>>> op.GetIcon()
{'bmp': <c4d.bitmaps.BaseBitmap object at 0x0000018AA34B45C0>, 'x': 832, 'y': 64, 'w': 64, 'h': 64}
Return type

dict{bmp: BaseBitmap, x: int, y: int, w: int, h: int}

Returns

The image and size information like height, width and X/Y position in the icon table.

BaseList2D.GetIconEx(self)

Returns the original bitmap pattern.

Note

Similar to BaseList2D.GetIcon() but instead returns a c4d.IconData.

Warning

Please, never edit the returned bitmap - read only.

Return type

c4d.IconData

Returns

The image and size information like height, width and X/Y position in the icon table.

BaseList2D.GetInfo(self)

Returns the information flags for the object. The interpretation depends on the object type.

When a BaseList2D is registered, some behaviors have to be defined (e.g. for an object, it might be a generator, a modifier, etc…)

This is done through Flags, and GetInfo returns these flags.

>>> op
<c4d.BaseObject object called Cube/Cube with ID 5159 at 1694956664448>
>>> op.GetInfo()
268435460
>>> # To make this output useful, we have to use a bitmask.
>>> op.GetInfo() & c4d.OBJECT_MODIFIER
0
>>> op.GetInfo() & c4d.OBJECT_GENERATOR
4
Return type

int

Returns

The flags. This is the same as the info parameter of the registration function of the registration function of the NodeData.

BaseList2D.TransferGoal(self, dst, undolink)
Transfer goals from this object to dst.
This changes all internal links that point to this object to point to dst instead.
Parameters
  • dst (c4d.BaseList2D) – The destination

  • undolink (bool) – This has to be set to False. Private.

BaseList2D.GetNLARoot(self)

Private.

BaseList2D.Scale(self, scale)

Scale the object.

Parameters

scale (float) – The size.

BaseList2D.Edit(self)
Triggers the edit action for this object.

Note

For most types this brings up the node in the attributes manager.
Some still show a separate dialog.
Return type

bool

Returns

False if an error occurred, otherwise True.

BaseList2D.SetAnimatedParameter(self, track, id, t_data1, t_data2, mix, flags)

Normally not used. Used by the animator to set the interpolated value along with the right and left values.

New in version R23.105.

Parameters
  • track (c4d.CTrack) – The animation track. The caller owns the pointed track.

  • id (c4d.DescID) – The ID of the animated parameter.

  • t_data1 (Any) – The first data.

  • t_data2 (Any) – The second data.

  • mix (float) – The mix value between t_data1 and t_data2

  • flags (int) –

    Flags:

    DESCFLAGS_SET_NONE

    None.

    DESCFLAGS_SET_PARAM_SET

    Parameter set.

    DESCFLAGS_SET_USERINTERACTION

    Set when the GUI is calling SetParameter(). This is the only time when SetParameter() is allowed to use user interaction elements (e.g. open dialogs, display messages etc.).

    DESCFLAGS_SET_DONTCHECKMINMAX

    No check is internally done if the parameter passed is within the [min/max] range of the description, to save some time.

    DESCFLAGS_SET_DONTAFFECTINHERITANCE

    No parameter inheritance, for render settings and post effects only.

    DESCFLAGS_SET_FORCESET

    Forces the set value without GetParameter()/Compare. Use only for calls where for sure the value was changed!

    DESCFLAGS_SET_DONTFREESPLINECACHE

    Private.

    New in version R16.038.

    DESCFLAGS_SET_INDRAG

    Gadget (e.g. Slider) in dragging mode (not finished). Only used when DESCFLAGS_SET_USERINTERACTION is set.

    New in version R17.053.

Returns

True if the animated parameter was set, otherwise False.

Return type

bool

BaseList2D.GetAnimatedParameter(self, id, flags)

Normally not used. Used by the animator to set the interpolated value along with the right and left values.

New in version R23.105.

Parameters
  • id (c4d.DescID) – The ID of the animated parameter.

  • flags (int) –

    Flags:

    DESCFLAGS_GET_NONE

    None.

    DESCFLAGS_GET_PARAM_GET

    Parameter retrieved.

    DESCFLAGS_GET_NO_GEDATADEFAULTVALUE

    If set, the C++ GeData default type will not be initialized for C4DAtom.GetParameter().

    DESCFLAGS_GET_NO_GLOBALDATA

    Private.

Returns

A tuple of the first data, the second data and the mix value between both data.

Return type

Tuple[Any, Any, float]