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
The base class of many other classes.
// Bit Handler
// Data Container
// Color
// Name and Description
// other stuff
// track support
// User data
GeListNode
BaseObject CTrack CCurve BaseTag SelectionTag UVWTag c4d.BaseDocument BaseView GvNode GvNodeMaster RenderData BaseMaterial TP_PGroup TP_MasterSystem
| Parameter: | type (int) – The id of the object, e.g: (Ocube). See also: Types. |
|---|---|
| Return type: | BaseList2D |
| Returns: | The new object. |
Uses a description ID as a key into the container, and stores the specified data.
See also
| Parameters: |
|
|---|
Uses a description ID as a key into the container, and retrieves the stored data.
See also
| Parameter: | key (int, list or DescID) – The description ID. |
||
|---|---|---|---|
| Return type: | any |
||
| Returns: |
|
Returns the first CTrack of an object..
| Return type: | CTrack |
|---|---|
| Returns: | First track, or None if there are no tracks. |
Returns all CTracks of an object.
| Return type: | list of type CTrack |
|---|---|
| Returns: | The CTrack |
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. |
Each object contains a number of flags.
| Parameter: | mask (int) – Bit mask of the flags. |
|---|
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. |
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. |
|---|
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. |
|---|
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 |
Set the object*s bits. See get_all_bits to see which bits you can set.
| Parameter: | mask (int) – Bit mask of the flags. |
|---|
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. |
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. |
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. |
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. |
Removes a tag from the object and free its resources.
| Parameters: |
|
|---|
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. |
Returns a copy of the object’s container.
| Return type: | BaseContainer |
|---|---|
| Returns: | The container reference. |
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: |
|
|---|---|
| Return type: | |
| Returns: | The container reference. |
Returns the palette number of the object (0-7).
| Return type: | int |
|---|---|
| Returns: | The number |
Set the palette number of the object (0-7).
| Raises: | Throws exception IndexError if col is out of range. |
|---|---|
| Parameter: | c (int) – The number |
The name of the object category, for example Phong, Spline, Bone, etc.
| Return type: | str |
|---|---|
| Returns: | The type name. |
Set the name of the object.
| Parameter: | name (str) – Set the name. |
|---|
Returns the name of the object.
| Return type: | str |
|---|---|
| Returns: | The name. |
Sends a message to the atom only.
| Parameters: |
|
|---|---|
| Return type: | bool |
| Returns: | Depends on the message type. |
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. |
Returns the bubble help of the object.
| Return type: | str |
|---|---|
| Returns: | The bubble help. |
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. |
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

| 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) |
Removes a userdata element.
| Parameter: | id (int) – The id of the userdata. |
|---|---|
| Return type: | bool |
| Returns: | Returns True if the userdata is removed. |