-
首页
-
C4D R23.110 C++ SDK
ObjectData Class Reference
#include <c4d_objectdata.h>
详细描述
A data class for creating object plugins.
An object plugin can either be a generator, a modifier, a spline generator or a particle modifier. This is set when the object is registered and affects which functions are called.
使用
RegisterObjectPlugin()
to register an object plugin.
-
注意
-
Be sure to read the new information about
BaseObject::GetUniqueIP
if a generator is created.
Additional Inherited Members
|
|
NodeData
()
|
GeListNode
*
|
Get
(void) const
|
virtual
Bool
|
消息
(
GeListNode
*node,
Int32
type, void *data)
|
virtual void
|
GetBubbleHelp
(
GeListNode
*node,
maxon::String
&str)
|
virtual
BaseDocument
*
|
GetDocument
(
GeListNode
*node)
|
virtual
Int32
|
GetBranchInfo
(
GeListNode
*node,
BranchInfo
*info,
Int32
max,
GETBRANCHINFO
flags)
|
virtual
Bool
|
IsInstanceOf
(const
GeListNode
*node,
Int32
type) const
|
virtual
Bool
|
IsDocumentRelated
(const
GeListNode
*node,
Bool
&docrelated) const
|
virtual
Bool
|
Init
(
GeListNode
*node)
|
virtual void
|
Free
(
GeListNode
*node)
|
virtual
Bool
|
读取
(
GeListNode
*node,
HyperFile
*hf,
Int32
level)
|
virtual
Bool
|
Write
(
GeListNode
*node,
HyperFile
*hf)
|
virtual
Bool
|
CopyTo
(
NodeData
*dest,
GeListNode
*snode,
GeListNode
*dnode,
COPYFLAGS
flags,
AliasTrans
*trn)
|
virtual
Bool
|
GetDDescription
(
GeListNode
*node,
描述
*description,
DESCFLAGS_DESC
&flags)
|
virtual
Bool
|
GetDParameter
(
GeListNode
*node, const
DescID
&id,
GeData
&t_data,
DESCFLAGS_GET
&flags)
|
virtual
Bool
|
SetDParameter
(
GeListNode
*node, const
DescID
&id, const
GeData
&t_data,
DESCFLAGS_SET
&flags)
|
virtual
Bool
|
GetDEnabling
(
GeListNode
*node, const
DescID
&id, const
GeData
&t_data,
DESCFLAGS_ENABLE
flags, const
BaseContainer
*itemdesc)
|
virtual
Bool
|
TranslateDescID
(
GeListNode
*node, const
DescID
&id,
DescID
&res_id,
C4DAtom
*&res_at)
|
|
BaseData
()
|
virtual
|
~BaseData
(void)
|
void
|
Destructor
(void)
|
GeListNode
*
|
private_link
|
成员函数文档编制
◆
GetDimension()
Called to get the boundaries of the object.
-
注意
-
GetDimension()
should be implemented for objects of types
Opolygon
,
Opoint
,
Oline
and
Ospline
. Furthermore it may be implemented to override
Cinema 4D
's default handling of bounding boxes.
-
参数
-
[in]
|
op
|
The
BaseObject
connected with the
ObjectData
instance. Equal to
static_cast
<
BaseObject
*>
Get()
. Provided for speed and convenience.
Cinema 4D
owns the pointed object.
|
[out]
|
mp
|
Assign the center point of the bounding box.
|
[out]
|
rad
|
Assign the XYZ bounding box radius.
|
Reimplemented in
EffectorData
.
◆
Draw()
Called to draw additional information for the object in the editor view.
Be sure to call the parent version as last return:
return
SUPER::Draw(op, drawpass, bd, bh);
-
注意
-
Generator objects are automatically drawn as
GetVirtualObjects()
returns the polygonal data already.
-
警告
-
Only draw in
DRAWPASS::HIGHLIGHTS
if you really know what you are doing. Otherwise always check the
drawpass
and then do not draw if it is DRAWPASS::HIGHLIGHTS.
Only draw the object in
DRAWPASS::OBJECT
. The object's appearance may change if the same object is drawn in multiple passes.
-
参数
-
[in]
|
op
|
The
BaseObject
connected with the
ObjectData
instance. Equal to
static_cast
<
BaseObject
*>
Get()
. Provided for speed and convenience.
Cinema 4D
owns the pointed object.
|
[in]
|
drawpass
|
The draw pass:
DRAWPASS
|
[in]
|
bd
|
The editor's view. The caller owns the pointed view.
|
[in]
|
bh
|
The helper for the editor's view. The caller owns the pointed view helper.
|
-
返回
-
The result of drawing into the editor view:
DRAWRESULT
Reimplemented in
EffectorData
.
◆
DrawShadow()
Called during the shadow pass instead of the
Draw()
方法。
-
参数
-
[in]
|
op
|
The
BaseObject
connected with the
ObjectData
instance. Equal to
static_cast
<
BaseObject
*>
Get()
. Provided for speed and convenience.
Cinema 4D
owns the pointed object.
|
[in]
|
bd
|
The editor's view. The caller owns the pointed view.
|
[in]
|
bh
|
The helper for the editor's view. The caller owns the pointed view helper.
|
-
返回
-
The result of drawing into the editor view:
DRAWRESULT
◆
DetectHandle()
Called to manually detect a click on a handle.
-
注意
-
It is only needed to override
DetectHandle
if
GetHandleCount
/
GetHandle
/
SetHandle
automated handle interface functions are not overridden.
-
参数
-
[in]
|
op
|
The
BaseObject
connected with the
ObjectData
instance. Equal to
static_cast
<
BaseObject
*>
Get()
. Provided for speed and convenience.
Cinema 4D
owns the pointed object.
|
[in]
|
bd
|
The editor's view. The caller owns the pointed view.
|
[in]
|
x
|
The mouse X coordinate.
|
[in]
|
y
|
The mouse Y coordinate.
|
[in]
|
qualifier
|
The qualifier keys that were pressed:
QUALIFIER
|
-
返回
-
The handle ID that is to be passed to
MoveHandle
.
◆
MoveHandle()
Called to move a handle manually.
-
注意
-
It is only needed to override
MoveHandle
if
GetHandleCount
/
GetHandle
/
SetHandle
automated handle interface functions are not overridden.
-
参数
-
[in]
|
op
|
The
BaseObject
connected with the
ObjectData
instance. Equal to
static_cast
<
BaseObject
*>
Get()
. Provided for speed and convenience.
Cinema 4D
owns the pointed object.
|
[in]
|
undo
|
This is a copy of the object that should not be modified during the move handle.
Cinema 4D
owns the pointed object.
|
[in]
|
mouse_pos
|
The mouse position.
|
[in]
|
hit_id
|
The handle ID returned from
DetectHandle()
.
|
[in]
|
qualifier
|
The qualifier keys that were pressed:
QUALIFIER
|
[in]
|
bd
|
The editor's view. The caller owns the pointed view.
|
-
返回
-
true
if the handle was moved, otherwise
false
.
◆
AddToExecution()
Called to add execution priorities.
By default returns
false
. In that case
Cinema 4D
will call
Execute()
at the priority specified by the user in the
EXPRESSION_PRIORITY
parameter of the container.
If overridden then insert points of execution in the list and return
true
. Heres is an example:
list->Add(op,
EXECUTIONPRIORITY_ANIMATION
,
EXECUTIONFLAGS::NONE
);
list->Add(op,
EXECUTIONPRIORITY_GENERATOR
,
EXECUTIONFLAGS::NONE
);
Cinema 4D
will then call
Execute()
2 times.
-
参数
-
[in]
|
op
|
The
BaseObject
connected with the
ObjectData
instance. Equal to
static_cast
<
BaseObject
*>
Get()
. Provided for speed and convenience.
Cinema 4D
owns the pointed object.
|
[in]
|
list
|
The priority list to add execution points to.
Cinema 4D
owns the pointed priority list.
|
-
返回
-
true
if priority was added to the execution list, otherwise
false
.
Reimplemented in
EffectorData
.
◆
Execute()
Called at the point in the priority pipeline specified by
AddToExecution
, or the lack thereof.
-
注意
-
This function is called in a thread context. See the
important information
about threading.
-
参数
-
[in]
|
op
|
The
BaseObject
connected with the
ObjectData
instance. Equal to
static_cast
<
BaseObject
*>
Get()
. Provided for speed and convenience.
Cinema 4D
owns the pointed object.
|
[in]
|
doc
|
The host document of the object.
Cinema 4D
owns the pointed document.
|
[in]
|
bt
|
The calling thread. Can be
nullptr
.
Cinema 4D
owns the pointed thread.
|
[in]
|
priority
|
The priority of the call to
Execute()
in the pipeline:
EXECUTIONPRIORITY
|
[in]
|
flags
|
The execution flags:
EXECUTIONFLAGS
|
-
返回
-
The execution result:
EXECUTIONRESULT
Reimplemented in
EffectorData
.
◆
GetModelingAxis()
Called to return the modeling axis for the object.
The value given here will be returned by
BaseObject::GetModelingAxis
. No built-in tools currently use this, as plugin objects are not editable. Only the camera will use it when in an editing mode.
-
参数
-
[in]
|
op
|
The
BaseObject
connected with the
ObjectData
instance. Equal to
static_cast
<
BaseObject
*>
Get()
. Provided for speed and convenience.
Cinema 4D
owns the pointed object.
|
[in]
|
doc
|
The host document of the object.
Cinema 4D
owns the pointed document.
|
[out]
|
axis
|
Assign the modeling axis.
|
◆
GetVirtualObjects()
Called to get an object chain for a generator object.
-
注意
-
This function is called in a thread context. See the
important information
about threading.
-
警告
-
Must not be overridden for non-generator objects.
-
参数
-
[in]
|
op
|
The
BaseObject
connected with the
ObjectData
instance. Equal to
static_cast
<
BaseObject
*>
Get()
. Provided for speed and convenience.
Cinema 4D
owns the pointed object.
|
[in]
|
hh
|
A hierarchy helper for the operation. The caller owns the pointed hierarchy helper.
|
-
返回
-
The newly allocated object chain, or
nullptr
if a memory error occurred.
If the generator does not produce any output (e.g. when the user chose wrong settings) it must at least return an (empty)
Onull
object, otherwise
Cinema 4D
will try to rebuild the cache again and again.
Only return
nullptr
in the case of a memory error.
An exception to this rule are generators with
OBJECT
flag OBJECT_INPUT set. If there is no input object, then such generators need to return
nullptr
as well.
◆
ModifyObject()
Called to modify the passed object.
-
注意
-
This function is called in a thread context. See the
important information
about threading.
-
警告
-
Must not be overridden for non-modifier objects.
-
参数
-
[in]
|
mod
|
The
BaseObject
connected with the
ObjectData
instance. Equal to
static_cast
<
BaseObject
*>
Get()
. Provided for speed and convenience.
Cinema 4D
owns the pointed object.
|
[in]
|
doc
|
The document containing the object to modify.
Cinema 4D
owns the pointed document.
|
[in,out]
|
op
|
The object to modify.
Cinema 4D
owns the pointed object.
|
[in]
|
op_mg
|
The object's world matrix.
|
[in]
|
mod_mg
|
The modifier object's world matrix.
|
[in]
|
lod
|
The level of detail.
|
[in]
|
flags
|
Currently unused.
|
[in]
|
thread
|
The calling thread. Can be
nullptr
.
Cinema 4D
owns the pointed thread.
|
-
返回
-
true
if the object was modified, otherwise
false
.
Reimplemented in
EffectorData
.
◆
CheckDirty()
Called to check for a change in a deformer object manually.
For example this will make a deformer update every frame:
void
CheckDirty
(
BaseObject
*op,
BaseDocument
*doc)
{
if
(doc->
GetTime
()!=cached_time)
{
cached_time = doc->
GetTime
();
op->
SetDirty
(
DIRTYFLAGS::DATA
);
}
}
-
注意
-
This function is called in a thread context. See the
important information
about threading.
-
参数
-
[in]
|
op
|
The
BaseObject
connected with the
ObjectData
instance. Equal to
static_cast
<
BaseObject
*>
Get()
. Provided for speed and convenience.
Cinema 4D
owns the pointed object.
|
[in]
|
doc
|
The document containing the object to modify.
Cinema 4D
owns the pointed document.
|
◆
GetContour()
Called to return a spline contour.
-
注意
-
This function is called in a thread context. See the
important information
about threading.
-
警告
-
Must not be overridden for non-spline objects.
-
参数
-
[in]
|
op
|
The
BaseObject
connected with the
ObjectData
instance. Equal to
static_cast
<
BaseObject
*>
Get()
. Provided for speed and convenience.
Cinema 4D
owns the pointed object.
|
[in]
|
doc
|
The document containing the object to modify.
Cinema 4D
owns the pointed document.
|
[in]
|
lod
|
The level of detail.
|
[in]
|
bt
|
The calling thread. Can be
nullptr
.
Cinema 4D
owns the pointed thread.
|
-
返回
-
The spline contour.
If the generator does not produce any output (e.g. when the user chose wrong settings) it must at least return an (empty)
Onull
object, otherwise
Cinema 4D
will try to rebuild the cache again and again.
Only return
nullptr
in the case of a memory error.
◆
ModifyParticles()
Called to modify particles.
-
注意
-
This function is called in a thread context. See the
important information
about threading.
-
参数
-
[in]
|
op
|
The
BaseObject
connected with the
ObjectData
instance. Equal to
static_cast
<
BaseObject
*>
Get()
. Provided for speed and convenience.
Cinema 4D
owns the pointed object.
|
[in]
|
pp
|
The initial element of the
Particle
array. The caller owns the pointed array.
This array is used to read the particles information and should not be modified.
|
[out]
|
ss
|
The initial element of the
BaseParticle
array.
Modify the elements in this array to change the velocity of the particles. The caller owns the pointed array.
|
[in]
|
pcnt
|
The number of particles in the
pp
and
ss
arrays.
|
[in]
|
diff
|
The time delta for the particles movement in seconds. Usually the difference in time between two frames, but this can be different for such functions as motion blur.
|
◆
GetHandleCount()
Called to get the number of handles the object has.
Part of the automated handle interface.
-
另请参阅
-
HandleInfo
.
-
参数
-
[in]
|
op
|
The
BaseObject
connected with the
ObjectData
instance. Equal to
static_cast
<
BaseObject
*>
Get()
. Provided for speed and convenience.
Cinema 4D
owns the pointed object.
|
-
返回
-
The number of handles for the object.
Reimplemented in
EffectorData
.
◆
GetHandle()
Called to get the information for handle
i
.
Part of the automated handle interface.
-
另请参阅
-
HandleInfo
.
-
参数
-
[in]
|
op
|
The
BaseObject
connected with the
ObjectData
instance. Equal to
static_cast
<
BaseObject
*>
Get()
. Provided for speed and convenience.
Cinema 4D
owns the pointed object.
|
[in]
|
i
|
The handle index.
|
[in,out]
|
info
|
Fill with the handle information.
|
Reimplemented in
EffectorData
.
◆
SetHandle()
Called to set the information for handle
i
.
Called when the user has moved handle
i
to position
p
. Update the object's internal data accordingly (e.g. parameter values etc.).
Part of the automated handle interface.
-
另请参阅
-
HandleInfo
.
-
参数
-
[in]
|
op
|
The
BaseObject
connected with the
ObjectData
instance. Equal to
static_cast
<
BaseObject
*>
Get()
. Provided for speed and convenience.
Cinema 4D
owns the pointed object.
|
[in]
|
i
|
The handle index.
|
[in]
|
p
|
The handle's position.
|
[in]
|
info
|
The handle information.
|
Reimplemented in
EffectorData
.
@ DATA
Container changed.
#define EXECUTIONPRIORITY_ANIMATION
Animation.
定义:
ge_prepass.h:3623
#define EXECUTIONPRIORITY_GENERATOR
Generators.
定义:
ge_prepass.h:3627
BaseTime GetTime(void) const
virtual void CheckDirty(BaseObject *op, BaseDocument *doc)
定义:
c4d_basedocument.h:490
void SetDirty(DIRTYFLAGS flags)
定义:
c4d_baseobject.h:897