BaseTake Class Reference

#include <lib_takesystem.h>

Inheritance diagram for BaseTake:

Detailed Description

Represents a Take of the Take System. It stores BaseOverride objects that define how a specific entity is changed in a Take.

Note
To retrieve the Take System for a document simply call BaseDocument::GetTakeData().
See also
The BaseTake Manual overview article.

Private Member Functions

 BaseTake ()
 
 ~BaseTake ()
 

Navigation

BaseTakeGetNext () const
 
BaseTakeGetPred () const
 
BaseTakeGetUp () const
 
BaseTakeGetDown () const
 
BaseTakeGetDownLast () const
 

Miscellaneous

Bool IsMain ()
 
Bool SearchHierarchy (BaseTake *op)
 
void Reset ()
 

Override

Bool GetOverrides (AtomArray &selection)
 
Bool GetOverrideGroups (AtomArray &selection)
 
BaseOverrideFindOrAddOverrideParam (TakeData *takeData, BaseList2D *node, const DescID &descID, const GeData &overrideValue, const GeData &backupValue=GeData(), Bool deleteAnim=false)
 
BaseOverrideOverrideNode (TakeData *takeData, BaseList2D *node, Bool deleteAnim)
 
void AutoTake (TakeData *takeData, BaseList2D *node, BaseList2D *undo)
 
void DeleteOverride (TakeData *takeData, BaseList2D *node, const DescID &descID)
 
BaseOverrideFindOverride (TakeData *takeData, BaseList2D *node)
 
BaseOverrideFindOverrideInHierarchy (TakeData *takeData, BaseList2D *node, const DescID &descID, BaseTake *&resultTake)
 
BaseOverrideGroupAddOverrideGroup ()
 
BaseOverrideGroupGetFirstOverrideGroup ()
 
void DeleteOverrideGroup (TakeData *takeData, BaseOverrideGroup *og)
 

Camera

BaseObjectGetCamera (TakeData *takeData)
 
BaseObjectGetEffectiveCamera (TakeData *takeData, BaseTake *&resultTake)
 
void SetCamera (TakeData *takeData, BaseObject *camera)
 

RenderData

RenderDataGetRenderData (TakeData *takeData)
 
RenderDataGetEffectiveRenderData (TakeData *takeData, BaseTake *&resultTake)
 
void SetRenderData (TakeData *takeData, RenderData *rData)
 

Checked

Bool IsChecked ()
 
void SetChecked (Bool status)
 

Additional Inherited Members

- Public Member Functions inherited from BaseList2D
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 CharGetViewportRenderId (VIEWPORT_RENDER_ID typeId) const
 
BaseList2DGetNext ()
 
const BaseList2DGetNext () const
 
BaseList2DGetPred ()
 
const BaseList2DGetPred () const
 
BaseContainer GetData ()
 
void SetData (const BaseContainer &bc, Bool add=true)
 
const BaseContainerGetDataInstanceRef () const
 
BaseContainerGetDataInstanceRef ()
 
const BaseContainerGetDataInstance () const
 
BaseContainerGetDataInstance ()
 
String GetName () const
 
void SetName (const maxon::String &name, Bool setDirty=true)
 
String GetBubbleHelp ()
 
Bool TransferGoal (BaseList2D *dst, Bool undolink)
 
Bool TransferMarker (BaseList2D *dst) const
 
Bool CopyDynamicDescriptionFrom (const BaseList2D *src)
 
Bool Scale (Float scale)
 
Bool Edit ()
 
void GetIcon (IconData *dat)
 
GeListHeadGetNLARoot (Bool create)
 
BaseList2DAnimationLayerRemap (BaseObject **layer=nullptr)
 
String GetTypeName () const
 
BaseList2DGetMain () const
 
void InsertTrackSorted (CTrack *track)
 
Bool AddEventNotification (BaseList2D *bl, NOTIFY_EVENT eventid, NOTIFY_EVENT_FLAG flags, const BaseContainer *data)
 
Bool RemoveEventNotification (const BaseDocument *doc, BaseList2D *bl, NOTIFY_EVENT eventid)
 
Bool FindEventNotification (const BaseDocument *doc, BaseList2D *bl, NOTIFY_EVENT eventid)
 
