#include <lib_takesystem.h>
Stores the Take System related data of a BaseDocument.
- See also
- The TakeData Manual overview article.
◆ TakeData()
◆ ~TakeData()
◆ Set()
Sets the internal document link for the TakeData. Private.
- Parameters
-
- Returns
- true if successful, otherwise false.
◆ GetDocument()
Retrieves the document for the TakeData.
- Returns
- The document, or nullptr if TakeData is not initialized. Cinema 4D owns the pointed BaseDocument.
◆ GetMainTake()
Retrieves the Main Take.
- Note
- Main Take is always the first under the header.
- Returns
- The Main Take. Must be !nullptr.
◆ GetTakeMode()
Retrieves the Take System global mode, can be TAKE_MODE::MANUAL or TAKE_MODE::AUTO.
- Note
- This mode affects how the user has to interact with GUI to override parameters.
- Returns
- The Take System mode: TAKE_MODE
◆ GetOverrideEnabling()
Retrieves the ability for the Take System to override a specific kind of node based on global switch.
- Returns
- The Take System override enabling: OVERRIDEENABLING
◆ CheckOverrideEnabling()
◆ GetTakeSelection()
Retrieves all the selected Takes.
- Parameters
-
[in] | selection | An AtomArray to be filled with the selected Takes. |
[in] | children | If true also selected Take children are collected. |
◆ GetCurrentTake()
Retrieves a pointer to the current Take.
- Returns
- The current Take, or nullptr if any error. Cinema 4D owns the pointed BaseTake.
◆ SetCurrentTake()
Sets the current 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] | take | The Take to set. If nullptr is passed the Main Take will be set. The caller owns the pointed BaseTake. |
- Returns
- true if successful, otherwise false.
◆ TakeToDocument()
Isolates a Take in a new document.The new document will be allocated and filled by the function.
- Note
- The caller has to insert the document if necessary.
- Parameters
-
[in] | take | The Take to isolate. The caller owns the pointed BaseTake. |
- Returns
- The allocated BaseDocument.
◆ SaveTakesWithAssets()
Bool SaveTakesWithAssets |
( |
Bool |
selected | ) |
|
Executes a "Save Project With Assets" for Takes in document with each saved file representing a Take.
- Parameters
-
[in] | selected | If true only selected Takes are exported otherwise all. |
- Returns
- true if successful, otherwise false.
◆ AddTake()
Creates and inserts a new 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).
- Warning
- Selections have to be handled manually.
- Parameters
-
[in] | name | The name of the Take to add. If an empty string is passed default Take name will be used. |
[in] | parent | Optionally pass a parent Take otherwise new Take will be added at the end of the list under the Main Take. The caller owns the pointed BaseTake. |
[in] | cloneFrom | Optionally pass a Take the new Take will be cloned from. The caller owns the pointed BaseTake. |
- Returns
- The new Take. Must be !nullptr.
◆ DeleteTake()
Deletes a Take and all connected overrides. If Take is the current the Main Take will be set as current.
- 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] | take | The Take to delete. The caller owns the pointed BaseTake. |
◆ InsertTake()
Moves a Take in the hierarchy in a safe way.
The Take system has several hierarchy dependencies.
If a Take is moved while it is current or while it is a child of the Current Take then this would need to manually take care of all data sorting and handling.
This function do all this work for you.
- 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] | takeToMove | The Take to move. The caller owns the pointed BaseTake. |
[in] | destTake | The parent destination Take. If nullptr the Main Take will be used. In this case NOTOK can be used as the insert mode to add the take as the last child of the main take. The caller owns the pointed BaseTake. |
[in] | insertMode | The insertion mode. Can be INSERT_BEFORE or INSERT_AFTER or INSERT_UNDER. |
◆ FindOverrideCounterPart()
Finds the backup node that fits with an Override (for example the backup node in the Main Take).
- Parameters
-
[in] | overrideNode | The original Override node. The caller owns the pointed BaseOverride. |
[in] | descID | The description ID to check. |
[out] | resultTake | The Take that owns the returned node, or nullptr if no counterpart found. Cinema 4D owns the pointed BaseOverride. |
- Returns
- The counterpart node, or nullptr if any error.
◆ SendNodeToRepository()
◆ GetNodeFromRepository()
◆ GetUndoState()
Gets the state of automatic Take undo.
- Note
- It is useful to deactivate undo when working on document clones in several situation like import/export operations where undo is not important.
- Returns
- true if the automatic undo is active, otherwise false.
◆ SetUndoState()
void SetUndoState |
( |
Bool |
state | ) |
|
Activates or deactivates the state of automatic Take undo.
- Note
- It is useful to deactivate undo when working on document clones in several situation like import/export operations where undo is not important.
- Parameters
-
[in] | state | true if the automatic undo has to be used, otherwise false. |
◆ ResetSystem()
Resets completely the Take System. Usually not needed.
- Warning
- All data not in the current state of the document are deleted.