-
首页
-
C4D R23.110 C++ SDK
BaseObject Class Reference
#include <c4d_baseobject.h>
详细描述
All objects in
Cinema 4D
are derived from the
BaseObject
class.
Contains methods for the object's position, scale and rotation, as well as for accessing the sub-items of the object (e.g. tags and animation tracks).
-
注意
-
Has to be created with
Alloc()
and destroyed with
Free()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
Tag
|
BaseTag
*
|
GetFirstTag
(void)
|
BaseTag
*
|
GetLastTag
(void)
|
BaseTag
*
|
GetTag
(
Int32
type,
Int32
nr=0)
|
const
maxon::BaseArray
<
BaseTag
* > *
|
GetTagsOfType
(
Int32
type) const
|
const
maxon::BaseArray
<
BaseTag
* > *
|
GetTagsWithFlags
(
Int32
flags) const
|
const void *
|
GetTagDataR
(
Int32
type,
Int32
nr=0) const
|
void *
|
GetTagDataW
(
Int32
type,
Int32
nr=0)
|
Int32
|
GetTagDataCount
(
Int32
type) const
|
BaseTag
*
|
MakeTag
(
Int32
type,
BaseTag
*pred=nullptr)
|
VariableTag
*
|
MakeVariableTag
(
Int32
type,
Int32
count,
BaseTag
*pred=nullptr)
|
void
|
InsertTag
(
BaseTag
*tp,
BaseTag
*pred=nullptr)
|
void
|
KillTag
(
Int32
type,
Int32
nr=0)
|
Bool
|
CopyTagsTo
(
BaseObject
*dest,
Int32
visible,
Int32
variable,
Int32
hierarchical,
AliasTrans
*trans)
|
Hierarchy Clone
|
BaseObject
*
|
GetAndCheckHierarchyClone
(
HierarchyHelp
*hh,
BaseObject
*op,
HIERARCHYCLONEFLAGS
flags,
Bool
*dirty,
AliasTrans
*trans,
Bool
allchildren)
|
BaseObject
*
|
GetHierarchyClone
(
HierarchyHelp
*hh,
BaseObject
*op,
HIERARCHYCLONEFLAGS
flags,
Bool
*dirty,
AliasTrans
*trans)
|
BaseObject
*
|
GetHierarchyClone
(
HierarchyHelp
*hh,
BaseObject
*op,
HIERARCHYCLONEFLAGS
flags,
Bool
*dirty,
AliasTrans
*trans,
DIRTYFLAGS
dirtyflags)
|
Synchronized Rotation Mode
|
void
|
SetQuaternionRotationMode
(
Bool
active,
Bool
bUndo)
|
Bool
|
IsQuaternionRotationMode
(void)
|
Bool
|
SynchronizeVectorTrackKeys
(
Int32
vectorTrackID,
Bool
bUndo,
BaseTime
startRange=
BaseTime
(-108000, 1),
BaseTime
endRange=
BaseTime
(108000, 1))
|
Bool
|
FindBestEulerAngle
(
Int32
rotationTrackID,
Bool
bAdjustTangent,
Bool
bUndo,
BaseTime
startRange=
BaseTime
(-108000, 1),
BaseTime
endRange=
BaseTime
(108000, 1))
|
Bool
|
EvaluateSynchronizedRotation
(const
BaseTime
&time,
ANIMATEFLAGS
flags,
向量
*resultRotation=nullptr)
|
Additional Inherited Members
|
const
Char
*
|
GetViewportRenderId
(
VIEWPORT_RENDER_ID
typeId) const
|
BaseList2D
*
|
GetNext
()
|
BaseList2D
*
|
GetPred
()
|
void
|
SetBit
(
Int32
mask)
|
Bool
|
GetBit
(
Int32
mask) const
|
void
|
DelBit
(
Int32
mask)
|
void
|
ToggleBit
(
Int32
mask)
|
Int32
|
GetAllBits
() const
|
void
|
SetAllBits
(
Int32
bits)
|
void
|
SetBitEx
(
Int32
mask,
Int32
flags)
|
BaseContainer
|
GetData
()
|
void
|
SetData
(const
BaseContainer
&bc,
Bool
add=true)
|
const
BaseContainer
*
|
GetDataInstance
() const
|
BaseContainer
*
|
GetDataInstance
()
|
const
BaseContainer
&
|
GetDataInstanceRef
() const
|
BaseContainer
&
|
GetDataInstanceRef
()
|
String
|
GetName
() const
|
void
|
SetName
(const
maxon::String
&name)
|
String
|
GetBubbleHelp
()
|
Bool
|
TransferGoal
(
BaseList2D
*dst,
Bool
undolink)
|
Bool
|
TransferMarker
(
BaseList2D
*dst) const
|
Bool
|
比例
(
Float
scale)
|
Bool
|
编辑
()
|
void
|
GetIcon
(
IconData
*dat)
|
GeListHead
*
|
GetNLARoot
()
|
BaseList2D
*
|
AnimationLayerRemap
(
BaseObject
**layer=nullptr)
|
String
|
GetTypeName
()
|
BaseList2D
*
|
GetMain
() const
|
void
|
InsertTrackSorted
(
CTrack
*track)
|
Bool
|
AddEventNotification
(
BaseList2D
*bl,
NOTIFY_EVENT
eventid,
NOTIFY_EVENT_FLAG
flags, const
BaseContainer
*data)
|
Bool
|
RemoveEventNotification
(
BaseDocument
*doc,
BaseList2D
*bl,
NOTIFY_EVENT
eventid)
|
Bool
|
FindEventNotification
(
BaseDocument
*doc,
BaseList2D
*bl,
NOTIFY_EVENT
eventid)
|
Bool
|
SetDescIDState
(const
DescID
&id,
DESCIDSTATE
descidstate)
|
DESCIDSTATE
|
GetDescIDState
(const
DescID
&id,
Bool
tolerant) const
|
GeListHead
*
|
GetOverrideRoot
()
|
BaseOverride
*
|
GetFirstOverride
()
|
GeListHead
*
|
GetShaderRepositoryRoot
()
|
GeListHead
*
|
GetHiddenShaderRoot
()
|
maxon::NimbusInterface *
|
GetNimbusRef
(const
maxon::Id
&spaceId) const
|
maxon::Result
< maxon::NimbusInterface * >
|
GetOrCreateNimbusRef
(const
maxon::Id
&spaceId)
|
void
|
RemoveNimbusRef
(const
maxon::Id
&spaceId)
|
maxon::Result
<
maxon::HashMap
<
maxon::Id
,
maxon::ForwardRef
< maxon::NimbusRef > > >
|
GetAllNimbusRefs
() const
|
Bool
|
IsNodeBased
() const
|
void
|
GetMarkerStampEx
(
UInt32
*l1,
UInt32
*l2)
|
const
GeMarker
&
|
GetMarker
() const
|
void
|
SetMarker
(const
GeMarker
&m)
|
Bool
|
AddUniqueID
(
Int32
appid, const
Char
*const mem,
Int
bytes)
|
Bool
|
FindUniqueID
(
Int32
appid, const
Char
*&mem,
Int
&bytes) const
|
Int32
|
GetUniqueIDCount
() const
|
Bool
|
GetUniqueIDIndex
(
Int32
idx,
Int32
&id, const
Char
*&mem,
Int
&bytes) const
|
Bool
|
SetAnimatedParameter
(
CTrack
*track, const
DescID
&id, const
GeData
&t_data1, const
GeData
&t_data2,
Float
mix,
DESCFLAGS_SET
flags)
|
Bool
|
GetAnimatedParameter
(const
DescID
&id,
GeData
&t_data1,
GeData
&t_data2,
Float
&mix,
DESCFLAGS_GET
flags)
|
BaseShader
*
|
GetFirstShader
() const
|
void
|
InsertShader
(
BaseShader
*shader,
BaseShader
*pred=nullptr)
|
void
|
ClearKeyframeSelection
()
|
Bool
|
FindKeyframeSelection
(const
DescID
&id)
|
Bool
|
SetKeyframeSelection
(const
DescID
&id,
Bool
selection)
|
Bool
|
KeyframeSelectionContent
()
|
LayerObject
*
|
GetLayerObject
(
BaseDocument
*doc)
|
Bool
|
SetLayerObject
(
LayerObject
*layer)
|
const
LayerData
*
|
GetLayerData
(
BaseDocument
*doc,
Bool
rawdata=false)
|
Bool
|
SetLayerData
(
BaseDocument
*doc, const
LayerData
&data)
|
GeListHead
*
|
GetCTrackRoot
()
|
CTrack
*
|
GetFirstCTrack
()
|
CTrack
*
|
FindCTrack
(const
DescID
&id)
|
GeListNode
*
|
GetNext
()
|
GeListNode
*
|
GetPred
()
|
GeListNode
*
|
GetDown
()
|
GeListNode
*
|
GetUp
()
|
GeListNode
*
|
GetDownLast
()
|
void
|
InsertBefore
(
GeListNode
*bl)
|
void
|
InsertAfter
(
GeListNode
*bl)
|
void
|
InsertUnder
(
GeListNode
*bl)
|
void
|
InsertUnderLast
(
GeListNode
*bl)
|
void
|
移除
()
|
GeListHead
*
|
GetListHead
()
|
Int32
|
GetNodeID
(
Int32
index=0) const
|
template<typename CAST >
|
const CAST *
|
GetNodeData
(
Int32
index=0) const
|
template<typename CAST >
|
CAST *
|
GetNodeData
(
Int32
index=0)
|
void
|
SetCustomData
(
GeListNode
*node)
|
GeListNode
*
|
GetCustomData
()
|
BaseDocument
*
|
GetDocument
()
|
Int32
|
GetBranchInfo
(
BranchInfo
*info,
Int32
max,
GETBRANCHINFO
flags)
|
Bool
|
IsDocumentRelated
()
|
Int32
|
GetInfo
()
|
Bool
|
GetNBit
(
NBIT
bit) const
|
UInt32
|
GetNBitMask
(
Int32
index) const
|
Bool
|
ChangeNBit
(
NBIT
bit,
NBITCONTROL
bitmode)
|
Int32
|
GetType
() const
|
Int32
|
GetRealType
() const
|
Int32
|
GetDiskType
() const
|
Bool
|
IsInstanceOf
(
Int32
id) const
|
Int32
|
GetClassification
() const
|
Bool
|
消息
(
Int32
type, void *data=nullptr)
|
Bool
|
MultiMessage
(
MULTIMSG_ROUTE
flags,
Int32
type, void *data)
|
C4DAtom
*
|
GetClone
(
COPYFLAGS
flags,
AliasTrans
*trn)
|
Bool
|
CopyTo
(
C4DAtom
*dst,
COPYFLAGS
flags,
AliasTrans
*trn)
|
Bool
|
读取
(
HyperFile
*hf,
Int32
id,
Int32
level)
|
Bool
|
Write
(
HyperFile
*hf)
|
Bool
|
ReadObject
(
HyperFile
*hf,
Bool
readheader)
|
Bool
|
WriteObject
(
HyperFile
*hf)
|
Bool
|
GetDescription
(
描述
*description,
DESCFLAGS_DESC
flags)
|
Bool
|
GetParameter
(const
DescID
&id,
GeData
&t_data,
DESCFLAGS_GET
flags)
|
Bool
|
SetParameter
(const
DescID
&id, const
GeData
&t_data,
DESCFLAGS_SET
flags)
|
DynamicDescription
*
|
GetDynamicDescription
()
|
Bool
|
GetEnabling
(const
DescID
&id, const
GeData
&t_data,
DESCFLAGS_ENABLE
flags, const
BaseContainer
*itemdesc)
|
Bool
|
TranslateDescID
(const
DescID
&id,
DescID
&res_id,
C4DAtom
*&res_at)
|
UInt32
|
GetDirty
(
DIRTYFLAGS
flags) const
|
void
|
SetDirty
(
DIRTYFLAGS
flags)
|
UInt32
|
GetHDirty
(
HDIRTYFLAGS
mask) const
|
void
|
SetHDirty
(
HDIRTYFLAGS
mask)
|
static
BaseList2D
*
|
Alloc
(
Int32
type)
|
static void
|
Free
(
BaseList2D
*&bl)
|
static const
Int32
|
SETBIT_FLAG_NODIRTY
|
static const
Int32
|
SETBIT_FLAG_REMOVE
|
构造函数 & 析构函数文档编制
◆
BaseObject()
◆
~BaseObject()
成员函数文档编制
◆
Alloc()
Allocates a base object. Destroy the allocated base object with
Free()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
-
参数
-
-
返回
-
The allocated base object, or
nullptr
if the allocation failed.
◆
Free()
Destructs base objects allocated with
Alloc()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
-
参数
-
[in,out]
|
bl
|
The base object to destruct. If the pointer is
nullptr
nothing happens. The pointer is assigned
nullptr
afterwards.
|
◆
GetNext()
Gets the next object in the list. Convenience version of
GeListNode::GetNext()
.
-
返回
-
The next object, or
nullptr
if there is none.
Cinema 4D
owns the pointed object.
◆
GetPred()
Gets the previous object in the list. Convenience version of
GeListNode::GetPred()
.
-
返回
-
The previous base object, or
nullptr
if there is none.
Cinema 4D
owns the pointed object.
◆
GetUp()
Gets the parent object of the list node. Convenience version of
GeListNode::GetUp()
.
-
返回
-
The parent object, or
nullptr
if there is none.
Cinema 4D
owns the pointed object.
◆
GetDown()
Gets the first child object of the list node. Convenience version of
GeListNode::GetDown()
.
-
返回
-
The first child object, or
nullptr
if there is none.
Cinema 4D
owns the pointed object.
◆
GetDownLast()
Gets the last child base object of the list node. Convenience version of
GeListNode::GetDownLast()
.
-
返回
-
The last child object, or
nullptr
if there is none.
Cinema 4D
owns the pointed object.
◆
GetAbsPos()
Gets the absolute position of the object.
These are the absolute local coordinates within the parent object.
If the object has no parent then these are world coordinates.
-
另请参阅
-
The
BaseObject Manual
-
返回
-
The object's absolute position.
◆
SetAbsPos()
void SetAbsPos
|
(
|
const
向量
&
|
v
|
)
|
|
Sets the absolute local position of the object within its parent.
These are the absolute local coordinates within the parent object.
If the object has no parent then these are world coordinates.
-
另请参阅
-
The
BaseObject Manual
-
参数
-
[in]
|
v
|
The object's absolute position to set.
|
◆
GetAbsScale()
Gets the absolute scale of the object.
This is relative to the object's parent if it has one.
-
另请参阅
-
The
BaseObject Manual
-
返回
-
The object's absolute scale.
◆
SetAbsScale()
void SetAbsScale
|
(
|
const
向量
&
|
v
|
)
|
|
Sets the absolute scale of the object.
This is relative to the object's parent if it has one.
-
另请参阅
-
The
BaseObject Manual
-
参数
-
[in]
|
v
|
The object's absolute scale to set.
|
◆
GetAbsRot()
Gets the absolute HPB rotation of the object.
This is relative to the object's parent if it has one.
-
另请参阅
-
The
BaseObject Manual
-
返回
-
The object's absolute HPB rotation.
◆
SetAbsRot()
void SetAbsRot
|
(
|
const
向量
&
|
v
|
)
|
|
Sets the absolute HPB rotation of the object.
This is relative to the object's parent if it has one.
-
另请参阅
-
The
BaseObject Manual
-
参数
-
[in]
|
v
|
The object's absolute HPB rotation to set.
|
◆
GetFrozenPos()
向量
GetFrozenPos
|
(
|
|
)
|
const
|
Gets the frozen position of the object.
-
另请参阅
-
The
BaseObject Manual
-
返回
-
The object's frozen position.
◆
SetFrozenPos()
void SetFrozenPos
|
(
|
const
向量
&
|
v
|
)
|
|
Sets the frozen position of the object.
-
另请参阅
-
The
BaseObject Manual
-
参数
-
[in]
|
v
|
The object's frozen position to set.
|
◆
GetFrozenScale()
向量
GetFrozenScale
|
(
|
|
)
|
const
|
Gets the frozen scale of the object.
-
另请参阅
-
The
BaseObject Manual
-
返回
-
The object's frozen scale.
◆
SetFrozenScale()
void SetFrozenScale
|
(
|
const
向量
&
|
v
|
)
|
|
Sets the frozen scale of the object.
-
另请参阅
-
The
BaseObject Manual
-
参数
-
[in]
|
v
|
The object's frozen scale to set.
|
◆
GetFrozenRot()
向量
GetFrozenRot
|
(
|
|
)
|
const
|
Gets the frozen HPB rotation of the object.
-
另请参阅
-
The
BaseObject Manual
-
返回
-
The object's frozen HPB rotation.
◆
SetFrozenRot()
void SetFrozenRot
|
(
|
const
向量
&
|
v
|
)
|
|
Sets the frozen HPB rotation of the object.
-
另请参阅
-
The
BaseObject Manual
-
参数
-
[in]
|
v
|
The object's frozen HPB rotation to set.
|
◆
GetRelPos()
Get the relative position of the object.
-
另请参阅
-
The
BaseObject Manual
-
返回
-
The object's relative position.
◆
SetRelPos()
void SetRelPos
|
(
|
const
向量
&
|
v
|
)
|
|
Sets the relative position of the object.
-
另请参阅
-
The
BaseObject Manual
-
参数
-
[in]
|
v
|
The object's relative position to set.
|
◆
GetRelScale()
Gets the relative scale of the object.
-
另请参阅
-
The
BaseObject Manual
-
返回
-
The object's relative scale.
◆
SetRelScale()
void SetRelScale
|
(
|
const
向量
&
|
v
|
)
|
|
Sets the relative scale of the object.
-
另请参阅
-
The
BaseObject Manual
-
参数
-
[in]
|
v
|
The object's relative scale to set.
|
◆
GetRelRot()
Gets the relative HPB rotation of the object.
-
另请参阅
-
The
BaseObject Manual
-
返回
-
The object's relative scale.
◆
SetRelRot()
void SetRelRot
|
(
|
const
向量
&
|
v
|
)
|
|
Sets the relative HPB rotation of the object.
-
另请参阅
-
The
BaseObject Manual
-
参数
-
[in]
|
v
|
The object's relative rotation to set.
|
◆
GetMl()
const
矩阵
& GetMl
|
(
|
void
|
|
)
|
const
|
Gets the local matrix representing the object's position, scale and rotation.
-
返回
-
The object's local matrix.
◆
SetMl()
void SetMl
|
(
|
const
矩阵
&
|
m
|
)
|
|
Sets the local matrix representing the object's position, scale and rotation.
-
参数
-
[in]
|
m
|
The object's local matrix to set.
|
◆
GetFrozenMln()
矩阵
GetFrozenMln
|
(
|
|
)
|
const
|
Gets the frozen and normalized matrix of the object.
-
另请参阅
-
The
BaseObject Manual
-
返回
-
The object's frozen and normalized matrix.
◆
GetRelMln()
Gets the relative and normalized matrix of the object.
-
另请参阅
-
The
BaseObject Manual
-
返回
-
The object's relative and normalized matrix.
◆
GetRelMl()
Gets the relative matrix of the object.
-
另请参阅
-
The
BaseObject Manual
-
返回
-
The object's relative matrix.
◆
SetRelMl()
void SetRelMl
|
(
|
const
矩阵
&
|
m
|
)
|
|
Sets the relative matrix of the object.
-
另请参阅
-
The
BaseObject Manual
-
参数
-
[in]
|
m
|
The object's relative matrix to set.
|
◆
GetMg()
Gets the world (global) matrix representing the object's position, scale and rotation.
-
警告
-
Only valid if the object is attached to a document. Virtual objects in caches and deform caches are not attached to a document, so this cannot be used for those objects.
-
返回
-
The object's world matrix.
◆
SetMg()
void SetMg
|
(
|
const
矩阵
&
|
m
|
)
|
|
Sets the world (global) matrix representing the object's position, scale and rotation.
-
参数
-
[in]
|
m
|
The object's world matrix to set.
|
◆
GetMln()
Gets the local normalized matrix representing the object's position, scale and rotation.
-
返回
-
The object's normalized local matrix.
◆
GetMgn()
Gets the world (global) normalized matrix representing the object's position, scale and rotation.
-
返回
-
The object's normalized world matrix.
◆
GetUpMg()
Gets the world (global) matrix of the parent object representing the parent's position, scale and rotation.
If the object has no parent object then the method returns a unit matrix.
-
返回
-
The parent object's world matrix.
◆
CopyMatrixTo()
Copies the object's matrix to another object.
-
参数
-
[in,out]
|
dst
|
The destination object to copy the matrix to.
|
◆
GetMp()
Gets the object's bounding box center in local space.
-
返回
-
The bounding box center.
◆
GetRad()
Gets the object's bounding box radius (x/y/z).
-
注意
-
Works for all objects and is faster than manually finding the bounds of even polygon objects, because the radius is internally cached.
-
返回
-
The object's bounding box radius.
◆
GetEditorMode()
Int32
GetEditorMode
|
(
|
void
|
|
)
|
const
|
Gets the mode of the editor dot for the object.
-
返回
-
The editor mode:
MODE
◆
GetEditorModeH()
Int32
GetEditorModeH
|
(
|
void
|
|
)
|
const
|
Gets the mode of the editor dot for the object.
-
返回
-
The editor mode:
MODE
◆
SetEditorMode()
void SetEditorMode
|
(
|
Int32
|
mode
|
)
|
|
Sets the mode for of editor dot for the object.
-
参数
-
[in]
|
mode
|
The editor mode to set:
MODE
|
◆
GetRenderMode()
Int32
GetRenderMode
|
(
|
void
|
|
)
|
const
|
Gets the mode of the render dot for the object.
-
返回
-
The render mode:
MODE
◆
GetRenderModeH()
Int32
GetRenderModeH
|
(
|
void
|
|
)
|
const
|
Gets the mode of the render dot for the object.
-
返回
-
The render mode:
MODE
◆
SetRenderMode()
void SetRenderMode
|
(
|
Int32
|
mode
|
)
|
|
Sets the mode of the render dot for the object.
-
参数
-
[in]
|
mode
|
The render mode to set:
MODE
|
◆
GetDeformMode()
Bool
GetDeformMode
|
(
|
void
|
|
)
|
const
|
Gets the enabled mode of the deformation/generator tick.
-
返回
-
true
if the deformer/generator is enabled, otherwise
false
.
◆
SetDeformMode()
void SetDeformMode
|
(
|
Bool
|
mode
|
)
|
|
Sets the enabled mode of the deformation/generator tick.
-
参数
-
[in]
|
mode
|
true
to enable the generator/deformer object, otherwise
false
.
|
◆
GetRealDeformMode()
Int32
GetRealDeformMode
|
(
|
void
|
|
)
|
const
|
Gets the real deform mode (MODE_ON, MODE_OFF, MODE_UNKNOWN).
-
返回
-
The real deform mode.
◆
SetRealDeformMode()
void SetRealDeformMode
|
(
|
Int32
|
mode
|
)
|
|
Sets the real deform mode (MODE_ON, MODE_OFF, MODE_UNKNOWN).
-
参数
-
[in]
|
mode
|
MODE_ON, MODE_OFF or MODE_UNKNOWN.
|
◆
GetUniqueIP()
Int32
GetUniqueIP
|
(
|
void
|
|
)
|
|
Gets the IP number for the object.
GetUniqueIP()
and
SetUniqueIP()
allow
Cinema 4D
to identify and track objects between different frames (which is necessary for stuff like object motion blur).
In case of a static generator that is easy: for every frame there is exactly the same structure.
For a particle system however that is different: e.g. there could always be 3 objects (particles), but some might be the same, some might be new ones.
To allow
Cinema 4D
to track that stuff an IP-like system is used: each object can carry a unique Int32 number and
Cinema 4D
creates full paths from it, e.g.
5.7.102.43.65.2
This is done 100% internally.
Only generator objects that have variable output or generator objects that use
GetHierarchyClone()
need to program some extra lines.
Such objects need to set the bit
OBJECT_UNIQUEENUMERATION
. Then it needs to assign unique Int32 values to all objects returned (except for the top-level object, which is handled by
Cinema 4D
).
范例:
A generator has 3 objects, but those objects appear and disappear during time. Say that
obj3
is child of
obj1
;
obj1
and
obj2
are children of
main
(which is returned).
obj2
and
obj3
might not be present:
main
obj1
[obj3]
[obj2]
The generator will call:
if
(obj1) obj->
SetUniqueIP
(1);
if
(obj2) obj->
SetUniqueIP
(2);
if
(obj3) obj->
SetUniqueIP
(3);
That is all that is needed.
Cinema 4D
will recognize which object matches another object at a different time.
若
GetHierarchyClone()
is called those objects already have a unique numeration. It is only needed to assign a unique value to the top level:
obj1 =
GetHierarchyClone
(...);
obj2 =
GetHierarchyClone
(...);
...
if (obj1) obj1->SetUniqueIP(1);
if
(obj2) obj2->SetUniqueIP(2);
-
返回
-
The IP number for the object.
◆
SetUniqueIP()
void SetUniqueIP
|
(
|
Int32
|
ip
|
)
|
|
Sets the IP number for the object.
-
另请参阅
-
GetUniqueIP()
-
参数
-
[in]
|
ip
|
The new IP number.
|
◆
GetFirstTag()
Gets the first tag associated with the object.
-
返回
-
The first tag, or
nullptr
if no tags available. The object owns the pointed tag.
◆
GetLastTag()
Gets the last tag associated with the object.
-
由于
-
R19
-
返回
-
The last tag, or
nullptr
if no tags available. The object owns the pointed tag.
◆
GetTag()
Gets a tag of a certain type associated with the object.
-
参数
-
[in]
|
type
|
The type of tag to fetch from the object:
Tag Types
|
[in]
|
nr
|
Optionally specify a starting tag index to begin the search.
If the requested number is not available then
nullptr
will be returned even if there is a tag of that type with a different index.
|
-
返回
-
The requested tag, or
nullptr
if no tags of the requested type are available. The object owns the pointed tag.
◆
GetTagsOfType()
Gets an array of tags of a certain type associated with the object.
-
参数
-
[in]
|
type
|
The type of tags to fetch from the object:
Tag Types
|
-
返回
-
An array of tags with the given type.
◆
GetTagsWithFlags()
Gets an array of tags with certain flags associated with the object.
-
参数
-
[in]
|
flags
|
The flags of tags to fetch from the object:
Tag Types
|
-
返回
-
An array of tags with the given type.
◆
GetTagDataR()
const void* GetTagDataR
|
(
|
Int32
|
type
,
|
|
|
Int32
|
nr
=
0
|
|
)
|
|
const
|
Gets a variable tag's readable data of a certain type associated with the object.
-
参数
-
[in]
|
type
|
The type of tag to fetch the data for:
VariableTag Types
|
[in]
|
nr
|
Optionally specify a starting tag index to begin the search.
|
-
返回
-
The variable tag's readable data,
nullptr
if this is not a variable tag or the tag could not be found. The tag owns the pointed data.
◆
GetTagDataW()
Gets a variable tag's writable data of a certain type associated with the object.
-
参数
-
[in]
|
type
|
The type of tag to fetch the data for:
VariableTag Types
|
[in]
|
nr
|
Optionally specify a starting tag index to begin the search.
|
-
返回
-
The variable tag's writable data,
nullptr
if this is not a variable tag or the tag could not be found. The tag owns the pointed data.
◆
GetTagDataCount()
Gets the variable tag data count.
-
参数
-
-
返回
-
The data count in the variable tag.
◆
MakeTag()
Creates and associates a tag with the object.
-
参数
-
[in]
|
type
|
The type of tag to create:
Tag Types
|
[in]
|
pred
|
The previous tag to insert the tag after, or
nullptr
if the tag should be inserted at the start of the tag list. The caller owns the pointed tag.
|
-
返回
-
The new tag, or
nullptr
if failed. The object owns the pointed tag.
◆
MakeVariableTag()
Creates and associates a variable tag with the object.
-
参数
-
[in]
|
type
|
The type of variable tag to create:
VariableTag Types
|
[in]
|
count
|
The data count.
|
[in]
|
pred
|
The previous tag to insert the tag after, or
nullptr
if the tag should be inserted at the start of the tag list. The caller owns the pointed tag.
|
-
返回
-
The new variable tag, or
nullptr
if failed. The object owns the pointed variable tag.
◆
InsertTag()
Inserts tag into the object's tag list.
-
警告
-
If the tag type was not registered with
TAG_MULTIPLE
, any existing old tag of same type will be implicitly removed. Any previous reference to the old tag will be invalid afterwards.
-
参数
-
[in]
|
tp
|
The tag to insert. The object takes over the ownership of the pointed tag.
|
[in]
|
pred
|
The previous tag to insert the tag after, or
nullptr
if the tag should be inserted at the start of the tag list. The caller owns the pointed tag.
|
◆
KillTag()
Removes a tag from the object and frees its resources.
-
参数
-
[in]
|
type
|
The type of tag to remove:
Tag Types
|
[in]
|
nr
|
Optionally specify a starting tag index to begin the search.
|
◆
CopyTagsTo()
Copies the object's tags to another object.
-
参数
-
[in]
|
dest
|
The destination object. The caller owns the pointed object.
|
[in]
|
visible
|
true
if the tag must be visible,
false
if it must not be visible or
NOTOK
if it can be either (if this property does not need to be checked).
|
[in]
|
variable
|
true
if the tag must be variable,
false
if it must not be variable or
NOTOK
if it can be either (if this property does not need to be checked).
|
[in]
|
hierarchical
|
true
if the tag must be hierarchical,
false
if it must not be hierarchical or
NOTOK
if it can be either (if this property does not need to be checked).
|
[in]
|
trans
|
An alias translator for the operation. Can be
nullptr
. The caller owns the pointed alias translator.
|
-
返回
-
true
if the tags were copied successfully, otherwise
false
.
◆
GetCache()
Gets the object from the previously built cache.
Situations can be quite complex in
Cinema 4D
. For instance
GetCache()
could return a list of objects.
For example the default Sweep Generator internally has some built-in caches for the sweep surface and for the caps.
The following helper routine can be used to make things easier. It browses through this rather complex hierarchy of objects and caches recursively:
void
DoRecursion(
BaseObject
*op)
{
BaseObject
* tp = op->
GetDeformCache
();
if
(tp)
{
DoRecursion(tp);
}
else
{
tp = op->
GetCache
(
nullptr
);
if
(tp)
{
DoRecursion(tp);
}
else
{
if
(!op->
GetBit
(
BIT_CONTROLOBJECT
))
{
if
(op->
IsInstanceOf
(
Opolygon
))
{
...
}
}
}
}
for
(tp = op->
GetDown
(); tp; tp=tp->
GetNext
())
{
DoRecursion(tp);
}
}
Remember:
Use the above routine only if the caches are already built. It is for instance not safe to use it in a
命令
plugin since the user can have stopped the scene redraw and the building of caches.
-
另请参阅
-
CheckCache()
GetDeformCache()
-
参数
-
[in]
|
hh
|
A hierarchy help, usually passed from the calling method parameters, for example
ObjectData::GetVirtualObjects()
. The caller owns the pointed hierarchy help.
Usually
nullptr
. Only for some special cases a hierarchy help must be passed.
|
-
返回
-
The object's previously built cache or
nullptr
. The object owns the pointed object's cache.
May return
nullptr
if the cache is not available or is not yet built.
-
另请参阅
-
层次结构
if a plugin needs access to pre-built caches.
◆
GetDeformCache()
Gets the previously built cache that has been deformed by an active deformer.
It is important to understand the concept how the deformer cache operates.
For each object in the hierarchy that generates a polygonal cache a deformer cache could also have been created by an active deformer object.
A simple example will help to see how this works:
Take the simple hierarchy shown above, the array generator object creates a virtual hierarchy in the cache, this can be retrieved using
GetCache()
.
This hierarchy is:
From each of the Cube objects a further cache is generated, this time polygonal:
From these the deformer object generates a deformed polygon cache:
So the final hierarchy is:
When a deformer becomes active every object/cache object gets a deform cache (if it was a polygonal object). The deformer cache is always polygonal and is only ever a single object.
Important:
The caches are always built after all plugins and expressions have been called.
If the virtual objects have to be accessed to obtain a polygonal based object it is generally advised to call
SendModelingCommand()
with MCOMMAND_CURRENTSTATETOOBJECT.
This will rebuild the cache for the passed object if needed, and then clone the polygonal objects.
Another possible solution is to use the
层次结构
class, this will give full access to all virtual objects, or can be used to just rebuild the internal caches.
But be aware that rebuilding the internal caches can cause serious overhead, be time consuming and if called too soon in the pipeline, the caches may need to be rebuilt afterwards.
-
返回
-
The objects previously built deformed cache or
nullptr
. The object owns the pointed object's cache.
May return
nullptr
if the cache is not available or is not yet built.
-
另请参阅
-
层次结构
if a plugin needs access to pre-built caches.
◆
GetIsoparm()
Gets the previously built isoparm representation of the object.
-
返回
-
The isoparm representation of the object or
nullptr
. The object owns the pointed isoparm.
May return
nullptr
if the isoparm is not available or is not yet built.
-
另请参阅
-
层次结构
if a plugin needs access to pre-built caches.
◆
SetIsoparm()
Sets the isoparm representation of the object.
-
警告
-
Must only be called from within
ObjectData::GetVirtualObjects()
of a generator object.
-
参数
-
[in]
|
l
|
The isoparm representation of the object to set. The object takes over the ownership of the pointed isoparm.
|
◆
GetCacheParent()
A cache/deform object has no
GetUp()
link. Instead this method can be called to detect the cache building parent.
-
返回
-
The cache parent or
nullptr
. The object owns the pointed cache parent.
◆
GetCacheTopParent()
A cache/deform object has no
GetUp()
link. Instead this method can be called to detect the top cache building parent.
-
返回
-
The top cache parent or
nullptr
. The object owns the pointed top cache parent.
◆
SetPhong()
Sets the phong smoothing for the object.
Deletes any existing Phong tag. If
on
被设为
true
it creates a new Phong tag.
-
参数
-
[in]
|
on
|
false
removes the Phong tag from the object.
true
creates a new Phong tag.
|
[in]
|
anglelimit
|
true
if
angle
should be used.
|
[in]
|
angle
|
The phong angle.
|
-
返回
-
true
if the phong smoothing was changed successfully, otherwise
false
.
◆
IsDirty()
Checks if the object has been changed since the last time the object was touched.
-
参数
-
-
返回
-
true
if the object is dirty, otherwise
false
.
◆
SetDirty()
Sets if any part of the object was changed.
-
参数
-
[in]
|
flags
|
The object part that was changed:
DIRTYFLAGS
|
◆
CheckCache()
Check if cache is built and if it matches the requirements (polygonized/isoparm, level of detail etc.)
-
注意
-
Must only be called from within
ObjectData::GetVirtualObjects()
of a generator object.
-
参数
-
-
返回
-
true
if the cache is dirty,
false
if it is valid.
◆
Touch()
Marks object to be used by generator. Automatically resets dirty values for use with
IsDirty()
.
◆
GetColorProperties()
Gets the object's color properties and fill
prop
.
-
参数
-
[in]
|
prop
|
Filled with the color properties. The caller owns the pointed color properties.
|
◆
SetColorProperties()
Sets the object's color properties from
prop
.
-
参数
-
[in]
|
prop
|
The color properties to set. The caller owns the pointed color properties.
|
◆
GetModelingAxis()
Gets the internal matrix for the modeling axis.
-
注意
-
To access the axis type, and other axis options, use the IDs defined in
ToolModelingAxis.h
.
-
参数
-
[in]
|
doc
|
The document for the operation. The caller owns the pointed document.
|
-
返回
-
The modeling axis.
◆
SetModelingAxis()
void SetModelingAxis
|
(
|
const
矩阵
&
|
m
|
)
|
|
Sets the internal matrix for the modeling axis.
-
注意
-
To access the axis type, and other axis options, use the IDs in ToolModelingAxis.res. Here is a code sample:
void
SetToolData(
BaseDocument
*doc,
Int32
pluginid,
Int32
dataid,
const
GeData
&dat)
{
BasePlugin
*plug =
static_cast<
BasePlugin
*
>
(
FindPlugin
(pluginid,
PLUGINTYPE::TOOL
));
if
(!plug)
return
;
plug->
SetParameter
(
DescID
(dataid), dat, 0);
}
SetToolData(doc,
ID_MODELING_LIVESELECTION
,
MDATA_AXIS_MODE
,
MDATA_AXIS_MODE_FREE
);
If the matrix is changed so that it does not fit the current mode the axis mode should be set to
MDATA_AXIS_MODE_FREE
.
-
参数
-
[in]
|
m
|
The new modeling axis to set.
|
◆
GetAndCheckHierarchyClone()
Checks and generates a clone of the child objects of a parent generator.
类似
GetHierarchyClone()
except that it checks if the hierarchy is dirty and if not it does not need to generate a new clone.
-
另请参阅
-
GetHierarchyClone()
-
参数
-
[in]
|
hh
|
Usually passed through from a calling method, for instance from
ObjectData::GetVirtualObjects()
. The caller owns the pointed hierarchy helper.
|
[in]
|
op
|
The object to start the clone from, usually the first child of the parent object. The caller owns the pointed object.
|
[in]
|
flags
|
The flags for the generation of the cloned chain. The values are:
HIERARCHYCLONEFLAGS
|
[in]
|
dirty
|
Assigned the state of any changes to the chain.
true
if some part of the child objects in the chain has changed, otherwise
false
.
|
[in]
|
trans
|
An alias translator for the operation. Can be
nullptr
. The caller owns the pointed alias translator.
|
[in]
|
allchildren
|
true
if all children should be used in the check.
|
-
返回
-
The cloned objects. The caller owns the pointed object.
◆
GetHierarchyClone()
[1/2]
Generates a clone of the child objects of a parent generator.
-
注意
-
The result given by
GetAndCheckHierarchyClone()
will be a chain of objects with various types.
Passing
HIERARCHYCLONEFLAGS::ASLINE
e.g. will force all splines to be converted, but not every object in the chain will be of type
Oline
; some objects like
PolygonObject
cannot be converted, also
Onull
.
-
参数
-
[in]
|
hh
|
Usually passed through from a calling method, for instance from
ObjectData::GetVirtualObjects()
. The caller owns the pointed hierarchy helper.
|
[in]
|
op
|
The object to start the clone from, usually the parent object itself. The caller owns the pointed object.
|
[in]
|
flags
|
The flags for the generation of the cloned chain. The values are:
HIERARCHYCLONEFLAGS
|
[in]
|
dirty
|
Has to be set to
nullptr
for the cloning to take place. Set to
true
if some part of the child objects in the chain has changed, or
false
if nothing has changed.
|
[in]
|
trans
|
An alias translator for the operation. Can be
nullptr
. The caller owns the pointed alias translator.
|
-
返回
-
The cloned object(s). The caller owns the pointed object.
◆
GetHierarchyClone()
[2/2]
Generates a clone of the child objects of a parent generator. This version accepts
dirtyflags
参数。
-
由于
-
R19
-
注意
-
The result given by
GetAndCheckHierarchyClone()
will be a chain of objects with various types.
Passing
HIERARCHYCLONEFLAGS::ASLINE
e.g. will force all splines to be converted, but not every object in the chain will be of type
Oline
; some objects like
PolygonObject
cannot be converted, also
Onull
.
-
参数
-
[in]
|
hh
|
Usually passed through from a calling method, for instance from
ObjectData::GetVirtualObjects()
. The caller owns the pointed hierarchy helper.
|
[in]
|
op
|
The object to start the clone from, usually the parent object itself. The caller owns the pointed object.
|
[in]
|
flags
|
The flags for the generation of the cloned chain. The values are:
HIERARCHYCLONEFLAGS
|
[in]
|
dirty
|
Has to be set to
nullptr
for the cloning to take place. Set to
true
if some part of the child objects in the chain has changed, or
false
if nothing has changed.
|
[in]
|
trans
|
An alias translator for the operation. Can be
nullptr
. The caller owns the pointed alias translator.
|
[in]
|
dirtyflags
|
The dirty flags stored within the dependence list.
|
-
返回
-
The cloned object(s). The caller owns the pointed object.
◆
NewDependenceList()
void NewDependenceList
|
(
|
void
|
|
)
|
|
Starts a new dependence list. Enables to keep track of changes made to any children.
◆
CompareDependenceList()
Bool
CompareDependenceList
|
(
|
void
|
|
)
|
|
Compares if anything in the dependence list has changed.
-
返回
-
true
if the dependence list has not changed, otherwise
false
.
◆
AddDependence()
[1/2]
Adds a child object to the dependence list.
Usually
op
is a child object used by a generator object.
-
参数
-
[in]
|
hh
|
Usually passed from a calling method, for example from
ObjectData::GetVirtualObjects()
. The caller owns the pointed hierarchy help.
|
[in]
|
op
|
The child object to add to the dependence list. Should be a child object used by the generator object. The caller owns the pointed object.
|
◆
AddDependence()
[2/2]
Adds a child object to the dependence list. This version accepts
dirtyflags
参数。
-
由于
-
R19
-
参数
-
[in]
|
hh
|
Usually passed from a calling method, for example from
ObjectData::GetVirtualObjects()
. The caller owns the pointed hierarchy help.
|
[in]
|
op
|
The child object to add to the dependence list. Should be a child object used by the generator object. The caller owns the pointed object.
|
[in]
|
dirtyflags
|
The dirty flags stored within the dependence list.
|
◆
TouchDependenceList()
void TouchDependenceList
|
(
|
void
|
|
)
|
|
Marks all the objects in the dependence list to be replaced by the generator.
◆
SetRotationOrder()
Sets the rotation order of the object.
-
参数
-
[in]
|
order
|
The rotation order to set for the object:
ROTATIONORDER
|
◆
GetRotationOrder()
Gets the rotation order of the object.
-
返回
-
The rotation order of the object:
ROTATIONORDER
◆
SetQuaternionRotationMode()
void SetQuaternionRotationMode
|
(
|
Bool
|
active
,
|
|
|
Bool
|
bUndo
|
|
)
|
|
|
Sets the Synchronized Rotation Mode of the object.
-
由于
-
R18
-
参数
-
[in]
|
active
|
Enable/Disable the Synchronized Rotation mode for the object.
|
[in]
|
bUndo
|
Add undo to value changed (need to manage start and end externally).
|
◆
IsQuaternionRotationMode()
Bool
IsQuaternionRotationMode
|
(
|
void
|
|
)
|
|
Checks if Object Rotation is interpolated in
Quaternion
Mode.
-
由于
-
R18
-
返回
-
true
if Rotation Interpolation is
Quaternion
, otherwise
false
.
◆
SynchronizeVectorTrackKeys()
Makes sure that the track Curves component are synchronized (keys on each component). If a component track is found, the other track component will be synchronized.
-
由于
-
R18
-
参数
-
[in]
|
vectorTrackID
|
ID of the Vector Track to synchronize.
|
[in]
|
bUndo
|
Add undo to value changed (need to manage start and end externally).
|
[in]
|
startRange
|
Optional start operation at given time.
|
[in]
|
endRange
|
Optional end operation at given time.
|
-
返回
-
true
if Track Synchronization was successful, otherwise
false
.
◆
FindBestEulerAngle()
Tries to find the best Euler Angle according to the previous key. The Object must have keys on each component.
-
由于
-
R18
-
参数
-
[in]
|
rotationTrackID
|
Rotation Track ID to manage (relative, global, absolute, frozen).
|
[in]
|
bAdjustTangent
|
Try to adjust the tangent with new value, if
false
auto is used.
|
[in]
|
bUndo
|
Add undo to value changed (need to manage start and end externally).
|
[in]
|
startRange
|
Optional start operation at given time.
|
[in]
|
endRange
|
Optional end operation at given time.
|
-
返回
-
true
if Rotation Synchronization was successful, otherwise
false
.
◆
EvaluateSynchronizedRotation()
Forces an evaluation of all rotation tracks and consider
Quaternion
interpolation. This will directly update attribute values if no vector is specified for
resultRotation
.
-
由于
-
R18
-
参数
-
[in]
|
time
|
Evaluation time.
|
[in]
|
flags
|
The animate flags:
ANIMATEFLAGS
|
[in]
|
resultRotation
|
Optionally store result in Vector instead of updating attributes.
|
-
返回
-
true
if evaluation was a success, otherwise
false
.
◆
GetVectorTracks()
Returns each component track for the given
DescID
.
-
由于
-
R18
-
参数
-
[in]
|
id
|
ID of desired vector.
|
[out]
|
xfound
|
X Track of Vector if found.
|
[out]
|
yfound
|
Y Track of Vector if found.
|
[out]
|
zfound
|
Z Track of Vector if found.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetVectorCurves()
Returns each component
CCurve
for the given curve.
-
由于
-
R18
-
参数
-
[in]
|
curveToSearch
|
CCurve
Component of desired vector.
|
[out]
|
xfound
|
X
CCurve
of Vector if found.
|
[out]
|
yfound
|
Y
CCurve
of Vector if found.
|
[out]
|
zfound
|
Z
CCurve
of Vector if found.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetGUID()
Gets a unique ID for any object in a document.
Works for generated objects in a cache (e.g. clones generated by a MoGraph cloner) and also for 'real' objects in the document (
GetUniqueIP()
does not do this).
-
注意
-
The ID generation for cache objects is based on
GetUniqueIP()
, so if two cache objects have the same IP, they will probably also get the same GUID
(unless they are
PointObject
or
PolygonObject
with different point or polygon count).
The ID generation for 'real' objects is based on the object's
GeMarker
, so if an object has no marker it will not return a unique ID.
-
返回
-
A checksum for the object.
◆
GetHighlightHandle()
Checks if a highlight handle has been hit.
Returns the handle ID previously given by
ObjectData::DetectHandle()
. The handle can then be drawn in the highlight mode.
-
参数
-
[in]
|
bd
|
The base draw for the operation. The caller owns the pointed base draw.
|
-
返回
-
The handle ID.
◆
GetRealSpline()
Gets a real spline representation of a primitive spline object.
This can for example be used to calculate the length of a spline.
If the object is a real spline it returns
this
. Otherwise
nullptr
.
-
返回
-
The real spline object. The object owns owns the pointed spline.
-
注意
-
The matrix of the returned object must not be used. Use the matrix of
*this
instead.
◆
GetVisibility()
Gets the object's visibility value. The range of values are
0.0
<=
visibility
<=
1.0
.
The object's visibility depends upon its parent, if it has no visibility track this will return the parent's visibility which is passed.
-
注意
-
In the editor only a visibility of
0.0
can be noticed but all other intermediate values are visualized in render only.
-
参数
-
[in]
|
parent
|
The parent object's visibility.
|
-
返回
-
The visibility.
◆
SearchHierarchy()
Checks if the object is a child of
op
.
-
参数
-
[in]
|
op
|
The object to search within his hierarchy.
|
-
返回
-
true
if the object is a child of
op
, otherwise
false
.
◆
GetOrigin()
Private
.
◆
SetOrigin()
Private
.
◆
GetTopOrigin()
Private
.
◆
GetEditObject()
Private
.
◆
RemoveFromCache()
void RemoveFromCache
|
(
|
void
|
|
)
|
|
Private
.
◆
ObjDraw()
Private
.
#define Opolygon
Polygon - PolygonObject.
定义:
ge_prepass.h:975
Bool GetBit(Int32 mask) const
定义:
c4d_baselist.h:2207
BaseObject * GetDeformCache(void)
定义:
c4d_baseobject.h:837
BaseObject * GetCache(HierarchyHelp *hh=nullptr)
定义:
c4d_baseobject.h:809
BasePlugin * FindPlugin(Int32 id, PLUGINTYPE type)
void SetUniqueIP(Int32 ip)
定义:
lib_description.h:327
BaseObject * GetHierarchyClone(HierarchyHelp *hh, BaseObject *op, HIERARCHYCLONEFLAGS flags, Bool *dirty, AliasTrans *trans)
BaseObject * GetNext(void)
定义:
c4d_baseobject.h:256
Bool SetParameter(const DescID &id, const GeData &t_data, DESCFLAGS_SET flags)
maxon::Int32 Int32
定义:
ge_sys_math.h:58
BaseObject * GetDown(void)
定义:
c4d_baseobject.h:274
Bool IsInstanceOf(Int32 id) const
定义:
c4d_baselist.h:1373
#define BIT_CONTROLOBJECT
Internal bit set by generators.
定义:
ge_prepass.h:853
The base class for Cinema 4D plugins.
定义:
c4d_baseplugin.h:63
定义:
c4d_basedocument.h:490