Bool SetDescIDState (const DescID &id, DESCIDSTATE descidstate)
 
DESCIDSTATE GetDescIDState (const DescID &id, Bool tolerant) const
 
GeListHeadGetOverrideRoot (Bool create)
 
BaseOverrideGetFirstOverride ()
 
GeListHeadGetShaderRepositoryRoot (Bool create)
 
GeListHeadGetHiddenShaderRoot (Bool create)
 
maxon::NimbusForwardRef GetNimbusRef (const maxon::Id &spaceId) const
 
maxon::Result< maxon::NimbusForwardRefPrivateGetOrCreateNimbusRef (const maxon::Id &spaceId)
 
void RemoveNimbusRef (const maxon::Id &spaceId)
 
maxon::Result< maxon::HashMap< maxon::Id, maxon::NimbusForwardRef > > GetAllNimbusRefs () const
 
Bool IsNodeBased () const
 
maxon::Result< BoolGetAccessedObjects (METHOD_ID method, AccessedObjectsCallback &access) const
 
maxon::Result< BoolGetAccessedObjectsRec (ACCESSED_OBJECTS_MASK read, ACCESSED_OBJECTS_MASK write, METHOD_ID method, Bool withSiblings, Bool withChildren, AccessedObjectsCallback &access) const
 
maxon::Result< BoolGetAccessedObjectsOfHierarchy (ACCESSED_OBJECTS_MASK read, ACCESSED_OBJECTS_MASK write, METHOD_ID method, AccessedObjectsCallback &access) const
 
maxon::Result< BoolGetAccessedObjectsOfChildren (ACCESSED_OBJECTS_MASK read, ACCESSED_OBJECTS_MASK write, METHOD_ID method, AccessedObjectsCallback &access) const
 
maxon::Result< BoolGetAccessedObjectsOfFirstChildHierarchy (ACCESSED_OBJECTS_MASK read, ACCESSED_OBJECTS_MASK write, METHOD_ID method, AccessedObjectsCallback &access) const
 
maxon::Result< maxon::GenericDataGroupChanges ()
 
void GetMarkerStampEx (UInt32 *l1, UInt32 *l2)
 
const GeMarkerGetMarker () 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 (const 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) const
 
BaseShaderGetFirstShader () const
 
void InsertShader (BaseShader *shader, BaseShader *pred=nullptr)
 
void ClearKeyframeSelection ()
 
Bool FindKeyframeSelection (const DescID &id)
 
Bool SetKeyframeSelection (const DescID &id, Bool selection)
 
Bool KeyframeSelectionContent ()
 
LayerObjectGetLayerObject (const BaseDocument *doc)
 
const LayerObjectGetLayerObject (const BaseDocument *doc) const
 
Bool SetLayerObject (const LayerObject *layer)
 
const LayerDataGetLayerData (const BaseDocument *doc, Bool rawdata=false) const
 
Bool SetLayerData (BaseDocument *doc, const LayerData &data)
 
GeListHeadGetCTrackRoot (Bool create)
 
const GeListHeadGetCTrackRoot () const
 
CTrackGetFirstCTrack ()
 
const CTrackGetFirstCTrack () const
 
CTrackFindCTrack (const DescID &id)
 
const CTrackFindCTrack (const DescID &id) const
 
- Public Member Functions inherited from GeListNode
GeListNodeGetNext ()
 
const GeListNodeGetNext () const
 
GeListNodeGetPred ()
 
const GeListNodeGetPred () const
 
GeListNodeGetDown ()
 
const GeListNodeGetDown () const
 
GeListNodeGetUp ()
 
const GeListNodeGetUp () const
 
GeListNodeGetDownLast ()
 
const GeListNodeGetDownLast () const
 
void InsertBefore (GeListNode *bl)
 
void InsertAfter (GeListNode *bl)
 
void InsertUnder (GeListNode *bl)
 
void InsertUnderLast (GeListNode *bl)
 
void Remove ()
 
void FlushChilds ()
 
void MoveChildrenTo (GeListNode *dest)
 
GeListHeadGetListHead ()
 
const GeListHeadGetListHead () const
 
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)
 
GeListNodeGetCustomData ()
 
