-
首页
-
C4D R23.110 C++ SDK
BaseDocument Class Reference
#include <c4d_basedocument.h>
详细描述
This class contains the complete description of a scene.
-
注意
-
Has to be created with
Alloc()
and destroyed with
Free()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
Object/Material/Tag/Render Data
|
BaseObject
*
|
GetFirstObject
(void)
|
BaseMaterial
*
|
GetFirstMaterial
(void)
|
RenderData
*
|
GetFirstRenderData
(void)
|
BaseSceneHook
*
|
GetFirstSceneHook
()
|
void
|
InsertObject
(
BaseObject
*op,
BaseObject
*parent,
BaseObject
*pred,
Bool
checknames=false)
|
void
|
InsertMaterial
(
BaseMaterial
*mat,
BaseMaterial
*pred=nullptr,
Bool
checknames=false)
|
void
|
InsertRenderData
(
RenderData
*rd,
RenderData
*parent,
RenderData
*pred)
|
void
|
InsertRenderDataLast
(
RenderData
*rd)
|
BaseObject
*
|
GetActiveObject
(void)
|
BaseMaterial
*
|
GetActiveMaterial
(void)
|
BaseTag
*
|
GetActiveTag
(void)
|
RenderData
*
|
GetActiveRenderData
(void)
|
BaseObject
*
|
GetRealActiveObject
(
AtomArray
*help,
Bool
*multi)
|
void
|
GetActiveObjects
(
AtomArray
&selection,
GETACTIVEOBJECTFLAGS
flags) const
|
void
|
GetActivePolygonObjects
(
AtomArray
&selection,
Bool
children) const
|
void
|
GetActiveObjectsFilter
(
AtomArray
&selection,
Bool
children,
Int32
type,
Int32
instanceof) const
|
void
|
GetActiveMaterials
(
AtomArray
&selection) const
|
void
|
GetActiveTags
(
AtomArray
&selection) const
|
void
|
GetSelection
(
AtomArray
&selection) const
|
void
|
SetActiveObject
(
BaseObject
*op,
Int32
mode=0)
|
void
|
SetActiveMaterial
(
BaseMaterial
*mat,
Int32
mode=0)
|
void
|
SetActiveTag
(
BaseTag
*tag,
Int32
mode=0)
|
void
|
SetActiveRenderData
(
RenderData
*rd)
|
void
|
SetSelection
(
BaseList2D
*bl,
Int32
mode=0)
|
Key
|
void
|
AutoKey
(
BaseList2D
*undo,
BaseList2D
*op,
Bool
recursive,
Bool
pos,
Bool
scale,
Bool
rot,
Bool
param,
Bool
pla)
|
Bool
|
RecordKey
(
BaseList2D
*op, const
BaseTime
&time, const
DescID
&id,
BaseList2D
*undo,
Bool
eval_attribmanager,
Bool
autokeying,
Bool
allow_linking)
|
void
|
Record
(void)
|
杂项
|
void
|
AnimateObject
(
BaseList2D
*op, const
BaseTime
&time,
ANIMATEFLAGS
flags)
|
Bool
|
ExecutePasses
(
BaseThread
*bt,
Bool
animation,
Bool
expressions,
Bool
caches,
BUILDFLAGS
flags)
|
BaseDocument
*
|
Polygonize
(
Bool
keepanimation=false)
|
Bool
|
CollectSounds
(
BaseSound
*snd, const
BaseTime
&from, const
BaseTime
&to)
|
BaseSceneHook
*
|
FindSceneHook
(
Int32
id) const
|
Int32
|
GetSplinePlane
(void)
|
GeListHead
*
|
GetLayerObjectRoot
(void)
|
BaseContainer
|
GetAllTextures
(const
AtomArray
*ar)
|
BaseContainer
|
GetAllTextures
(
Bool
isNet, const
AtomArray
*ar)
|
BaseObject
*
|
GetHighest
(
Int32
type,
Bool
editor)
|
BaseBitmap
*
|
GetDocPreviewBitmap
()
|
void
|
GetHighlightedObjects
(
AtomArray
&selection) const
|
void
|
SetHighlightedObject
(
BaseObject
*op,
Int32
mode=0)
|
void
|
SetHighlightedObjects
(
AtomArray
&selection,
Int32
mode=0)
|
Bool
|
GetDefaultKey
(
CKey
*pKey,
Bool
&bOverdub) const
|
void
|
SetDefaultKey
(
CKey
*pKey,
Bool
bOverdub)
|
Bool
|
IsCacheBuilt
(
Bool
force=false)
|
Bool
|
IsAxisEnabled
(void)
|
BaseObject
*
|
GetHelperAxis
(void)
|
Bool
|
HandleSelectedTextureFilename
(
BaseChannel
*bc, const
Filename
&fn,
Filename
*resfilename,
Bool
undo,
GEMB_R
*already_answered)
|
Bool
|
ReceiveMaterials
(
BaseObject
*op,
AtomArray
*mat,
Bool
clearfirst)
|
Bool
|
ReceiveNewTexture
(
BaseObject
*op, const
Filename
&filename,
Bool
sdown,
GEMB_R
*already_answered)
|
void
|
SendInfo
(
Int32
type,
Int32
format, const
Filename
&fn,
BaseList2D
*bl,
Bool
hooks_only)
|
void
|
RecordZero
(void)
|
void
|
RecordNoEvent
(void)
|
void
|
SetRewind
(
Int32
flags=0)
|
Additional Inherited Members
|
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)
|
const
Char
*
|
GetViewportRenderId
(
VIEWPORT_RENDER_ID
typeId) const
|
BaseList2D
*
|
GetNext
()
|
BaseList2D
*
|
GetPred
()
|
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
|
构造函数 & 析构函数文档编制
◆
BaseDocument()
◆
~BaseDocument()
成员函数文档编制
◆
Alloc()
Allocates a document. Destroy the allocated document with
Free()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
-
返回
-
The allocated document, or
nullptr
if the allocation failed.
◆
Free()
Destructs documents allocated with
Alloc()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
-
参数
-
[in,out]
|
bl
|
The document to destruct. If the pointer is
nullptr
nothing happens. The pointer is assigned
nullptr
afterwards.
|
◆
Flush()
Empties the document; deletes and frees all resources used.
◆
GetNext()
Gets the next document in the list. Convenience version of
GeListNode::GetNext()
returning a pointer to a
BaseDocument
.
-
返回
-
The next document, or
nullptr
if there is none.
Cinema 4D
owns the pointed document.
◆
GetPred()
Gets the previous document in the list. Convenience version of
GeListNode::GetNext()
returning a pointer to a
BaseDocument
.
-
返回
-
The previous document, or
nullptr
if there is none.
Cinema 4D
owns the pointed document.
◆
GetData()
Gets the container settings of the specified
type
.
-
参数
-
[in]
|
type
|
Selects the type of settings to get for the document:
DOCUMENTSETTINGS
|
-
返回
-
The settings for the document.
◆
SetData()
Merges the container for the settings of the specified
type
.
-
参数
-
[in]
|
type
|
Selects the type of settings to merge for the document:
DOCUMENTSETTINGS
|
[in]
|
bc
|
The container to take the new settings from.
|
◆
GetSettingsInstance()
Gets a pointer to the container settings of the specified type. Changes to the pointed container are reflected in the document so it is not needed to call
SetData()
manually.
-
参数
-
[in]
|
type
|
Selects the type of settings to get for the document:
DOCUMENTSETTINGS
|
-
返回
-
The pointer to the settings container. The document owns the pointed container.
◆
GetNetRenderDocumentContext()
Retrieves a context on a client during a NET rendering.
-
由于
-
R16
-
返回
-
The information about the current NET rendering.
Cinema 4D
owns the pointed structure.
◆
SetNetRenderDocumentContext()
Sets the current context on a client during a NET rendering.
-
由于
-
R16
-
参数
-
[in]
|
context
|
The information about the current NET rendering. The caller owns the pointed structure.
|
◆
GetFirstObject()
Gets the first object of the document. The other objects in the document can be accessed with
BaseObject::GetNext()
,
BaseObject::GetPred()
,
BaseObject::GetDown()
etc.
-
返回
-
The first object of the document, or
nullptr
if there are no objects in the document. The document owns the pointed object.
◆
GetFirstMaterial()
Gets the first material of the document. The other materials in the document can be accessed with
BaseMaterial::GetNext()
and
BaseMaterial::GetPred()
.
-
返回
-
The first material of the document, or
nullptr
if there are no materials in the document. The document owns the pointed material.
◆
GetFirstRenderData()
Gets the first render data or options of the document. The other render settings in the document can be accessed by using the base class list functions,
RenderData::GetNext()
,
RenderData::GetPred()
,
RenderData::GetDown()
etc.
-
返回
-
The first render data of the document, or
nullptr
if there are no render data associated with the document. The document owns the pointed render data.
◆
GetFirstSceneHook()
Gets the first scene hook of the document.
-
返回
-
The first scene hook of the document.
◆
InsertObject()
Inserts the object into the document's object hierarchy.
Optionally the insertion position can either be specified by the
parent
parameter, inserting the object as the first child of the specified
parent
, or by the
pred
parameter, inserting the object below the specified
pred
对象。
If neither is given, the object is inserted at the top of the hierarchy.
-
注意
-
If both
parent
and
pred
are provided then
pred
has precedence.
-
参数
-
[in]
|
op
|
The object to insert into the document. The document takes over the ownership of the pointed object.
|
[in]
|
parent
|
An optional parent object in the document to insert the object as a child of. Can be
nullptr
. The caller owns the pointed object.
|
[in]
|
pred
|
An optional object in the document to use as insertion point. The caller owns the pointed object.
|
[in]
|
checknames
|
Deprecated
.
|
◆
InsertMaterial()
Inserts the material into the document's material list.
Optionally the insertion position can be specified by the
pred
parameter, giving the material before (just to the left of) the wanted position. Otherwise the material is inserted at the first position in the list.
-
参数
-
[in]
|
mat
|
The material to insert into the document. The document takes over the ownership of the pointed material.
|
[in]
|
pred
|
An optional material in the document to use as insertion point. The caller owns the pointed material.
|
[in]
|
checknames
|
Deprecated
.
|
◆
InsertRenderData()
Inserts the render data into the document's render settings hierarchy.
Optionally the insertion position can either be specified by the
parent
parameter, inserting the render data as the first child of the specified
parent
, or by the
pred
parameter, inserting the render data below the specified
pred
render data.
If neither is given, the render data is inserted at the top of the hierarchy.
-
参数
-
[in]
|
rd
|
The render data to insert. The document takes over the ownership of the pointed render data.
|
[in]
|
parent
|
An optional parent to insert the render data as a child of. The caller owns the pointed render data.
|
[in]
|
pred
|
An optional render data of the document to use as insertion point. The caller owns the pointed render data.
|
◆
InsertRenderDataLast()
Inserts the render data as last child into the document's render data list.
-
参数
-
[in]
|
rd
|
The render data to insert. The document takes over the ownership of the pointed render data.
|
◆
GetActiveObject()
Gets the active object in the document. This is the object the user has selected in the Object Manager.
-
返回
-
The active object, or
nullptr
if no object is active. The document owns the pointed object.
◆
GetActiveMaterial()
Gets the active material in the document. This is the material the user has selected in the Material Manager.
-
返回
-
The active material, or
nullptr
if no material is active or multiple are selected. The document owns the pointed material.
◆
GetActiveTag()
Gets the active tag in the document. This is the tag the user has selected in the Object Manager.
-
注意
-
Call
GetActiveTags()
to get multiple selections.
-
返回
-
The active tag, or
nullptr
if no tag is active. The document owns the pointed tag.
◆
GetActiveRenderData()
Gets the active render data for the document. These are the settings used for rendering the document.
-
返回
-
The active rendering settings. The document owns the pointed render data.
◆
GetRealActiveObject()
Gets the active object or the dummy axis if multiple objects are selected.
-
参数
-
[in]
|
help
|
Can be set to
nullptr
or for speedup purposes pass an array of active objects. The caller owns the pointed atom array.
|
[out]
|
multi
|
Assigned
true
if multiple objects are selected. Can be
nullptr
.
|
-
返回
-
The active object or the dummy axis if multiple objects are selected and
nullptr
if no object is selected. The document owns the pointed object.
◆
GetActiveObjects()
Gets the active object multi-selection and optionally the selection order and/or children.
-
参数
-
◆
GetActivePolygonObjects()
void GetActivePolygonObjects
|
(
|
AtomArray
&
|
selection
,
|
|
|
Bool
|
children
|
|
)
|
|
const
|
Gets the subset of polygon objects in the active object multi-selection.
-
参数
-
[out]
|
selection
|
Filled with the selected polygon objects.
|
[in]
|
children
|
若
true
then children are also added to selection, provided that they are selected. Otherwise only the topmost parent in each chain is added.
|
◆
GetActiveObjectsFilter()
Gets the active object multi-selection and removes objects that do not match the filter given by
type
and
instanceof
.
-
参数
-
[out]
|
selection
|
Filled with the selected objects.
|
[in]
|
children
|
若
true
then children are also added to selection, provided that they are selected. Otherwise only the topmost parent in each chain is added.
|
[in]
|
type
|
Checked against
C4DAtom::GetType()
. Pass
NOTOK
to ignore the test.
|
[in]
|
instanceof
|
Checked against
C4DAtom::IsInstanceOf()
. Pass NOTOK to ignore the test.
|
◆
GetActiveMaterials()
void GetActiveMaterials
|
(
|
AtomArray
&
|
selection
|
)
|
const
|
Gets the active material multi-selection.
-
参数
-
[out]
|
selection
|
Filled with the selected materials.
|
◆
GetActiveTags()
void GetActiveTags
|
(
|
AtomArray
&
|
selection
|
)
|
const
|
Gets the active tag multi-selection.
-
参数
-
[out]
|
selection
|
Filled with the selected tags.
|
◆
GetSelection()
void GetSelection
|
(
|
AtomArray
&
|
selection
|
)
|
const
|
Gets the active selection. This function deals with both objects and tags.
-
参数
-
[out]
|
selection
|
Filled with the objects and tags selection.
|
◆
SetActiveObject()
Modifies the current object multi-selection with
op
depending on
mode
.
-
参数
-
[in]
|
op
|
The object to use. Must be in the document already. The document owns the pointed object.
|
[in]
|
mode
|
The selection mode:
SELECTION
|
◆
SetActiveMaterial()
Modifies the current material multi-selection with
mat
depending on
mode
.
-
参数
-
[in]
|
mat
|
The material within the document that you want to make active. Must be in the document already. The document owns the pointed material.
|
[in]
|
mode
|
The selection mode:
SELECTION
|
◆
SetActiveTag()
Modifies the current tag multi-selection with
tag
depending on
mode
.
-
注意
-
This method also activates the object the tag is attached to if it was not previously activated.
-
参数
-
[in]
|
tag
|
The tag to make active. Must be in the document already. The document owns the pointed tag.
|
[in]
|
mode
|
The selection mode:
SELECTION
|
◆
SetActiveRenderData()
Sets the active render data for the document. These are the settings that are used for rendering.
-
参数
-
[in]
|
rd
|
The render data to make active. Must be in the document already. The document owns the pointed render data.
|
◆
SetSelection()
Sets the active selection. This function deals with both objects, tags and materials.
-
参数
-
[in]
|
bl
|
The baselist object within the document that you want to make active. Must be in the document already. The document owns the pointed base list object.
|
[in]
|
mode
|
The selection mode:
SELECTION
|
◆
SearchObject()
Searches for an object with the case sensitive name given.
-
参数
-
[in]
|
str
|
The case sensitive name of the object to search for.
|
-
返回
-
The found object, or
nullptr
if no object was found. The document owns the pointed object.
◆
SearchMaterial()
Searches for a material with the case sensitive name given.
-
参数
-
[in]
|
str
|
The case sensitive name of the material to search for.
|
-
返回
-
The found material, or
nullptr
of no material was found. The document owns the pointed material.
◆
GetChanged()
Checks if the document has been changed since it was last saved.
-
返回
-
true
if the document was changed, otherwise
false
.
◆
SetChanged()
Sets the changed state of the document to reflect it has been modified.
◆
GetDocumentName()
Gets the name of the document.
-
返回
-
The name of the file for the document.
◆
GetDocumentPath()
Gets the path of the document.
-
返回
-
The path of the file for the document. If the document has not been saved then the path is empty.
◆
SetDocumentName()
void SetDocumentName
|
(
|
const
Filename
&
|
fn
|
)
|
|
Sets the name of the document.
-
参数
-
[in]
|
fn
|
The new name for the document's file. Must contain the name part only.
|
◆
SetDocumentPath()
void SetDocumentPath
|
(
|
const
Filename
&
|
path
|
)
|
|
Sets the path of the document.
-
参数
-
[in]
|
path
|
The new path for the document's file. Must contain the path part only.
|
◆
GetLOD()
Gets the Level of Detail for the document.
-
返回
-
The Level of Detail for the document.
The default values are:
-
Low = 0.25
-
Medium = 0.5
-
High = 1.0
◆
SetLOD()
void SetLOD
|
(
|
Float
|
lod
|
)
|
|
Sets the Level of Detail for the document.
-
参数
-
[in]
|
lod
|
The Level of Detail to set for the document. The default values are:
-
Low = 0.25
-
Medium = 0.5
-
High = 1.0
|
◆
GetRenderLod()
Bool
GetRenderLod
|
(
|
void
|
|
)
|
|
Checks if the Level of Detail for rendering should be used in the editor.
-
返回
-
true
if using the render LOD, otherwise
false
.
◆
SetRenderLod()
void SetRenderLod
|
(
|
Bool
|
lod
|
)
|
|
Sets if the the Level of Detail for rendering should be used in the editor.
-
参数
-
[in]
|
lod
|
true
if the render LOD should be used, otherwise
false
.
|
◆
GetTime()
Gets the current time for the document's Timeline.
Here is how to get the current frame with
GetTime()
:
Int32
fps = doc.
GetFps
();
BaseTime
time = doc->
GetTime
();
frame = time.
GetFrame
(fps);
-
另请参阅
-
GetFps()
-
返回
-
The current time of the Timeline.
◆
SetTime()
Sets the current time for the document's Timeline.
-
另请参阅
-
GetTime()
-
警告
-
This method only changes the document time, it does not start a redraw and/or animation/expressions. This is done using a combination of the following functions:
ExecutePasses()
,
DrawViews()
and
EventAdd()
.
-
参数
-
[in]
|
t
|
The new current time of the Timeline.
|
◆
GetFps()
Int32
GetFps
|
(
|
void
|
|
)
|
const
|
Gets the number of frames per second (FPS).
-
注意
-
The framerate defined in the render settings is independent from the document framerate.
In the viewport, and for a render in the viewport, it will return the project's setting FrameRate.
Rendering elsewhere, it will return the
RenderData
FrameRate setting.
-
返回
-
The number of frames per second.
◆
SetFps()
void SetFps
|
(
|
Int32
|
fps
|
)
|
|
Sets the number of frames per second (FPS).
-
参数
-
[in]
|
fps
|
The new number of frames per second.
|
◆
GetMinTime()
Gets the starting time for the Timeline in the document.
-
返回
-
The starting time of the document's Timeline.
◆
SetMinTime()
Sets the starting time for the Timeline in the document.
-
参数
-
[in]
|
t
|
The new starting time of the document's Timeline.
|
◆
GetMaxTime()
Gets the ending time for for the Timeline in the document.
-
返回
-
The ending time of the document's Timeline.
◆
SetMaxTime()
Sets the ending time for the Timeline in the document.
-
另请参阅
-
BaseTime
for conversion of FPS or other time units.
-
GetFps()
-
参数
-
[in]
|
t
|
The new ending time of the document's Timeline.
|
◆
GetUsedMinTime()
Gets the lower bound of the range of time used by all sequences, tracks, keys etc. Optionally the calculation is done only for the given object
check
.
-
注意
-
Though the
check
parameter supports all kinds of nodes, the test when
check
==
nullptr
is only done for objects.
-
参数
-
[in]
|
check
|
An object to check or
nullptr
to check the document's objects.
|
-
返回
-
The minimal used time in the document.
◆
GetUsedMaxTime()
Gets the upper bound of the range of time used by all sequences, tracks, keys etc. Optionally the calculation is done only for the given object
check
.
-
注意
-
Though the
check
parameter supports all kinds of nodes, the test when
check
==
nullptr
is only done for objects.
-
参数
-
[in]
|
check
|
An object to check or
nullptr
to check the document's objects.
|
-
返回
-
The maximum used time in the document.
◆
GetLoopMinTime()
Gets the time of the left boundary of the document's loop or preview range.
-
返回
-
The starting time for the document's loop range.
◆
SetLoopMinTime()
void SetLoopMinTime
|
(
|
const
BaseTime
&
|
t
|
)
|
|
Sets the time of the left boundary of the document's loop or preview range.
-
参数
-
[in]
|
t
|
The new starting time for the document's loop range.
|
◆
GetLoopMaxTime()
Gets the time of the right boundary of the document's loop or preview range.
-
返回
-
The ending time for the document's loop range.
◆
SetLoopMaxTime()
void SetLoopMaxTime
|
(
|
const
BaseTime
&
|
t
|
)
|
|
Sets the time of the right boundary of the document's loop or preview range.
-
参数
-
[in]
|
t
|
The new ending time for the document's loop range.
|
◆
GetMode()
[1/2]
Int32
GetMode
|
(
|
void
|
|
)
|
const
|
Gets the main editor mode.
-
返回
-
The values for the editor mode are:
EditorModes
◆
SetMode()
[1/2]
Sets the main editor mode.
-
参数
-
◆
IsEditMode()
Bool
IsEditMode
|
(
|
void
|
|
)
|
const
|
Checks if the editor is in editable mode. It basically checks if
GetMode()
is
Mpoints
,
Medges
or
Mpolygons
.
-
返回
-
true
if the editor is in point/edge/poly editing mode, otherwise
false
.
◆
GetAction()
Int32
GetAction
|
(
|
void
|
|
)
|
const
|
Gets the current action tool in the editor.
-
返回
-
The return values are
ID_MODELING_MOVE
,
ID_MODELING_SCALE
,
ID_MODELING_ROTATE
etc.
◆
SetAction()
void SetAction
|
(
|
Int32
|
a
|
)
|
|
Sets the current action tool in the editor.
-
参数
-
◆
StartUndo()
Tells
Cinema 4D
to start building a list of undos into a single undo action for the user. This must be paired with an
EndUndo()
.
-
注意
-
Before calling
StartUndo()
in an asynchronous situation, do not forget to call
StopAllThreads()
-
返回
-
true
if the undo list was successfully started, otherwise
false
.
◆
EndUndo()
Ends the building of multiple undo actions into a single user undo. This must be paired with
StartUndo()
.
-
返回
-
true
if the undo list was successfully finished, otherwise
false
.
◆
AddUndo()
[1/2]
Adds an undo
type
to the list of undo operations started with
StartUndo()
.
-
注意
-
AddUndo()
always has to be called before a change is made.
In the case of the creation of a new object the call is done afterwards, after insertion into the document/object/track/sequence but before calling subsequent functions like
SetActiveObject()
which creates another undo:
BaseTag
* tag =
UVWTag::Alloc
();
op->
InsertTag
(tag);
doc->
AddUndo
(
UNDOTYPE::NEWOBJ
, tag);
-
参数
-
[in]
|
type
|
The values for the undo type are:
UNDOTYPE
|
[in]
|
data
|
The object the undo has been added for.
|
[in]
|
allowFromThread
|
If an undo is added from a thread this is not executed. (As a safety measure, because normally this does not make any sense.)
For explicit cases where a thread has to call
AddUndo()
(the view redraw and everything else is blocked) this can be set to
true
.
|
-
返回
-
true
if the change was successfully added to the undo list, otherwise
false
.
◆
AddUndo()
[2/2]
Adds an undo for a
BaseDraw
to the list of undo operations started with
StartUndo()
.
-
参数
-
[in]
|
bd
|
The base draw to add the change to the undo list.
|
-
返回
-
true
if the change for the base draw was successfully added to the undo list, otherwise
false
.
◆
DoUndo()
Perform an undo operation, same as the user doing
Undo
from within
Cinema 4D
's interface.
-
参数
-
[in]
|
multiple
|
This parameter only matters if
DoUndo()
is called between
AddUndo()
and
EndUndo()
.
若
multiple
is
true
then all the
AddUndo()
steps will be undone. Otherwise only the last
AddUndo()
step will be undone.
In addition if
multiple
is set then
EndUndo()
will be invoked internally so if further undos are to be created after this point
StartUndo()
must be called afterwards.
若
EndUndo()
has been called then all steps are always undone regardless of this setting.
|
-
返回
-
true
if the undo list was successfully undone, otherwise
false
.
◆
DoRedo()
Performs a redo operation (undo the last undo).
-
注意
-
DoRedo()
must always be called after
EndUndo()
.
-
返回
-
true
if the last undo was successfully undone, otherwise
false
.
◆
FlushUndoBuffer()
void FlushUndoBuffer
|
(
|
Bool
|
lastEntryOnly
=
false
|
)
|
|
Flushes the complete undo + redo buffer.
-
警告
-
Only call when absolutely needed.
-
参数
-
[in]
|
lastEntryOnly
|
If true only the last or currently ongoing undo is removed, e.g. when an operation failed. Otherwises flushes the complete undo and redo buffer.
|
◆
GetUndoPtr()
Gets the element (object, tag, material, etc.) of the last undo action.
E.g. if you have added a
BaseObject
undo you can retrieve the object by calling
GetUndoPtr()
but always be sure to check the type of the result first.
-
返回
-
The last undo element. The document owns the pointed element.
◆
FindUndoPtr()
Finds the last undo state of the
Cinema 4D
element
bl
(object, tag, material, etc.) for the specified undo
type
.
For instance here is how to retrieve the pre-undo object after a change has been made:
BaseObject
* preundo = (
BaseObject
*)doc->
FindUndoPtr
(op,
UNDOTYPE::CHANGE
);
-
参数
-
[in]
|
bl
|
The element to obtain the last undo action.
|
[in]
|
type
|
The undo type to check:
UNDOTYPE
|
-
返回
-
The last undo state of the element.The document owns the pointed element.
◆
AutoKey()
Compares the object chain
op
to object chain
undo
and sets keyframes for all the changes.
-
参数
-
[in]
|
undo
|
The object chain to compare to. The caller owns the pointed object chain.
|
[in,out]
|
op
|
The object chain to add the keys to. The caller owns the pointed object chain.
|
[in]
|
recursive
|
若
true
then the function applies to all children of
op
as well. The hierarchy of
op
and
undo
must match.
|
[in]
|
pos
|
若
true
keyframes are added for differences in position.
|
[in]
|
scale
|
若
true
keyframes are added for differences in scale.
|
[in]
|
rot
|
若
true
keyframes are added for differences in rotation.
|
[in]
|
param
|
若
true
keyframes are added for differences in parameters.
|
[in]
|
pla
|
若
true
keyframes are added as PLA for differences in point positions.
|
◆
RecordKey()
Records a key for
op
at
time
.
-
参数
-
[in,out]
|
op
|
The object to record.
|
[in]
|
time
|
The time to record.
|
[in]
|
id
|
The description ID to record.
|
[in]
|
undo
|
The object in
op
in the old state. This is necessary e.g. for auto-keyframing so that
Cinema 4D
can compare values. Usually this is the object from the undo buffer.
To record keys without auto-keyframing then
nullptr
can be passed.
|
[in]
|
eval_attribmanager
|
若
true
Attribute Manager is evaluated.
|
[in]
|
autokeying
|
若
true
auto-keyframing is used and
undo
needs to be passed for comparison.
|
[in]
|
allow_linking
|
若
true
and a Y key will be generated in auto-keyframing, then automatically the
X
and
Z
components will be completed. If
false
then only the
Y
key will be generated.
|
-
返回
-
true
if the key was successfully recorded, otherwise
false
.
◆
Record()
Records the active objects.
-
注意
-
Same as pushing the "Record Active Objects" button in the user interface.
◆
GetActiveBaseDraw()
Gets the activate
BaseDraw
in the editor.
-
返回
-
The active view in the editor or
nullptr
if there is no active view. The document owns the pointed view.
◆
GetRenderBaseDraw()
Gets the
BaseDraw
the user has chosen as
渲染
视图
in the editor (see
视图
menu in
Cinema 4D
).
-
返回
-
The render view in the editor or
nullptr
if there is no render view. The document owns the pointed view.
◆
GetBaseDraw()
Gets the
BaseDraw
from one of the editor views.
-
参数
-
-
返回
-
The requested view in the editor, or
nullptr
if it is not available. The document owns the pointed view.
◆
GetBaseDrawCount()
Int32
GetBaseDrawCount
|
(
|
|
)
|
|
Gets the number of views in the editor.
-
注意
-
While this function may sound trivial and cheap, internally it is not. For performance reasons, it is not recommended to use this function inside a loop or inside a loop condition.
-
返回
-
The
BaseDraw
count in the editor.
◆
ForceCreateBaseDraw()
void ForceCreateBaseDraw
|
(
|
void
|
|
)
|
|
Call this method to Make sure that GetBaseDraw(0) is accessible. This is only important in import filters where, at the time, there are no valid drawing views.
◆
GetDrawTime()
Gets the editor redraw time.
-
返回
-
The editor redraw time.
◆
GetDefaultClippingPlanes()
void GetDefaultClippingPlanes
|
(
|
Float
&
|
nearPlane
,
|
|
|
Float
&
|
farPlane
,
|
|
|
const
GeData
*
|
preset
=
nullptr
|
|
)
|
|
const
|
Gets the default clipping planes for the document.
-
参数
-
[out]
|
nearPlane
|
Near plane.
|
[out]
|
farPlane
|
Far plane.
|
[in]
|
preset
|
If this is not nullptr, it must be an Int32 value which is any of the DOCUMENT_CLIPPING_PRESET_* constants.
|
◆
GetPickSession()
Gets the data structure of the current pick session.
-
返回
-
The data structure of the current pick session, or
nullptr
if there is none. The document owns the pointed pick session data.
◆
StartPickSession()
Starts a pick session.
-
参数
-
[in]
|
psd
|
The initialized data structure for the pick session. The caller owns the pointed pick session data.
|
◆
StopPickSession()
void StopPickSession
|
(
|
Bool
|
cancel
|
)
|
|
Ends the pick session. For instance after filling the pick session array.
-
参数
-
[in]
|
cancel
|
Pass
true
to cancel a pick session, for instance if an error occurred. Pass
false
if the pick session is ended regularly.
|
◆
AnimateObject()
Animates the object
op
in the document at the given
time
.
-
注意
-
Does not take expressions into account.
-
参数
-
[in]
|
op
|
The object to animate. The caller owns the pointed object.
|
[in]
|
time
|
The time at which
op
is animated.
|
[in]
|
flags
|
The animate flags:
ANIMATEFLAGS
|
◆
ExecutePasses()
Animates the current frame of the document. Send an update message using
EventAdd()
to update the editor afterwards.
-
参数
-
[in]
|
bt
|
The thread can either be
nullptr
(for the main
Cinema 4D
thread) or if you are within your own thread then you pass it. The caller owns the pointed thread.
|
[in]
|
animation
|
若
true
animations are evaluated.
|
[in]
|
expressions
|
若
true
expressions are evaluated.
|
[in]
|
caches
|
若
true
caches are evaluated.
|
[in]
|
flags
|
The build flags:
BUILDFLAGS
|
-
返回
-
true
if the passes were executed successfully, otherwise
false
.
◆
Polygonize()
Makes a clone of the document and turns all objects into polygon based objects.
-
参数
-
[in]
|
keepanimation
|
若
true
the animation is kept on the objects.
|
-
返回
-
The cloned polygon based document or
nullptr
if it failed. The caller owns the pointed document.
◆
CollectSounds()
Collects all enabled soundtracks and calculates the downmix of the tracks. The result is stored in
snd
.
-
参数
-
[out]
|
snd
|
The downmix of the collected soundtracks. The caller owns the pointed sound.
|
[in]
|
from
|
The starting time of for the downmix.
|
[in]
|
to
|
The ending time for the downmix.
|
-
返回
-
true
if collecting all the document's sounds was successful, otherwise
false
.
◆
FindSceneHook()
Finds a scene hook by ID.
-
参数
-
[in]
|
id
|
The scene hook ID.
|
-
返回
-
The found scene hook, or
nullptr
if there is no scene hook with the searched
id
. The document owns the pointed scene hook.
◆
GetSplinePlane()
Int32
GetSplinePlane
|
(
|
void
|
|
)
|
|
Gets the plane in which the splines are created, such as
XY
plane.
-
返回
-
The values for the spline planes are:
PRIM_PLANE_XY
,
PRIM_PLANE_ZY
and
PRIM_PLANE_XZ
.
◆
GetLayerObjectRoot()
Gets the list of layers in the document.
-
返回
-
The head of the list of the document's layers. The document owns the pointed list head.
◆
GetAllTextures()
[1/2]
Gets all used textures for the objects in
ar
.
-
参数
-
[in]
|
ar
|
An atom array. If
nullptr
, all used textures in the document will be returned.
|
-
返回
-
A container with all textures filename.
◆
GetAllTextures()
[2/2]
Gets all used textures for the objects in
ar
.
-
注意
-
若
isNet
is passed
true
then the function only delivers the textures of the current take. Set the parameter to
false
to get all.
-
参数
-
[in]
|
isNet
|
Pass
true
to retrieve the textures used in the current NET rendering.
|
[in]
|
ar
|
An atom array to get the textures for. If
nullptr
, all used textures in the document will be returned.
|
-
返回
-
A container with all textures filename.
◆
GetHighest()
Gets the first object in the Object Manager hierarchy of the specified
type
. It searches objects that are not deactivated in the Object Manager (set to red).
-
参数
-
[in]
|
type
|
The object type to search for.
|
[in]
|
editor
|
true
will search using the
editor
dot in the Object Manager,
false
will use the
render dot
.
|
-
返回
-
The first object of the requested
type
or
nullptr
if no object was found. The document owns the pointed object.
◆
GetDocPreviewBitmap()
Gets the preview bitmap of the document.
-
返回
-
The preview bitmap of the document. The document owns the pointed bitmap.
◆
GetHighlightedObjects()
void GetHighlightedObjects
|
(
|
AtomArray
&
|
selection
|
)
|
const
|
Private
.
◆
SetHighlightedObject()
Private
.
◆
SetHighlightedObjects()
Private
.
◆
GetDefaultKey()
Gets the document's default keying settings.
-
参数
-
[in]
|
pKey
|
Assigned the default keying settings.
Cinema 4D
owns the pointed key.
|
[in]
|
bOverdub
|
Assigned the document's default overdub.
|
-
返回
-
true
if the document's default keying settings were retrieved successfully, otherwise
false
.
◆
SetDefaultKey()
void SetDefaultKey
|
(
|
CKey
*
|
pKey
,
|
|
|
Bool
|
bOverdub
|
|
)
|
|
|
Sets the document's default keying settings.
-
参数
-
[in]
|
pKey
|
The new default keying settings.
Cinema 4D
owns the pointed key.
|
[in]
|
bOverdub
|
The new document's default overdub.
If a keyframe already exists, the existing keyframe's interpolation type will be maintained when a new keyframe is recorded (only the Value Key will be overwritten).
|
◆
IsCacheBuilt()
Bool
IsCacheBuilt
|
(
|
Bool
|
force
=
false
|
)
|
|
Private
.
◆
IsAxisEnabled()
Bool
IsAxisEnabled
|
(
|
void
|
|
)
|
|
Checks the state of the object axis modifier.
-
返回
-
true
if the object axis modifier is enabled, otherwise
false
.
◆
GetHelperAxis()
Gets the helper axis for the current multi-selection.
-
返回
-
The axis object. The document owns the pointed object.
◆
HandleSelectedTextureFilename()
Private
.
◆
ReceiveMaterials()
Private
.
◆
ReceiveNewTexture()
Private
.
◆
SendInfo()
Sends
MSG_DOCUMENTINFO
messages.
-
参数
-
[in]
|
type
|
The document info message type:
MSG_DOCUMENTINFO_TYPE
|
[in]
|
format
|
The file format: (Set for load, merge and before/after save only. Otherwise
NOTOK
.)
FORMAT_FILES
|
[in]
|
fn
|
The document filename.
|
-
注意
-
This is not always the same as the filename returned by
BaseDocument::GetDocumentPath()
.
e.g. for
MSG_DOCUMENTINFO_TYPE_SAVE_BEFORE
BaseDocument::GetDocumentPath()
still contains the old path whereas
fn
designates the real file.
-
参数
-
[in]
|
bl
|
The object/tag/material that got inserted. It is used if
type
is of one of the following values:
|
[in]
|
hooks_only
|
若
true
the message is sent to scene hooks only.
|
◆
RecordZero()
Private
.
◆
RecordNoEvent()
void RecordNoEvent
|
(
|
void
|
|
)
|
|
markPrivate
◆
SetRewind()
void SetRewind
|
(
|
Int32
|
flags
=
0
|
)
|
|
在
NodeData::SetDParameter()
some operators, objects etc. can call
doc
->
SetRewind()
so that
Cinema 4D
rewinds the whole document (from time
0
to current time) when the next event
EVMSG_CHANGE
or
DrawViews()
is processed.
-
参数
-
◆
GetTakeData()
Gets the take data for the document.
-
由于
-
R17.032
-
返回
-
The take data. The document owns the pointed take data.
◆
GetTargetObject()
Gets target object within a multi-selection.
-
由于
-
R17.032
-
注意
-
This is the last object selected and is used by commands such as Spline Boolean in order to allow the user to control which object will be used as the target for the command.
The target object displays in the Object Manager as highlighted.
-
返回
-
The target object, or
nullptr
if it fails or there is no selection.
◆
SetTargetObject()
Sets target object within a multi-selection.
-
由于
-
R17.032
-
注意
-
Implies selection of an object if it is not currently selected, adding it to the existing selection.
Moves the object to the very end of the list when calling
BaseDocument::GetActiveObjects
(
GETACTIVEOBJECTFLAGS::SELECTIONORDER
).
-
参数
-
[in]
|
op
|
The object to set as the target.
|
◆
GetSceneRepository()
maxon::Result
<const maxon::UpdatableAssetRepositoryRef&> GetSceneRepository
|
(
|
Bool
|
create
|
)
|
|
Returns the SceneRepository description.
-
参数
-
[in]
|
create
|
True to create if not existing.
|
-
返回
-
Reference to a repository on success.
◆
SetTemporaryManipulatorObject()
void SetTemporaryManipulatorObject
|
(
|
BaseObject
*
|
temp
|
)
|
|
@markprivate @Since R20.000
◆
GetTemporaryManipulatorObject()
BaseObject
* GetTemporaryManipulatorObject
|
(
|
|
)
|
const
|
@markprivate
-
由于
-
R20.000
◆
GetModeController()
maxon::DocumentModeControllerRef& GetModeController
|
(
|
|
)
|
|
@markprivate
-
由于
-
S22.000
◆
GetMode()
[2/2]
@markprivate
-
由于
-
S22.000
◆
SetMode()
[2/2]
@markprivate
-
由于
-
S22.000
@ CHANGE
Any change to an object, including hierarchy modifications; modification in positioning (object has b...
Bool AddUndo(UNDOTYPE type, void *data, Bool allowFromThread=false)
Int32 GetFrame(Float fps) const
定义:
c4d_basetime.h:107
BaseTime GetTime(void) const
static UVWTag * Alloc(Int32 count)
maxon::Int32 Int32
定义:
ge_sys_math.h:58
@ NEWOBJ
New object/material/tag etc. was created. (Needs to be called after action.)
BaseList2D * FindUndoPtr(BaseList2D *bl, UNDOTYPE type)
定义:
c4d_basedocument.h:1075
void InsertTag(BaseTag *tp, BaseTag *pred=nullptr)