-
首页
-
C4D R23.110 C++ SDK
TP_MasterSystem Class Reference
#include <c4d_particles.h>
详细描述
The master system is the main Thinking Particles engine class. There can only be one master system per document. This is the easiest way to get it:
TP_MasterSystem
* GetTpMasterSystem(
BaseDocument
* doc)
{
if
(!doc)
return
nullptr
;
BaseSceneHook
* hook = doc->
FindSceneHook
(
ID_THINKINGPARTICLES
);
if
(!hook || hook->
GetType
() !=
ID_THINKINGPARTICLES
)
return
nullptr
;
return
static_cast<
TP_MasterSystem
*
>
(hook);
}
Set Particle Information/Bits
|
void
|
SetPosition
(
Int32
pid, const
向量
&p)
|
void
|
SetVelocity
(
Int32
pid, const
向量
&p)
|
void
|
SetMass
(
Int32
pid,
Float
mass)
|
void
|
SetSpin
(
Int32
pid, const
TP_Spin
&spin)
|
void
|
SetAge
(
Int32
pid, const
BaseTime
&age)
|
void
|
SetLife
(
Int32
pid, const
BaseTime
&life)
|
void
|
SetGroup
(
Int32
pid,
TP_PGroup
*group)
|
void
|
SetSize
(
Int32
pid,
Float
size)
|
void
|
SetScale
(
Int32
pid, const
向量
&scale)
|
void
|
SetAlignment
(
Int32
pid, const
矩阵
&align)
|
void
|
SetRandomseed
(
Int32
pid,
Int32
seed)
|
void
|
SetShape
(
Int32
pid, const
TP_PShapePtr
&shape,
Bool
deleteold=true)
|
void
|
SetCollision
(
Int32
pid,
Int32
collision)
|
void
|
SetDTFactor
(
Int32
pid,
Float
dt)
|
Particle Data Channels
|
Bool
|
AddDataChannel
(
GvDataID
type, const
maxon::String
&str)
|
Bool
|
RemoveDataChannel
(
Int32
chan)
|
Int32
|
NumDataChannels
(void)
|
GvDataID
|
DataChannelType
(
Int32
chan)
|
String
|
DataChannelName
(
Int32
chan)
|
Int32
|
DataChannelUniqueID
(
Int32
chan)
|
Int32
|
DataChannelID
(
Int32
unique_id)
|
Bool
|
SetData
(
Int32
pid,
Int32
chan, void *data,
GvValueID
type)
|
Bool
|
GetData
(
Int32
pid,
Int32
chan, void *data,
GvValueID
type)
|
Bool
|
SetDataFromPort
(
Int32
pid,
Int32
chan,
GvPort
*p,
GvRun
*r)
|
Bool
|
SetDataToPort
(
Int32
pid,
Int32
chan,
GvPort
*p,
GvRun
*r)
|
BaseContainer
*
|
GetDataChannelInfo
(
Int32
chan)
|
Int32
|
GetDataChannelFromInfo
(
BaseContainer
*info)
|
Particle Shape
|
TP_PShapePtr
|
GetShapeClone
(const
TP_PShapePtr
&shape,
Int32
pid,
COPYFLAGS
flags,
AliasTrans
*trn)
|
TP_PShapePtr
|
GetShape
(const
TP_PShapePtr
&shape,
Int32
pid,
Int32
owner_id)
|
BaseObject
*
|
GetShapeVirtualObjects
(const
TP_PShapePtr
&shape,
Int32
pid,
BaseDocument
*doc,
HierarchyHelp
*hh)
|
Float
|
GetShapeScale
(const
TP_PShapePtr
&shape,
Int32
pid)
|
void
|
FreeShape
(
TP_PShapePtr
&shape,
Int32
pid)
|
Additional Inherited Members
|
Bool
|
InitDisplayControl
(
BaseDocument
*doc,
BaseDraw
*bd, const
AtomArray
*active)
|
void
|
FreeDisplayControl
()
|
Bool
|
DisplayControl
(
BaseDocument
*doc,
BaseObject
*op,
BaseObject
*chainstart,
BaseDraw
*bd,
BaseDrawHelp
*bh,
ControlDisplayStruct
&cds) const
|
void
|
Draw
(
BaseDocument
*doc,
BaseDraw
*bd,
BaseDrawHelp
*bh,
BaseThread
*bt,
SCENEHOOKDRAW
flags)
|
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
|
构造函数 & 析构函数文档编制
◆
TP_MasterSystem()
◆
~TP_MasterSystem()
成员函数文档编制
◆
AllocParticle()
Int32
AllocParticle
|
(
|
void
|
|
)
|
|
Allocates a particle.
-
返回
-
The particle ID of the allocated particle, or
NOTOK
if the allocation failed.
◆
AllocParticles()
Allocates
num
particles and stores their particles IDs in the
ids
array.
-
参数
-
[in]
|
num
|
The number of particles to allocate.
|
[out]
|
ids
|
An array of
num
Int32
elements. Filled with the allocated particle IDs. The caller owns the pointed array.
|
-
返回
-
The number of particles allocated, or
NOTOK
if the allocation failed.
◆
FreeParticle()
void FreeParticle
|
(
|
Int32
|
pid
|
)
|
|
Frees a particle.
-
注意
-
Normally this should not be used. Instead
SetLife()
should be uses with a negative time, so that the particle in question dies immediately.
-
参数
-
[in]
|
pid
|
The particle ID of the particle to free:
0
<=
pid
<
NumParticles()
|
◆
FreeAllParticles()
void FreeAllParticles
|
(
|
void
|
|
)
|
|
Frees all particles.
-
注意
-
Normally this should not be used. Instead
SetLife()
should be uses with a negative time, so that the particles dies immediately.
◆
NumParticles()
Int32
NumParticles
|
(
|
void
|
|
)
|
|
Retrieves the number of allocated particles. All particles IDs are less than this value.
-
返回
-
The number of particles.
◆
AllocParticleGroup()
Allocates a new particle group. Must be freed with
FreeParticleGroup()
, or inserted into the list with
SetPGroupHierarchy()
.
-
返回
-
The allocate particle group. The caller owns the pointed
TP_PGroup
.
◆
FreeParticleGroup()
void FreeParticleGroup
|
(
|
TP_PGroup
*&
|
group
|
)
|
|
Frees a particle group, removing it from the list.
-
参数
-
[in,out]
|
group
|
The group to free. Set to
nullptr
afterwards.
|
◆
SetPGroupHierarchy()
Performs a hierarchy action on a particle group.
-
参数
-
[in]
|
parent
|
The parent parameter. The caller owns the pointed
TP_PGroup
.
|
[in]
|
group
|
The group to act on. The caller owns the pointed
TP_PGroup
.
|
[in]
|
mode
|
The hierarchy action:
TP_InsertMode
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetParticleGroups()
Returns the particle groups in
ingroup
, specified by
mode
, into the
gtab
列表。
范例:
PluginSceneHook* hook = doc->
FindSceneHook
(
ID_THINKINGPARTICLES
);
if
(hook && hook->GetType() ==
ID_THINKINGPARTICLES
)
{
TP_MasterSystem
*tpm = (
TP_MasterSystem
*)hook;
TP_PGroupArray
groups;
Int32
gcnt = tpm->
GetParticleGroups
(
nullptr
, &groups,
TP_GETPGROUP_ALL
,
false
);
// For subgroups
//Int32 gcnt = tpm->GetParticleGroups(nullptr,&groups, TP_GETPGROUP_ALL, true);
TP_PGroup
*grp = (
TP_PGroup
*)groups.
GetIndex
(0);
// grp is the "All" group
//To iterate
//for (Int32 i=0; i<gcnt; i++)
//{
// TP_PGroup *grp = (TP_PGroup*)groups.GetIndex(i);
//}
}
-
参数
-
[in]
|
ingroup
|
The in-group parameter. The caller owns the pointed
TP_PGroup
.
|
[out]
|
gtab
|
The specified groups are added to this list. The caller owns the pointed
TP_PGroup
.
|
[in]
|
mode
|
The mode:
TP_GetPGroupMode
|
[in]
|
subgroups
|
若
true
sub-groups are included.
|
-
返回
-
The number of groups added to
gtab
.
◆
GetGroupParticleCount()
Calculates the number of particles in
ingroup
.
-
参数
-
[in]
|
ingroup
|
The in-group parameter. The caller owns the pointed
TP_PGroup
.
|
[in]
|
subgroups
|
若
true
sub-groups are included.
|
-
返回
-
The number of particles in the specified group.
◆
GetVirtualObjects()
Creates the virtual object hierarchy for a particle group, i.e. an object group containing all particles. Used by the ParticleGeometry object.
-
参数
-
[in]
|
ingroup
|
The in-group parameter. The caller owns the pointed
TP_PGroup
.
|
[in]
|
inRender
|
true
if this is for rendering, otherwise the objects are built for the editor view.
|
[in]
|
subgroups
|
若
true
sub-groups are included.
|
[in]
|
hh
|
The hierarchy helper for the virtual object generation. The caller owns the pointed
HierarchyHelp
.
|
-
返回
-
The virtual object, or
nullptr
if there was an error.
◆
GetGroupInfo()
Retrieves the group information for a
group
.
-
参数
-
[in]
|
group
|
The group to get the information for. The caller owns the pointed
TP_PGroup
.
|
-
返回
-
The group information for group. The caller owns the pointed
TP_PGroupInfo
.
◆
GetGroupFromInfo()
Retrieves a group from the information in
info
.
-
参数
-
[in]
|
info
|
The group information to search for. The caller owns the pointed
TP_PGroupInfo
.
|
-
返回
-
The retrieved group, or
nullptr
if no group matched. The master system owns the pointed
TP_PGroup
.
◆
UpdateGroup()
Updates a group at a given time difference since the last update. Use a default
timeDelta
of
0
to update at the current time.
-
由于
-
R16.050
-
参数
-
[in]
|
group
|
The group to update. The caller owns the pointed
TP_PGroup
.
|
[in]
|
timeDelta
|
The time difference since the last update.
|
-
返回
-
true
if the update was done successfully, otherwise
false
.
◆
Alive()
Retrieves the alive bit of a particle.
-
参数
-
-
返回
-
true
if the particle is alive, otherwise
false
.
◆
IsBorn()
Retrieves the is-born bit of a particle.
-
参数
-
-
返回
-
true
if the particle was just born, otherwise
false
.
◆
IsDie()
Retrieves the is-die bit of a particle.
-
参数
-
-
返回
-
true
if the particle just died, otherwise
false
.
◆
EntersGroup()
Retrieves the enters-group bit of a particle.
-
参数
-
-
返回
-
true
if the particle just entered a group, otherwise
false
.
◆
Group()
Retrieves the group of a particle.
-
参数
-
-
返回
-
The group that the particle currently is in. The master system owns the pointed
TP_PGroup
.
◆
Position()
Retrieves the position of a particle.
-
参数
-
-
返回
-
The particle position.
◆
Velocity()
Retrieves the velocity of a particle.
-
参数
-
-
返回
-
The particle velocity.
◆
Mass()
Retrieves the mass of a particle.
-
参数
-
-
返回
-
The particle mass.
◆
Spin()
Retrieves the spin of a particle.
-
参数
-
-
返回
-
The particle spin.
◆
Size()
Retrieves the size of a particle.
-
参数
-
-
返回
-
The particle size.
◆
Scale()
Retrieves the scale of a particle.
-
参数
-
-
返回
-
The particle scale.
◆
Age()
Retrieves the age of a particle.
-
参数
-
-
返回
-
The particle age.
◆
Life()
Retrieves the lifetime of a particle.
-
参数
-
-
返回
-
The particle lifetime.
◆
Alignment()
Retrieves the alignment matrix of a particle.
-
参数
-
-
返回
-
The particle alignment matrix.
◆
Randomseed()
Retrieves the random seed of a particle.
-
参数
-
-
返回
-
The particle random seed.
◆
Shape()
Retrieves the shape of a particle.
-
参数
-
-
返回
-
The particle shape. The master system owns the pointed
TP_PShapePtr
.
◆
Transform()
Retrieves the transformation matrix of a particle.
-
参数
-
-
返回
-
The particle transformation matrix.
◆
Flags()
Retrieves the flags of a particle.
-
注意
-
These returned flags are private. Use the functions like
Alive()
instead.
-
参数
-
-
返回
-
The particle flags.
◆
DTFactor()
Retrieves the delta time factor of a particle.
-
参数
-
-
返回
-
The particle delta time factor.
◆
SetPosition()
void SetPosition
|
(
|
Int32
|
pid
,
|
|
|
const
向量
&
|
p
|
|
)
|
|
|
Sets the position for a particle.
-
参数
-
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
p
|
The new particle position.
|
◆
SetVelocity()
void SetVelocity
|
(
|
Int32
|
pid
,
|
|
|
const
向量
&
|
p
|
|
)
|
|
|
Sets the velocity for a particle.
-
参数
-
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
p
|
The new particle velocity.
|
◆
SetMass()
Sets the mass for a particle.
-
参数
-
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
mass
|
The new particle mass.
|
◆
SetSpin()
Sets the spin for a particle.
-
参数
-
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
spin
|
The new particle spin.
|
◆
SetAge()
Sets the age for a particle.
-
参数
-
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
age
|
The new particle age.
|
◆
SetLife()
Sets the lifetime for a particle.
-
参数
-
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
life
|
The new particle lifetime.
|
◆
SetGroup()
Inserts a particle into another group.
-
参数
-
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
group
|
The group to place the particle in. The pointed group must belong to this master system.
|
◆
SetSize()
Sets the size for a particle.
-
参数
-
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
size
|
The new particle size.
|
◆
SetScale()
void SetScale
|
(
|
Int32
|
pid
,
|
|
|
const
向量
&
|
scale
|
|
)
|
|
|
Sets the scale for a particle.
-
参数
-
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
scale
|
The new particle scale.
|
◆
SetAlignment()
void SetAlignment
|
(
|
Int32
|
pid
,
|
|
|
const
矩阵
&
|
align
|
|
)
|
|
|
Sets the alignment matrix for a particle.
-
参数
-
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
align
|
The new particle alignment matrix.
|
◆
SetRandomseed()
Sets the random seed for a particle.
-
参数
-
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
seed
|
The new particle random seed.
|
◆
SetShape()
Sets the shape for a particle.
-
参数
-
◆
SetCollision()
Sets the collision handling information for a particle.
-
参数
-
◆
SetDTFactor()
Sets the delta time factor for a particle.
-
参数
-
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
dt
|
The new particle delta time factor.
|
◆
AddDataChannel()
Adds a data channel.
-
参数
-
[in]
|
type
|
The channel data type:
GvDataID
|
[in]
|
str
|
The channel name.
|
-
返回
-
true
if successful, otherwise
false
.
◆
RemoveDataChannel()
Removes a data channel.
-
参数
-
-
返回
-
true
if successful, otherwise
false
.
◆
NumDataChannels()
Int32
NumDataChannels
|
(
|
void
|
|
)
|
|
Retrieves the data channel count.
-
返回
-
The number of data channels.
◆
DataChannelType()
Retrieves the data type of a data channel.
-
参数
-
-
返回
-
The data type of channel
chan
.
◆
DataChannelName()
Retrieves the name of a data channel.
-
参数
-
-
返回
-
The data channel name.
◆
DataChannelUniqueID()
Retrieves a unique ID for a data channel that is independent of its index.
-
参数
-
-
返回
-
A unique ID for channel
chan
.
◆
DataChannelID()
Retrieves the index of a data channel from its unique ID.
-
参数
-
[in]
|
unique_id
|
The unique channel ID.
|
-
返回
-
The data channel index.
◆
SetData()
Sets the data channel for a particle.
-
参数
-
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
chan
|
The channel index:
0
<=
chan
<
NumDataChannels()
|
[in]
|
data
|
The data to set. Points to GV data. The layout of the pointed data is determined by
type
.
|
[in]
|
type
|
Determines the type of
data
.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetData()
Retrieves the data channel for a particle.
-
参数
-
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
chan
|
The channel index:
0
<=
chan
<
NumDataChannels()
|
[out]
|
data
|
Filled with the retrieved data. Points to GV data. The layout of the pointed data is determined by
type
.
|
[in]
|
type
|
Determines the type of
data
.
|
-
返回
-
true
if successful, otherwise
false
.
◆
SetDataFromPort()
Sets the data channel for a particle, getting the data from a GV port.
-
参数
-
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
chan
|
The channel index:
0
<=
chan
<
NumDataChannels()
|
[in]
|
p
|
The port with the data to set. The caller owns the pointed
GvPort
.
|
[in]
|
r
|
The run helper. The caller owns the pointed
GvRun
.
|
-
返回
-
true
if successful, otherwise
false
.
◆
SetDataToPort()
Retrieves the data channel for a particle, storing the data in a GV port.
-
参数
-
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
chan
|
The channel index:
0
<=
chan
<
NumDataChannels()
|
[out]
|
p
|
The retrieved data is set in this port. The caller owns the pointed
GvPort
.
|
[in]
|
r
|
The run helper. The caller owns the pointed
GvRun
.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetDataChannelInfo()
Retrieves the channel information for a data channel.
-
警告
-
The returned object needs to be free with
DeleteObj
(info) afterwards.
-
参数
-
-
返回
-
The channel information for chan. The caller owns the pointed
TP_DataChannelInfo
.
◆
GetDataChannelFromInfo()
Retrieves a data channel index from the information in
info
.
-
参数
-
-
返回
-
The retrieved channel index, or
NOTOK
if no channel matched.
◆
Reg_FreeParticle_CB()
Registers a free-particle callback.
-
参数
-
[in]
|
cb
|
The callback to register.
|
◆
UReg_FreeParticle_CB()
Unregisters a free-particle callback.
-
参数
-
[in]
|
cb
|
The callback to unregister.
|
◆
Reg_DeletePShape_CB()
Registers a delete-shape callback.
-
参数
-
[in]
|
cb
|
The callback to register.
|
◆
UReg_DeletePShape_CB()
Unregisters a delete-shape callback.
-
参数
-
[in]
|
cb
|
The callback to unregister.
|
◆
GetOperatorID()
Retrieves an ID for
op
that can later be used with
GetOperator()
to get
op
back.
-
警告
-
The ID is only valid during a limited time.
-
参数
-
[in]
|
op
|
A node. The caller owns the pointed node.
|
-
返回
-
An operator ID for
op
.
◆
GetOperator()
Retrieves the operator for an ID previously acquired with
GetOperatorID()
.
-
参数
-
-
返回
-
The retrieved operator, or
nullptr
. The GV world owns the pointed object.
◆
GetDirty()
UInt32
GetDirty
|
(
|
void
|
|
)
|
const
|
A dirty counter for the master system. This can be used to see if anything has changed. Use
SetDirty()
to increment the counter.
-
返回
-
The dirty counter, incremented when something changes in the system.
◆
SetDirty()
Increments the dirty counter, i.e. tells anyone using
GetDirty()
that something has changed.
-
注意
-
This has to be used whenever an operator affects particle shapes, like the ObjectShape operator does.
◆
CheckCollision()
Finds the node responsible for
collision
, the one that called
SetCollision()
, and tells it to evaluate the passed collision parameters.
-
注意
-
Normally Thinking Particles evaluates this function automatically for registered collisions.
-
参数
-
[in]
|
collision
|
The collision ID. This is
GetOperatorID()
for the node responsible for the collision.
|
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
t
|
Time to evaluate the collision at. Collisions are detected between
t
-
dt
and
t
.
|
[in]
|
pos
|
Assigned the new position of the object if there is a collision.
|
[out]
|
vel
|
Assigned the new velocity of the object if there is a collision.
|
[out]
|
spin
|
Assigned the new spin of the object if there is a collision.
|
[in]
|
dt
|
The time since the last evaluation, i.e. the time to look backwards for collisions.
|
[in]
|
ct
|
The collision time, if there was a collision. This is generally less than
t
.
|
-
返回
-
true
if there was a collision, otherwise
false
.
◆
GetShapeClone()
Finds the node responsible for
shape
, as specified by
TP_PShapeI::owner_id
, and tells it to return a clone of
shape
.
-
注意
-
Normally Thinking Particles evaluates this function automatically for registered shapes.
-
警告
-
The returned shape must be free with
FreeShape()
afterwards.
-
参数
-
[in]
|
shape
|
The particle shape. The caller owns the pointed shape.
|
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
flags
|
The flags:
COPYFLAGS
|
[in]
|
trn
|
An alias translator for the operation. Can be
nullptr
. The caller owns the pointed
AliasTrans
.
|
-
返回
-
The particle shape pointer structure of the cloned particle shape. The caller owns the pointed shape.
◆
GetShape()
Finds the node responsible for
shape
, as specified by
TP_PShapeI::owner_id
, and tells it to return the shape associated with
shape
. (Normally this is the same object.)
-
注意
-
Normally Thinking Particles evaluates this function automatically for registered shapes.
-
参数
-
[in]
|
shape
|
The particle shape. The caller owns the pointed shape.
|
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
owner_id
|
The owner ID.
|
-
返回
-
The shape. The shape handler owns the pointed shape.
◆
GetShapeVirtualObjects()
Finds the node responsible for
shape
, as specified by
TP_PShapeI::owner_id
, and tells it to return a
BaseObject
shape for
shape
.
-
注意
-
Normally Thinking Particles evaluates this function automatically for registered shapes.
-
参数
-
[in]
|
shape
|
The particle shape. The caller owns the pointed shape.
|
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
doc
|
The current document. The caller owns the pointed
BaseDocument
.
|
[in]
|
hh
|
A hierarchy helper for the operation. The caller owns the pointed
HierarchyHelp
.
|
-
返回
-
The particle shape object. The particle shape handler owns the pointed object.
◆
GetShapeScale()
Finds the node responsible for
shape
, as specified by
TP_PShapeI::owner_id
, and tells it to return the scale of
shape
.
-
注意
-
Normally Thinking Particles evaluates this function automatically for registered shapes.
-
参数
-
[in]
|
shape
|
The particle shape. The caller owns the pointed shape.
|
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
-
返回
-
The shape scale.
◆
FreeShape()
Finds the node responsible for
shape
, as specified by
TP_PShapeI::owner_id
, and tells it to free
shape
.
-
注意
-
Normally Thinking Particles evaluates this function automatically for registered shapes.
-
参数
-
[in]
|
shape
|
The particle shape. The caller owns the pointed shape.
|
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
◆
ColliderCache()
Retrieves a collider cache for the shape associated with a particle.
-
参数
-
-
返回
-
The collider cache, or
nullptr
. The system owns the pointed collider cache.
◆
Color()
Retrieves the color for a particle.
-
由于
-
R16.038
-
参数
-
-
返回
-
The particle color.
◆
SetColor()
Sets the color for a particle.
-
由于
-
R16.038
-
参数
-
[in]
|
pid
|
The particle ID:
0
<=
pid
<
NumParticles()
|
[in]
|
color
|
The particle color.
|
#define ID_THINKINGPARTICLES
Thinking Particles scene hook ID.
定义:
c4d_particles.h:26
Int32 GetParticleGroups(TP_PGroup *ingroup, TP_PGroupArray *gtab, TP_GetPGroupMode mode, Bool subgroups=true)
定义:
c4d_particles.h:835
TP_PGroup * GetIndex(Int i) const
定义:
c4d_particles.h:149
定义:
c4d_basedocument.h:43
maxon::Int32 Int32
定义:
ge_sys_math.h:58
Represents a particle group.
定义:
c4d_particles.h:1445
BaseSceneHook * FindSceneHook(Int32 id) const
定义:
c4d_basedocument.h:1234
Int32 GetType() const
定义:
c4d_baselist.h:1348
定义:
c4d_basedocument.h:490
@ TP_GETPGROUP_ALL
All groups.
定义:
c4d_particles.h:182