const GeListNodeGetCustomData () const
 
const BaseDocumentGetDocument () const
 
BaseDocumentGetDocument ()
 
maxon::Result< BoolGetBranchInfo (const maxon::ValueReceiver< const BranchInfo & > &info, GETBRANCHINFO flags) const
 
Bool IsDocumentRelated () const
 
Int32 GetInfo () const
 
Bool GetNBit (NBIT bit) const
 
UInt32 GetNBitMask (Int32 index) const
 
Bool ChangeNBit (NBIT bit, NBITCONTROL bitmode)
 
- Public Member Functions inherited from C4DAtom
Int32 GetType () const
 
Int32 GetRealType () const
 
Int32 GetDiskType () const
 
Bool IsInstanceOf (Int32 id) const
 
Int32 GetClassification () const
 
Bool Message (Int32 type, void *data=nullptr)
 
Bool MultiMessage (MULTIMSG_ROUTE flags, Int32 type, void *data)
 
C4DAtomGetClone (COPYFLAGS flags, AliasTrans *trn) const
 
Bool CopyTo (C4DAtom *dst, COPYFLAGS flags, AliasTrans *trn) const
 
Bool Read (HyperFile *hf, Int32 id, Int32 level)
 
Bool Write (HyperFile *hf) const
 
Bool ReadObject (HyperFile *hf, Bool readheader)
 
Bool WriteObject (HyperFile *hf) const
 
Bool GetDescription (Description *description, DESCFLAGS_DESC flags) const
 
Bool GetParameter (const DescID &id, GeData &t_data, DESCFLAGS_GET flags) const
 
Bool SetParameter (const DescID &id, const GeData &t_data, DESCFLAGS_SET flags)
 
DynamicDescriptionGetDynamicDescriptionWritable ()
 
const DynamicDescriptionGetDynamicDescription () const
 
Bool CopyDynamicDescriptionFrom (const BaseList2D *src)
 
Bool GetEnabling (const DescID &id, const GeData &t_data, DESCFLAGS_ENABLE flags, const BaseContainer *itemdesc) const
 
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 Public Member Functions inherited from BaseList2D
static BaseList2DAlloc (Int32 type)
 
static void Free (BaseList2D *&bl)
 
- Static Public Attributes inherited from BaseList2D
static const Int32 SETBIT_FLAG_NODIRTY
 
static const Int32 SETBIT_FLAG_REMOVE
 

Constructor & Destructor Documentation

◆ BaseTake()

BaseTake ( )
private

◆ ~BaseTake()

~BaseTake ( )
private

Member Function Documentation

◆ GetNext()

BaseTake* GetNext ( ) const

Gets the next Take in the list. Convenience version of GeListNode::GetNext() returning a BaseTake*.

Returns
The next Take, or nullptr if there is none. Cinema 4D owns the pointed BaseTake.

◆ GetPred()

BaseTake* GetPred ( ) const

Gets the previous Take in the list. Convenience version of GeListNode::GetPred() returning a BaseTake*.

Returns
The previous Take, or nullptr if there is none. Cinema 4D owns the pointed BaseTake.

◆ GetUp()

BaseTake* GetUp ( ) const

Gets the parent Take of the list node. Convenience version of GeListNode::GetUp() returning a BaseTake*.

Returns
The parent Take, or nullptr if there is none. Cinema 4D owns the pointed BaseTake.

◆ GetDown()

BaseTake* GetDown ( ) const

Gets the first child Take of the list node. Convenience version of GeListNode::GetDown() returning a BaseTake*.

Returns
The first child Take, or nullptr if there is none. Cinema 4D owns the pointed BaseTake.

◆ GetDownLast()

BaseTake* GetDownLast ( ) const

Gets the last child Take of the list node. Convenience version of GeListNode::GetDownLast() returning a BaseTake*.

Returns
The last child Take, or nullptr if there is none. Cinema 4D owns the pointed BaseTake.

◆ IsMain()

Bool IsMain ( )

Checks if the Take is the Main Take.

Returns
true if the Take is the Main Take, otherwise false.

◆ SearchHierarchy()

Bool SearchHierarchy ( BaseTake op)

Checks if the Take is a child of op.

