About
A BaseTake object represents a take of the Take System. It stores BaseOverride objects that define how a specific entity is changed in the given take.
Access
BaseTake objects are returned from the BaseDocument via 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.
TakeData*
const takeData =
doc->GetTakeData();
if (takeData == nullptr)
BaseTake* const mainTake = takeData->GetMainTake();
if (mainTake == nullptr)
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:69
const char * doc
Definition: pyerrors.h:226
Allocation/Deallocation
A BaseTake is created and deleted using the TakeData object:
- TakeData::AddTake(): Adds a new take.
- TakeData::InsertTake(): Moves a take in the hierarchy.
- TakeData::DeleteTake(): Deletes the given take.
BaseTake* const mainTake = takeData->GetMainTake();
if (mainTake == nullptr)
BaseTake* const newTake = takeData->AddTake("this is a new take", nullptr, nullptr);
if (newTake == nullptr)
#define INSERT_UNDER
Insert under.
Definition: customgui_listview.h:596
- Note
- Always use TakeData::AddTake() to clone a take.
Navigation
Like many other entities takes are organized in a BaseList2D tree. One can use the typical functions to navigate that tree.
- BaseTake::GetNext(): Returns the next take in the row.
- BaseTake::GetPred(): Returns the previous take in the row.
- BaseTake::GetUp(): Returns the parent take if it exists.
- BaseTake::GetDown(): Returns the first child take if it exists.
- BaseTake::GetDownLast(): Returns the last child take.
const BaseTake* const mainTake = takeData->GetMainTake();
const BaseTake* take = mainTake->GetDown();
while (take != nullptr)
{
take = take->GetNext();
}
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:204
Marked
Takes can be marked in the Take Manager. This allows to render just a subset of all takes. The API allows to manage this marked state:
- BaseTake::SetChecked(): Sets the mark status.
- BaseTake::IsChecked(): Returns the mark status.
BaseTake* take = mainTake->GetDown();
while (take != nullptr)
{
const Bool marked = take->IsChecked();
take->SetChecked(!marked);
take = take->GetNext();
}
maxon::Bool Bool
Definition: ge_sys_math.h:46
Utility
- BaseTake::IsMain(): Returns true if the take is the main take.
- BaseTake::SearchHierarchy(): Returns true if the take is a child of the given take.
Overrides
BaseOverride
A BaseOverride defines the parameter changes for a specific object in a BaseTake. BaseOverrides are managed using methods of BaseTake:
- BaseTake::GetOverrides(): Returns the BaseOverrides of the take.
- BaseTake::FindOrAddOverrideParam(): Finds and if necessary creates an override for the given object and parameter.
- BaseTake::DeleteOverride(): Deletes a specific parameter override.
- BaseTake::FindOverride(): Returns the override if the given node is overridden.
- BaseTake::FindOverrideInHierarchy(): Returns the override for the given node and given parameter ID by searching the entire hierarchy.
BaseObject*
const object =
doc->GetActiveObject();
if (object == nullptr)
BaseOverride* const baseOverride = take->FindOverride(takeData, object);
if (baseOverride != nullptr)
{
}
Overrides can also be created automatically:
- BaseTake::OverrideNode(): Overrides all parameters of the passed node.
- BaseTake::AutoTake(): Compares the two given nodes and creates needed overrides.
BaseObject*
const activeObject =
doc->GetActiveObject();
if (activeObject == nullptr)
BaseTake* const newTake = takeData->AddTake("this is a new take", nullptr, nullptr);
if (newTake == nullptr)
BaseOverride* const activeObjectOverride = newTake->OverrideNode(takeData, activeObject, false);
if (activeObjectOverride == nullptr)
BaseTake::AutoTake() is especially useful to create the proper overrides when "Auto Take" is enabled. Just an unaltered clone of the changed object or the reference object from the undo stack is required:
BaseObject* undoObject =
static_cast<BaseObject*
>(sphereObject->GetClone(
COPYFLAGS::NONE,
nullptr));
if (undoObject == nullptr)
TakeData*
const takeData =
doc->GetTakeData();
{
BaseTake* const currentTake = takeData->GetCurrentTake();
if (currentTake && !currentTake->IsMain())
{
currentTake->AutoTake(takeData, sphereObject, undoObject);
}
}
BaseObject::Free(undoObject);
NONE
Definition: asset_browser.h:1
#define ConstDescID(...)
Definition: lib_description.h:592
AUTO
Definition: lib_birender.h:1
@ PRIM_SPHERE_RAD
Definition: osphere.h:6
BaseOverrideGroup
Override groups act like virtual null objects. They allow to add certain tags to a selection of objects.
- BaseTake::GetFirstOverrideGroup(): Returns the first override group of the take.
- BaseTake::AddOverrideGroup(): Adds an override group to the take.
- BaseTake::GetOverrideGroups(): Returns an array with all override groups of the take.
- BaseTake::DeleteOverrideGroup(): Deletes the given override group.
AutoAlloc<AtomArray> selectedObjects;
if (selectedObjects == nullptr)
if (selectedObjects->GetCount() == 0)
BaseTake* const take = takeData->AddTake("Green Objects", nullptr, nullptr);
if (take == nullptr)
BaseOverrideGroup* const group = take->AddOverrideGroup();
if (group == nullptr)
group->SetName("Green Material"_s);
BaseMaterial*
const mat =
doc->SearchMaterial(
"Green"_s);
if (mat != nullptr)
for (
Int32 i = 0;
i < selectedObjects->GetCount(); ++
i)
{
BaseList2D*
const element =
static_cast<BaseList2D*
>(selectedObjects->GetIndex(
i));
group->AddToGroup(takeData,
element);
}
Py_ssize_t i
Definition: abstract.h:645
return OK
Definition: apibase.h:2740
#define Ttexture
Texture - TextureTag.
Definition: ge_prepass.h:1420
maxon::Int32 Int32
Definition: ge_sys_math.h:51
PyObject * element
Definition: unicodeobject.h:1016
Camera
Takes also manage the camera currently in use. These functions allow to set and get the camera used for a certain take:
- BaseTake::GetCamera(): Returns the camera used by this take which could also be the default camera or
nullptr
if the parent take's camera should be used.
- BaseTake::GetEffectiveCamera(): Returns the camera that is effectively used by the given take.
- BaseTake::SetCamera(): Sets the camera used for this take.
nullptr
means the parent take's settings should apply.
AutoAlloc<AtomArray> selectedObjects;
if (selectedObjects == nullptr)
for (
Int32 i = 0;
i < selectedObjects->GetCount(); ++
i)
{
C4DAtom*
const element = selectedObjects->GetIndex(
i);
{
CameraObject*
const camera =
static_cast<CameraObject*
>(
element);
const String takeName { "Take for camera " + camera->GetName() };
BaseTake* const cameraTake = takeData->AddTake(takeName, nullptr, nullptr);
if (cameraTake == nullptr)
cameraTake->SetCamera(takeData, camera);
}
}
#define Ocamera
Camera - CameraObject.
Definition: ge_prepass.h:1045
Render Settings
Takes also manage render settings. As with the camera, it is possible to assign specific render settings to each take.
- BaseTake::GetRenderData(): Returns the assigned RenderData. Might be
nullptr
, if the parent take's render settings should be used.
- BaseTake::GetEffectiveRenderData(): Returns the effective RenderData.
- BaseTake::SetRenderData(): Sets the RenderData used with this Take.
nullptr
is used to reset.
RenderData* renderData =
doc->GetFirstRenderData();
while (renderData != nullptr)
{
const String renderDataName = renderData->GetName();
const String takeName = "Take for RenderData " + renderDataName;
BaseTake* const renderDataTake = takeData->AddTake(takeName, nullptr, nullptr);
if (renderDataTake == nullptr)
renderDataTake->SetRenderData(takeData, renderData);
renderData = renderData->GetNext();
}
Userdata
A BaseTake can host userdata that can help to identify the take along the production pipeline. This userdata is managed using the default BaseList2D methods:
DynamicDescription*
const desc = take->GetDynamicDescriptionWritable();
const GeData data { true };
void * userData
Definition: fileobject.h:20
@ DESC_NAME
String Name for standalone use.
Definition: lib_description.h:90
@ DTYPE_BOOL
GV Bool. ID_GV_DATA_TYPE_BOOL.
Definition: lib_description.h:74
BaseContainer GetCustomDataTypeDefault(Int32 type)
PyStructSequence_Desc * desc
Definition: structseq.h:26
See also DynamicDescription Manual.
Utility
BaseTake* const take = takeData->GetCurrentTake();
if (take == nullptr)
if (!take->IsMain())
take->Reset();
Further Reading