About
A TakeData object stores the take system related data of a BaseDocument.
Access
A TakeData object is returned by the host BaseDocument:
- BaseDocument::GetTakeData(): Returns the document's TakeData object.
TakeData*
const takeData =
doc->GetTakeData();
if (takeData == nullptr)
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:69
const char * doc
Definition: pyerrors.h:226
Read-Only Properties
The TakeData object allows access to its parent document and to different settings of the Take Manager.
- TakeData::GetOverrideEnabling(): Returns the bitmask for the current override modes.
- TakeData::CheckOverrideEnabling(): Checks if a specific override mode is enabled.
- TakeData::GetDocument(): Returns the BaseDocument for this TakeData.
- TakeData::GetTakeMode(): Returns the document's take mode:
- TAKE_MODE::MANUAL : Parameters are not editable and overrides must be created manually.
- TAKE_MODE::AUTO : Parameters are editable and overrides are created on change.
- Note
- The take mode can be toggled with command 431000081. See Command Utility Manual.
Takes
Accessing Takes
Existing takes are accessed from the TakeData object:
- TakeData::GetMainTake(): Returns the main take.
- TakeData::GetCurrentTake(): Returns the currently selected take.
- TakeData::SetCurrentTake(): Sets the given take as the current take.
- TakeData::GetTakeSelection(): Gets the selection of takes.
BaseTake* const currentTake = takeData->GetCurrentTake();
if (currentTake == nullptr)
if (currentTake->IsMain() == false)
{
BaseTake* const mainTake = takeData->GetMainTake();
takeData->SetCurrentTake(mainTake);
}
Create Takes
The TakeData object creates and deletes takes:
- TakeData::AddTake(): Adds a new take.
- TakeData::InsertTake(): Moves a take in the hierarchy.
- TakeData::DeleteTake(): Deletes the given take.
- TakeData::ResetSystem(): Deletes all takes.
TakeData*
const takeData =
doc->GetTakeData();
if (takeData == nullptr)
BaseTake* const newTake = takeData->AddTake("This is a new take", nullptr, nullptr);
if (newTake == nullptr)
takeData->SetCurrentTake(newTake);
Overrides
The TakeData object also provides access to the override backup for a given override and parameter:
- TakeData::FindOverrideCounterPart(): Returns the BaseOverride and BaseTake that stores the backup value.
BaseTake* const take = takeData->GetCurrentTake();
if (take == nullptr)
if (take->IsMain())
BaseOverride* const baseOverride = take->FindOverride(takeData, material);
if (baseOverride == nullptr)
BaseOverride*
const backup = takeData->FindOverrideCounterPart(baseOverride,
id,
result);
if (backup == nullptr)
GeData data;
backup->UpdateSceneNode(takeData, id);
NONE
Definition: asset_browser.h:1
PyObject PyObject * result
Definition: abstract.h:43
return OK
Definition: apibase.h:2740
@ DTYPE_COLOR
Color.
Definition: lib_description.h:56
#define ConstDescID(...)
Definition: lib_description.h:592
@ MATERIAL_COLOR_COLOR
Definition: mmaterial.h:56
Undo States
Several functions of the Take system like TakeData::AddTake() or TakeData::DeleteTake() create an undo step when used. This might not be necessary in some cases, so it is possible to disable the take system's undo state.
- TakeData::SetUndoState(): Enables and disables the global undo state.
- TakeData::GetUndoState(): Reads the current global undo state.
AutoAlloc<BaseDocument> takeTemplateDoc;
if (takeTemplateDoc == nullptr)
TakeData* const takeData = takeTemplateDoc->GetTakeData();
if (takeData == nullptr)
takeData->SetUndoState(false);
takeData->AddTake("Take 1", nullptr, nullptr);
takeData->AddTake("Take 2", nullptr, nullptr);
#define FORMAT_C4DEXPORT
Cinema 4D export.
Definition: ge_prepass.h:3563
Bool SaveDocument(BaseDocument *doc, const Filename &name, SAVEDOCUMENTFLAGS saveflags, Int32 format)
Convert
With TakeData::TakeToDocument() it is possible to create a BaseDocument with the state of the selected take.
const BaseTake* const mainTake = takeData->GetMainTake();
BaseTake* childTake = mainTake->GetDown();
while (childTake != nullptr)
{
BaseDocument* takeDoc = takeData->TakeToDocument(childTake);
if (takeDoc == nullptr)
const String
file = childTake->GetName() +
".c4d";
BaseDocument::Free(takeDoc);
childTake = childTake->GetNext();
}
PyCompilerFlags const char * filename
Definition: ast.h:15
const char const char const char * file
Definition: object.h:439
Disc I/O
With TakeData::SaveTakesWithAssets() it is possible to save all takes as a separate project.
TakeData*
const takeData =
doc->GetTakeData();
if (takeData == nullptr)
takeData->SaveTakesWithAssets(false);
Further Reading