This documentation is for the free plugin Py4D in CINEMA 4D R11.5 and not for the C4DSDK of Python in CINEMA 4D R12. For R12, please visit PluginCafe.com

c4d.BaseList2D

The base class of many other classes.

class c4d.BaseList2D

// Bit Handler

// Data Container

// Color

// Name and Description

// other stuff

// track support

// User data

SuperClass

GeListNode

Methods

static BaseList2D.__init__(type)
Parameter:type (int) – The id of the object, e.g: (Ocube). See also: Types.
Return type:BaseList2D
Returns:The new object.
BaseList2D.__setitem__(self, key, value)

Uses a description ID as a key into the container, and stores the specified data.

See also

c4d.symbols

Parameters:
BaseList2D.__getitem__(self, key)

Uses a description ID as a key into the container, and retrieves the stored data.

See also

c4d.symbols

Parameter:

key (int, list or DescID) – The description ID.

Return type:

any

Returns:
seealso:__setitem__()
BaseList2D.GetFirstCTrack()

Returns the first CTrack of an object..

Return type:CTrack
Returns:First track, or None if there are no tracks.
BaseList2D.GetCTracks()

Returns all CTracks of an object.

Return type:list of type CTrack
Returns:The CTrack
BaseList2D.GetMain()

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

Return type:BaseList2D
Returns:The main object of this object or None.
BaseList2D.SetBit(mask)

Each object contains a number of flags.

Parameter:mask (int) – Bit mask of the flags.
BaseList2D.GetBit(mask)

Each object contains a number of flags. See get_all_bits for the flags.

Parameter:mask (int) – Bit mask of the flags.
Return type:bool:
Returns:Returns the state of the object flags denoted by mask.
BaseList2D.DelBit(mask)

Deletes the object flags denoted by mask, i.e. sets the corresponding bit’s to 0. See get_all_bits for the flags.

Parameter:mask (int) – Bit mask of the flags.
BaseList2D.ToggleBit(mask)

Toggles the state of the object flags denoted by the mask. See get_all_bits for the flags.

Parameter:mask (int) – Bit mask of the flags.
BaseList2D.GetAllBits()

Returns all of the object’s bits. The available flags are:

BIT_ACTIVE Active element.
BIT_AFOLD Folded in timeline.
BIT_MATMARK Marked material.
BIT_ENABLEPAINT Enable painting.
BIT_MFOLD Folded in material manager.
BIT_BP_FOLDLAYERS Fold layers in material manager.
BIT_IGNOREDRAW Ignore object during draw.
BIT_OFOLD Folded in object manager.
BIT_CONTROLOBJECT Internal bit set by generators.
BIT_ANIM_OFF Inactive sequence.
BIT_VPDISABLED Video post is disabled.
BIT_DOCUMENT_CHECKREWIND Check rewind.
BIT_ACTIVERENDERDATA Active renderdata
Parameter:mask (int) – The bit
Return type:int
Returns:The flags
BaseList2D.SetAllBits(mask)

Set the object*s bits. See get_all_bits to see which bits you can set.

Parameter:mask (int) – Bit mask of the flags.
BaseList2D.GetIcon()

Returns the original bitmap pattern.

Warning

Please, never edit this bitmap - read only.

An example:

icon = obj.GetIcon() # icon[“bmp”], icon[“x”], icon[“y”], icon[“w”], icon[“h”]
Return type:dict
Returns:Returns the image and information.
BaseList2D.GetInfo()

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

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

Get a real spline representation of a primitive spline object. This can for example be used to calculate the length of the spline. If the object is a real spline it returns this. Otherwise None.

Return type:SplineObject
Returns:The created spline object or None.
BaseList2D.GetVisibility(parent)

The object’s visibility depends upon its parent, if it has no visibility track this will return the parent’s visibility which is passed. The range of values are 0.0<=visibility<=1.0.

Parameter:parent (float) – The parent objects visibility.
Return type:float
Returns:The visibility.
BaseList2D.KillTag(type[, nr=0])

Removes a tag from the object and free its resources.

Parameters:
  • type (int) – A tag type.
  • nr (int) – The starting tag index to find of this type.
BaseList2D.GetDataInstance()

Returns a reference to the object container which can be changed directly.

Note

Please note, BaseContainer.__setitem__ raises TypeError when you overwrite a type with a different one. To set a new type, delete the entry before.

Return type:BaseContainer
Returns:The original container reference.
BaseList2D.GetData()

Returns a copy of the object’s container.

Return type:BaseContainer
Returns:The container reference.
BaseList2D.SetData(bc[, add=True])

Sets the object container. By default the contents of bc are merged with the existing container. You can control this behaviour with add.

Note

Don’t forget to send a BaseList2D.Message if you change any settings.

Parameters:
  • bc (BaseContainer) – The container.
  • add (bool) – If this is TRUE the values are merged, otherwise the old values are discarded.
Return type:

BaseContainer

Returns:

The container reference.

BaseList2D.GetColor()

Returns the palette number of the object (0-7).

Return type:int
Returns:The number
BaseList2D.SetColor(c)

Set the palette number of the object (0-7).

Raises:Throws exception IndexError if col is out of range.
Parameter:c (int) – The number
BaseList2D.GetTypeName()

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

Return type:str
Returns:The type name.
BaseList2D.SetName(name)

Set the name of the object.

Parameter:name (str) – Set the name.
BaseList2D.GetName()

Returns the name of the object.

Return type:str
Returns:The name.
BaseList2D.Message(type[, data])

Sends a message to the atom only.

Parameters:
  • type (int) – The id.
  • data (any) – Depends on type.
Return type:

bool

Returns:

Depends on the message type.

BaseList2D.Edit()

Triggers the edit action for this object. 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.GetBubbleHelp()

Returns the bubble help of the object.

Return type:str
Returns:The bubble help.
BaseList2D.GetDocument()

Returns the document where the object is stored in.

Return type:BaseDocument
Returns:The document if the object is stored in a document, otherwise returns None.
BaseList2D.AddCustomDataType(bc)

Allocates a new user data and return its ID. Use c4d.get_custom_datatype_default() to create a default container:

import c4d

def add_long_datatype(obj):
    if obj is None: return

    bc = c4d.get_custom_datatype_default(c4d.DTYPE_LONG) #create default container
    bc[c4d.DESC_NAME] = "Test"                    #rename the entry

    element = obj.add_custom_datatype(bc)     #add userdata container
    obj[element] = 30                         #assign a value
    c4d.event_add()                           #update
../../../../../_images/userdata.png
Para bc:Settings of the new user data.
Return type:list of int
Returns:The ID of the new user data. E.g: (c4d.ID_USERDATA, 1)
BaseList2D.RemoveCustomDataType(id)

Removes a userdata element.

Parameter:id (int) – The id of the userdata.
Return type:bool
Returns:Returns True if the userdata is removed.
BaseList2D.GetHighlightHandle(bd)

Checks if a highlight handle has been hit, by returning the ID previously returned by ObjectData.detect_handle(). The handle can then be drawn in the highlight mode.

Parameter:bd (BaseDraw) – A base draw.
Return type:int
Returns:The Handle ID.

Table Of Contents

This Page