Parameters
[in]opThe Take to search within his hierarchy. The caller owns the pointed BaseTake.
Returns
true if the Take is child of op, otherwise false.

◆ GetOverrides()

Bool GetOverrides ( AtomArray selection)

Retrieves all Override nodes owned by the Take.

Parameters
[out]selectionThe AtomArray to be filled.
Returns
true if successful, otherwise false.

◆ GetOverrideGroups()

Bool GetOverrideGroups ( AtomArray selection)

Retrieves all Override Groups nodes owned by the Take.

Parameters
[out]selectionThe AtomArray to be filled.
Returns
true if successful, otherwise false.

◆ FindOrAddOverrideParam()

BaseOverride* FindOrAddOverrideParam ( TakeData takeData,
BaseList2D node,
const DescID descID,
const GeData overrideValue,
const GeData backupValue = GeData(),
Bool  deleteAnim = false 
)

Searches if parameter with descID is Overridden. If not adds a new Override with passed value for the Take.
If the BaseOverride node does not exist the function automatically allocates and inserts it, plus takes care to backup data properly in parent or Main Take.

Note
An undo step is added automatically if the call is added from the main (GUI) thread and global undo is allowed (see TakeData::GetUndoState/ TakeData::SetUndoState).
Parameters
[in]takeDataThe Take System context. The caller owns the pointed TakeData.
[in]nodeThe scene node to override. The caller owns the pointed BaseList2D.
[in]descIDThe parameter DescID to override.
[in]overrideValueThe initial value to set in the overrides for the Take.
[in]backupValueOptionally provide the backup value for the Main/parent Take. Mandatory to set this for parameters not from the GUI.
[in]deleteAnimIf true and original parameter in the scene is animated the animation will be removed in the resulting Override.
Returns
The found or newly created BaseOverride node, or nullptr if any error.

◆ OverrideNode()

BaseOverride* OverrideNode ( TakeData takeData,
BaseList2D node,
Bool  deleteAnim 
)

Overrides all parameters of passed node in the Take.

Note
An undo step is added automatically if the call is added from the main (GUI) thread and global undo is allowed (see TakeData::GetUndoState/ TakeData::SetUndoState).
Parameters
[in]takeDataThe Take System context. The caller owns the pointed TakeData.
[in]nodeThe scene node to override. The caller owns the pointed BaseList2D.
[in]deleteAnimIf true and original parameter in the scene is animated the animation will be removed in the resulting Override.
Returns
The newly created BaseOverride node, or nullptr if any error.

◆ AutoTake()

void AutoTake ( TakeData takeData,
BaseList2D node,
BaseList2D undo 
)

Compares nodes and automatically generates overrides for different parameters in the Take.

Parameters
[in]takeDataThe Take System context. The caller owns the pointed TakeData.
[in]nodeThe scene node to override. The caller owns the pointed BaseList2D.
[in]undoThe node to compare with. The caller owns the pointed BaseList2D.

◆ DeleteOverride()

void DeleteOverride ( TakeData takeData,
BaseList2D node,
const DescID descID 
)

Deletes a single parameter override for node with descID. If the Override results empty (no more overridden parameters) then it will be deleted too.

Note
An undo step is added automatically if the call is added from the main (GUI) thread and global undo is allowed (see TakeData::GetUndoState/ TakeData::SetUndoState).
Parameters
[in]takeDataThe Take System context. The caller owns the pointed TakeData.
[in]nodeThe scene node to delete the parameter for. The caller owns the pointed BaseList2D.
[in]descIDThe parameter DescID to be deleted.

◆ FindOverride()

BaseOverride* FindOverride ( TakeData takeData,
BaseList2D node 
)

Searches if node is overridden in the Take.

Parameters
[in]takeDataThe Take System context. The caller owns the pointed TakeData.
[in]nodeThe node to search the BaseOverride for. The caller owns the pointed BaseList2D.
Returns
The BaseOverride if found, otherwise nullptr.

◆ FindOverrideInHierarchy()

BaseOverride* FindOverrideInHierarchy ( TakeData takeData,
BaseList2D node,
const DescID descID,
BaseTake *&  resultTake 
)

Searches if node parameter with descID is overridden in the Take or in a parent.

