c4d.C4DAtom
¶
The base class of many other classes.
c4d.
C4DAtom
¶
C4DAtom.GetType()
C4DAtom.GetRealType()
C4DAtom.CheckType()
C4DAtom.IsInstanceOf()
C4DAtom.GetClassification()
- c4d.C4DAtom
C4DAtom.
__eq__
(
self
,
other
)
¶
C4DAtom.
__ne__
(
self
,
other
)
¶
Check if two different objects point to the same object.
Note
Does not compare if two different objects are equal.
| Return type: | bool |
|---|---|
| Returns: | True if the objects point to the same object, otherwise False . |
C4DAtom.
__call__
(
)
¶
Returns the atom if it is alive or None if the atom is dead. This is a convenient way to know if you can still use the object.
| Return type: | c4d.C4DAtom |
|---|---|
| Returns: | The atom if it is still alive, otherwise None . |
C4DAtom.
SetDirty
(
flags
)
¶
Sets the dirty checksum, the one returned by
GetDirty()
.
| Parameters: |
flags
(
int
) –
Flags:
|
|---|
C4DAtom.
GetDirty
(
flags
)
¶
Gets the dirty checksum for the object. This can be used to check if the object has been changed.
| Parameters: |
flags
(
int
) –
Flags:
|
||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Return type: | int | ||||||||||||||||||
| Returns: | The checksum. |
C4DAtom.
GetHDirty
(
mask
)
¶
New in version R19.
Returns the dirty count for the specified mask .
| Parameters: |
mask
(
int
) –
The dirty flags:
|
||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Return type: | int | ||||||||||||||||||||||||||
| Returns: | The dirty count. |
C4DAtom.
SetHDirty
(
mask
)
¶
New in version R19.
Sets the dirty flags for the specified mask .
| Parameters: |
mask
(
int
) –
The dirty flags:
|
|---|
C4DAtom.
IsAlive
(
)
¶
Even though a reference to an object still exists, the object might be freed by an user interaction. Normally not needed.
| Return type: | bool |
|---|---|
| Returns: | True if the object is still alive, otherwise False |
C4DAtom.
CheckType
(
id
)
¶
Checks if this atom is an instance of a base type.
| Parameters: | id ( int ) – The base type ID, for example Ocube . |
|---|---|
| Return type: | int |
| Returns: | True if the atom is an instance of the type id , otherwise False . |
C4DAtom.
IsInstanceOf
(
)
¶
New in version R16.021.
Checks if this atom is an instance of a base type.
| Parameters: | id ( int ) – The base type ID, for example Ocube . |
|---|---|
| Return type: | int |
| Returns: | True if the atom is an instance of the type id , otherwise False . |
C4DAtom.
GetType
(
)
¶
Get the type of the atom. This must be used to make sure that the derived object really is of the right type before trying to access its members.
| Return type: | int |
|---|---|
| Returns: | The type, for example Ocube . |
C4DAtom.
GetRealType
(
)
¶
New in version R15.037.
Get the real type of the atom. This is similar to
GetType()
, but for multinodes the ID of the last linked part is returned. E.g. XPresso nodes have the type
ID_GV_GROUPDATA
or
ID_GV_NODEDATA
. With
GetRealType()
you will get the ID of the operator as a return value.
| Return type: | int |
|---|---|
| Returns: | The real type, for example Ocube . |
C4DAtom.
GetClassification
(
)
¶
Returns the base type of the object, e.g. for all objects Obase , for all materials Mmat , for all tags Tbase etc.
| Return type: | int |
|---|---|
| Returns: | The base type. |
C4DAtom.
Message
(
type
[
,
data
]
)
¶
Sends a message to the atom only.
Note
Some notification messages are automatically passed along to branches: MSG_POINTS_CHANGED , MSG_POLYGONS_CHANGED and MSG_SEGMENTS_CHANGED . This is for convenience and historical reasons.
| Parameters: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Return type: |
bool |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Returns: |
Depends on the message type. |
C4DAtom.
MultiMessage
(
flags
,
type
[
,
data
]
)
¶
Sends a message to the atom and to its children, parents or branches, depending on flags .
| Parameters: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Return type: |
bool |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Returns: |
Depends on the message type . |
C4DAtom.
CopyTo
(
dst
,
flags
[
,
trn=None
]
)
¶
Copies all values from self to dst . The atoms must be of the same type!
| Parameters: |
|
||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Return type: |
bool |
||||||||||||||||||||||||||||||||||||
| Returns: |
True if the atom was copied. |
C4DAtom.
GetClone
(
[
flags=c4d.COPYFLAGS_0
,
trn=None
]
)
¶
Clones the object and returns the reference.
| Parameters: |
|
||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Return type: | |||||||||||||||||||||||||||||||||||||
| Returns: |
Minimum of type atom. |
C4DAtom.
Write
(
hf
)
¶
Writes the atom to a
HyperFile
.
Note
This is the function to use if you have opened the hyper file yourself and are writing the object manually. If writing within a plugin function where Cinema 4D has passed the hyper file you should use
WriteObject()
.
Note
The methods
Read()
,
Write()
,
ReadObject()
and
WriteObject()
are generally not recommended for plugins.
| Parameters: | hf ( c4d.storage.HyperFile ) – The hyperfile to write to. |
|---|---|
| Return type: | bool |
| Returns: | True if the atom was written, otherwise False . |
C4DAtom.
Read
(
hf
,
id
,
level
)
¶
Reads to this atom from a
HyperFile
, manually specifying ID and level.
Note
This is the function to use if you have opened the hyper file yourself and are reading the object separately. If reading within a plugin function where Cinema 4D has passed the hyper file you should use
ReadObject()
.
Note
The methods
Read()
,
Write()
,
ReadObject()
and
WriteObject()
are generally not recommended for plugins.
| Parameters: |
|
|---|---|
| Return type: |
bool |
| Returns: |
True if the atom was read, otherwise False . |
C4DAtom.
WriteObject
(
hf
)
¶
Writes this atom to a
HyperFile
, within another write operation.
Note
This is the function to use where Cinema 4D has passed the hyper file you should use, for example in a plugin hook. Otherwise you should use
Write()
.
Note
The methods
Read()
,
Write()
,
ReadObject()
and
WriteObject()
are generally not recommended for plugins.
| Parameters: | hf ( c4d.storage.HyperFile ) – The hyperfile to write to. |
|---|---|
| Return type: | bool |
| Returns: | True if the atom was written, otherwise False . |
C4DAtom.
ReadObject
(
hf
,
readheader
)
¶
Reads to this atom from a
HyperFile
within another read operation.
Note
This is the function to use where Cinema 4D has passed the hyper file you should use, for example in a plugin hook. Otherwise you should use
Read()
.
Note
The methods
Read()
,
Write()
,
ReadObject()
and
WriteObject()
are generally not recommended for plugins.
| Parameters: |
|
|---|---|
| Return type: |
bool |
| Returns: |
True if the atom was read, otherwise False . |
C4DAtom.
GetDescription
(
flags
)
¶
New in version R15.037.
Gets the description for this atom.
Warning
Every caller of
GetDescription()
gets a copy of the object’s description, including the Attribute Manager. The only way to customize the description is to override
NodeData.GetDDescription()
, which is not implemented in the Python API.
| Parameters: |
flags
(
int
) –
Flags:
|
||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Return type: | c4d.Description | ||||||||||||||
| Returns: | The atom’s description. |
C4DAtom.
GetParameter
(
id
,
flags
)
¶
New in version R16.021.
Gets a description parameter of this atom.
| Parameters: |
|
||||||||
|---|---|---|---|---|---|---|---|---|---|
| Return type: |
any |
||||||||
| Returns: |
The parameter data, or None if an error occured. |
C4DAtom.
SetParameter
(
id
,
data
,
flags
)
¶
New in version R16.021.
Sets a description parameter of this atom.
| Parameters: |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Return type: |
bool |
||||||||||||
| Returns: |
True if the parameter was set, otherwise False . |
C4DAtom.
FindUniqueID
(
appid
)
¶
New in version R16.021.
Checks for a specific unique application ID.
| Parameters: | appid ( int ) – A unique application ID, has to be registered at MAXON, at least it should be obtained from http://www.plugincafe.com |
|---|---|
| Return type: | c4d.storage.ByteSeq |
| Returns: | The unique application ID data, or None if it could not be found. |
C4DAtom.
AddUniqueID
(
appid
,
mem
)
¶
New in version R16.021.
Adds unique application ID to the object.
| Parameters: |
|
|---|---|
| Return type: |
bool |
| Returns: |
True if successful, otherwise False . |
C4DAtom.
GetUniqueIDCount
(
)
¶
New in version R16.021.
Retrieves the number of unique application IDs.
| Return type: | int |
|---|---|
| Returns: | The number of unique application IDs. |
C4DAtom.
GetUniqueIDIndex
(
idx
)
¶
New in version R16.050.
Gets the idx -th unique application ID data.
| Parameters: |
idx
(
int
) – The unique ID index:
0<=idx<
GetUniqueIDCount()
|
|---|---|
| Return type: |
tuple(int,
ByteSeq
)
|
| Returns: |
The unique application ID and its data. Used for instance to read the name of a software vendor.
None if it could not be found. |