c4d.BaseList2D
¶
The base class of many other classes.
c4d.
BaseList2D
¶
BaseList2D.SetBit()
BaseList2D.GetBit()
BaseList2D.DelBit()
BaseList2D.ToggleBit()
BaseList2D.GetAllBits()
BaseList2D.SetAllBits()
BaseList2D.KeyframeSelectionContent()
BaseList2D.ClearKeyframeSelection()
BaseList2D.FindKeyframeSelection()
BaseList2D.SetKeyframeSelection()
BaseList2D.GetLayerData()
BaseList2D.SetLayerData()
BaseList2D.GetLayerObject()
BaseList2D.SetLayerObject()
BaseList2D.GetCTrackRoot()
BaseList2D.GetFirstCTrack()
BaseList2D.GetCTracks()
BaseList2D.FindCTrack()
BaseList2D.InsertTrackSorted()
BaseList2D.AddUserData()
BaseList2D.RemoveUserData()
BaseList2D.GetUserDataContainer()
BaseList2D.SetUserDataContainer()
BaseList2D.AddEventNotification()
BaseList2D.RemoveEventNotification()
BaseList2D.FindEventNotification()
BaseList2D.GetNLARoot()
BaseList2D.Scale()
BaseList2D.Edit()
BaseList2D.GetInfo()
BaseList2D.GetIcon()
BaseList2D.TransferGoal()
BaseList2D.GetMain()
BaseList2D.GetVisibility()
BaseList2D.KillTag()
BaseList2D.GetDocument()
BaseList2D.GetHighlightHandle()
c4d.GeListNode
c4d.BaseView
c4d.BaseMaterial
c4d.BaseObject
c4d.BaseTag
c4d.CCurve
c4d.CTrack
c4d.BaseShader
c4d.documents.BaseDocument
c4d.documents.RenderData
c4d.documents.LayerObject
c4d.documents.BaseVideoPost
c4d.modules.bodypaint.PaintBitmap
c4d.modules.graphview.GvNodeMaster
c4d.modules.graphview.GvNode
c4d.modules.thinkingparticles.TP_MasterSystem
c4d.modules.thinkingparticles.TP_PGroup
c4d.plugins.BasePlugin
c4d.modules.sculpting.SculptLayerData
c4d.modules.takesystem.BaseOverride
c4d.modules.takesystem.BaseOverrideGroup
c4d.modules.takesystem.BaseTake
BaseList2D.
__init__
(
type
)
¶
Parameters: | type ( int ) – The id of the object, e.g: ( Ocube ). See also: Descriptions in Cinema 4D . |
---|---|
Return type: | c4d.BaseList2D |
Returns: | The new object. |
BaseList2D.
__str__
(
)
¶
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.
GetCTrackRoot
(
)
¶
Returns the track root of the object. To get the tracks of an object use
GetCTracks()
instead.
Return type: | c4d.GeListHead |
---|---|
Returns: |
The track root if there is one, otherwise
None
.
Changed in version R19:
The function now returns a
|
BaseList2D.
GetFirstCTrack
(
)
¶
Returns the first CTrack of the object.
Return type: | c4d.CTrack |
---|---|
Returns: | The 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.
FindCTrack
(
id
)
¶
Find the track for the specified description id .
Parameters: | id ( c4d.DescID ) – The description ID to check. |
---|---|
Return type: | c4d.CTrack |
Returns: | The track found, or None if there was no match. |
BaseList2D.
InsertTrackSorted
(
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.
GetMain
(
)
¶
Goes up the next level, e.g. from tag to object or Xpresso node to tag, or object to document, etc.
Return type: | c4d.BaseList2D |
---|---|
Returns: | The main object of this object or None . |
BaseList2D.
SetBit
(
mask
)
¶
Each object contains a number of flags. See
GetAllBits()
for the flags.
Parameters: | mask ( int ) – Bit mask of the flags. |
---|
BaseList2D.
GetBit
(
mask
)
¶
Each object contains a number of flags. See
GetAllBits()
for the flags.
Parameters: | mask ( int ) – Bit mask of the flags. |
---|---|
Return type: | bool: |
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 bits to 0. See
GetAllBits()
for the flags.
Parameters: | mask ( int ) – Bit mask of the flags. |
---|
BaseList2D.
ToggleBit
(
mask
)
¶
Toggles the state of the object flags denoted by the mask. See
GetAllBits()
for the flags.
Parameters: | mask ( int ) – Bit mask of the flags. |
---|
BaseList2D.
GetAllBits
(
)
¶
Returns all of the object’s bits.
Return type: | int | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns: |
The flags:
|
BaseList2D.
SetAllBits
(
mask
)
¶
Set the object’s bits. See
GetAllBits()
to see which bits you can set.
Parameters: | mask ( int ) – Bit mask of the flags. |
---|
BaseList2D.
GetIcon
(
)
¶
Returns the original bitmap pattern.
Warning
Please, never edit the returned bitmap - read only.
An example:
icon = obj.GetIcon() print icon["bmp"], icon["x"], icon["y"], icon["w"], icon["h"]
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.
GetFirstShader
(
)
¶
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:
InsertShader()
.
tag.InsertShader()
.
Return type: | c4d.BaseList2D |
---|---|
Returns: | The first shader of the object, or None if there is no shader. |
BaseList2D.
InsertShader
(
shader
[
,
pred=None
]
)
¶
Inserts a shader in the object’s shader list:
import c4d mat = doc.GetFirstMaterial() if mat is None: return False shd = c4d.BaseList2D(c4d.Xbitmap) mat[c4d.MATERIAL_COLOR_SHADER] = shd mat.InsertShader(shd) mat.Message(c4d.MSG_UPDATE) mat.Update(True, True) c4d.EventAdd()
Parameters: |
|
---|
BaseList2D.
GetLayerData
(
doc
[
,
rawdata=False
]
)
¶
Get the layer data for this object.
Parameters: |
|
---|---|
Return type: |
dict{
solo
: bool,
view
: bool,
render
: bool,
manager
: bool,
locked
: bool,
generators
: bool,
expressions
: bool,
animation
: bool,
color
:
|
BaseList2D.
SetLayerData
(
doc
,
data
)
¶
Set the layer data for this object.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if successful, otherwise False . |
BaseList2D.
GetLayerObject
(
doc
)
¶
Get the layer of this object.
Parameters: | doc ( c4d.documents.BaseDocument ) – The document. |
---|---|
Return type: | c4d.documents.LayerObject |
Returns: | The layer. |
BaseList2D.
SetLayerObject
(
layer
)
¶
Set the layer of this object.
Parameters: |
layer
(
c4d.documents.LayerObject
) –
The new layer. Changed in version R18.020: Can be None . |
---|---|
Return type: | bool |
Returns: | True if successful, otherwise False . |
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.
KeyframeSelectionContent
(
)
¶
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.
ClearKeyframeSelection
(
)
¶
Clears the current keyframe selection.
BaseList2D.
FindKeyframeSelection
(
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.
SetKeyframeSelection
(
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.
TransferGoal
(
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: |
|
---|
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 .
Parameters: | 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: |
|
---|
BaseList2D.
GetDataInstance
(
)
¶
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
__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: |
|
---|---|
Return type: | |
Returns: |
The original container reference. |
BaseList2D.
GetData
(
)
¶
Returns a copy of the object’s container.
Return type: | c4d.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 behavior with add .
Note
Do not forget to send a
C4DAtom.Message()
if you change any settings.
Parameters: |
|
---|---|
Return type: | |
Returns: |
The container reference. |
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.
Parameters: | name ( str ) – Set the name. |
---|
BaseList2D.
GetName
(
)
¶
Returns the name of the object.
Return type: | str |
---|---|
Returns: | The name. |
BaseList2D.
GetNLARoot
(
)
¶
Private.
BaseList2D.
Scale
(
scale
)
¶
Scale the object.
Parameters: | scale ( float ) – The size. |
---|
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: | c4d.documents.BaseDocument |
---|---|
Returns: | The document if the object is stored in a document, otherwise returns None . |
BaseList2D.
AddUserData
(
datadescription
)
¶
Allocates a new user data and return its ID. Use
c4d.GetCustomDataTypeDefault()
to create a default container for user data:
import c4d def AddLongDataType(obj): if obj is None: return bc = c4d.GetCustomDataTypeDefault(c4d.DTYPE_LONG) # Create default container bc[c4d.DESC_NAME] = "Test" # Rename the entry element = obj.AddUserData(bc) # Add userdata container obj[element] = 30 # Assign a value c4d.EventAdd() # Update
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. |
BaseList2D.
RemoveUserData
(
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:
obj.RemoveUserData(1)#removes the first user data obj.RemoveUserData([c4d.ID_USERDATA, 1]) obj.RemoveUserData(c4d.DescID(c4d.DescLevel(c4d.ID_USERDATA), c4d.DescLevel(1)))
Parameters: |
id
(int, list or
DescID
) – The id of the userdata.
|
---|---|
Return type: | bool |
Returns: | True if the userdata is removed, otherwise False . |
BaseList2D.
GetUserDataContainer
(
)
¶
Browse through the user data container sequence:
for id, bc in op.GetUserDataContainer(): print id, bc
Return type: |
list[(
DescID
,
BaseContainer
),]
|
---|---|
Returns: |
A list of tuples with the
Description
ID and container for each user data.
|
BaseList2D.
SetUserDataContainer
(
descid
,
datadescription
)
¶
Insert a new user data with the specified ID.
Parameters: |
|
---|---|
Return type: |
True if the user data was inserted, otherwise False . |
BaseList2D.
AddEventNotification
(
bl
,
eventid
,
flags
,
data
)
¶
New in version R16.021.
Private.
BaseList2D.
RemoveEventNotification
(
doc
,
bl
,
eventid
)
¶
New in version R16.021.
Private.
BaseList2D.
FindEventNotification
(
doc
,
bl
,
eventid
)
¶
New in version R16.021.
Private.
BaseList2D.
GetHighlightHandle
(
bd
)
¶
Checks if a highlight handle has been hit, by returning the ID previously returned by
ObjectData.DetectHandle()
. The handle can then be drawn in the highlight mode.
Parameters: | bd ( c4d.BaseDraw ) – A base draw. |
---|---|
Return type: | int |
Returns: | The Handle ID. |