Parameters
[in]takeDataThe Take System context. The caller owns the pointed TakeData.
[in]nodeThe node to search the BaseOverride for. The caller owns the pointed BaseList2D.
[in]descIDThe parameter DescID to search for.
[out]resultTakeFilled with The Take that owns the Override. Can be equal to *this or nullptr if the Override is not found. The caller owns the pointed BaseTake.
Returns
The BaseOverride if found, otherwise nullptr.

◆ AddOverrideGroup()

BaseOverrideGroup* AddOverrideGroup ( )

Adds a new Override Group to the Take.

Note
An undo step is added automatically if the call is added from the main (GUI) thread and global undo is allowed (see TakeData::GetUndoState/ TakeData::SetUndoState).
Returns
The added Override Group, or nullptr if any error.

◆ GetFirstOverrideGroup()

BaseOverrideGroup* GetFirstOverrideGroup ( )

Gets the first Override Group in the Take.

Returns
The first Override Group, or nullptr if there is none.

◆ DeleteOverrideGroup()

void DeleteOverrideGroup ( TakeData takeData,
BaseOverrideGroup og 
)

Deletes an Override Group from the Take.

Note
An undo step is added automatically if the call is added from the main (GUI) thread and global undo is allowed (see TakeData::GetUndoState/ TakeData::SetUndoState).
Parameters
[in]takeDataThe Take System context. The caller owns the pointed TakeData.
[in]ogThe Override Group to be deleted. The caller owns the pointed BaseOverrideGroup.

◆ GetCamera()

BaseObject* GetCamera ( TakeData takeData)

Gets the camera for the Take.

Note
Can return the default camera.
Parameters
[in]takeDataThe Take System context. The caller owns the pointed TakeData.
Returns
The camera assigned to the Take, or nullptr if the Take uses the camera from a parent Take.

◆ GetEffectiveCamera()

BaseObject* GetEffectiveCamera ( TakeData takeData,
BaseTake *&  resultTake 
)

Gets the camera used by the Take even if it comes from a parent Take.

Note
Can return the default camera.
Parameters
[in]takeDataThe Take System context. The caller owns the pointed TakeData.
[out]resultTakeThe Take the camera comes from. Cinema 4D owns the pointed BaseTake.
Returns
The camera used by the Take.

◆ SetCamera()

void SetCamera ( TakeData takeData,
BaseObject camera 
)

Sets the camera for the Take.

Note
Can be the default camera.
Parameters
[in]takeDataThe Take System context. The caller owns the pointed TakeData.
[in]cameraThe camera to set, or nullptr to reset and use one from a parent Take.

◆ GetRenderData()

RenderData* GetRenderData ( TakeData takeData)

Gets the RenderData for the Take.

Parameters
[in]takeDataThe Take System context. The caller owns the pointed TakeData.
Returns
The RenderData assigned to the Take, or nullptr if the Take uses the RenderData from a parent Take.

◆ GetEffectiveRenderData()

RenderData* GetEffectiveRenderData ( TakeData takeData,
BaseTake *&  resultTake 
)

Gets the RenderData used by the Take even if it comes from a parent Take.

Parameters
[in]takeDataThe Take System context. The caller owns the pointed TakeData.
[out]resultTakeThe Take the RenderData come from. Cinema 4D owns the pointed BaseTake.
Returns
The RenderData used by the Take.

◆ SetRenderData()

void SetRenderData ( TakeData takeData,
RenderData rData 
)

Sets the RenderData for the Take.

Parameters
[in]takeDataThe Take System context. The caller owns the pointed TakeData.
[in]rDataThe RenderData to set, or nullptr to reset and use one from a parent Take. The caller owns the pointed RenderData.

◆ IsChecked()

Bool IsChecked ( )

Gets the mark status of the Take used for rendering and export operations.

Returns
true if the Take is marked, otherwise false.

◆ SetChecked()

void SetChecked ( Bool  status)

Sets the mark status of the Take used for rendering and export operations.

Parameters
[in]statusIf true the Take will be marked otherwise the mark will be removed.

◆ Reset()

void Reset ( )

Resets all sub-structures and Overrides for the Take.

Warning
All data not in the current state of the document are deleted.