Take System Additional Information

Messages

The take system sends two messages to an object's NodeData::Message() method:

// This code simply disables overrides for all parameters of the host object.
{
DescriptionAllowOverride* const dao = (DescriptionAllowOverride*)data;
if (dao && dao->_descId)
{
dao->_allow = false;
return true;
}
break;
}
#define MSG_DESCRIPTION_ALLOWOVERRIDE
Sent before the Take override is added to allow it or not. The corresponding data is DescriptionAllow...
Definition: c4d_baselist.h:453

and

// This example catches the message MSG_DESCRIPTION_TAKECHANGED
// to be informed what parameter was changed.
{
DescriptionTakeChanged* const dtc = (DescriptionTakeChanged*)data;
if (dtc && dtc->_descId)
{
const Int32 parameterID = (*dtc->_descId)[0].id;
ApplicationOutput(String::IntToString(parameterID));
}
break;
}
#define MSG_DESCRIPTION_TAKECHANGED
Sent to each overridden node when the user changes the current Take. Sent to both the node storing th...
Definition: c4d_baselist.h:454
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:204
maxon::Int32 Int32
Definition: ge_sys_math.h:51
Note
It is also possible to send MSG_DESCRIPTION_ALLOWOVERRIDE to an object using Message() to check if a certain parameter can be overridden.

Core Message

The Take System sends a core message when the take changed.

  • EVMSG_TAKECHANGED: Sent as a global notification so dialogs can update when the take changed or MessageData plugins can react.
// This example shows how a MessageData plugin catches the EVMSG_TAKECHANGED message.
Bool CoreMessage(Int32 id, const BaseContainer& bc)
{
if (id == EVMSG_TAKECHANGED)
{
ApplicationOutput("Take Changed");
}
return true;
}
#define EVMSG_TAKECHANGED
Sent by the Take System when the current Take ID changed to let all managers react to the new status.
Definition: ge_prepass.h:2802
maxon::Bool Bool
Definition: ge_sys_math.h:46

Custom Tags

If a custom tag should appear in the Take Manager's context menu, it must use the flag TAG_ADDTOTAKEGROUP:

Bool RegisterLookAtCamera(void)
{
return RegisterTagPlugin(ID_LOOKATCAMERATAG,
GeLoadString(IDS_LOOKATCAMERA),
LookAtCamera::Alloc,
"Tlookatcameraexp",
AutoBitmap("lookatcamera.tif"),
0);
}
#define TAG_EXPRESSION
The tag is an expression.
Definition: c4d_basetag.h:33
#define TAG_ADDTOTAKEGROUP
The tag is added to the Take override groups system.
Definition: c4d_basetag.h:36
#define TAG_VISIBLE
The tag can be seen in the Object Manager.
Definition: c4d_basetag.h:30
const String & GeLoadString(Int32 id)
Bool RegisterTagPlugin(Int32 id, const maxon::String &str, Int32 info, DataAllocator *g, const maxon::String &description, BaseBitmap *icon, Int32 disklevel)

Custom GUIs

It is possible to disable the override functionality for custom GUI elements. This can be useful if the GUI element does not manage data and only displays internal states of a node.

if (!RegisterCustomGuiPlugin(GeLoadString(IDS_CUSTOMGUISTRING), CUSTOMGUI_DISALLOW_TAKESOVERRIDE, NewObjClear(SDKExampleCustomGUIString)))
#define CUSTOMGUI_DISALLOW_TAKESOVERRIDE
Disallows Takes override e.g. the GUI does not hold real data but just react to the node changes (e....
Definition: c4d_customguidata.h:75
Bool RegisterCustomGuiPlugin(const maxon::String &str, Int32 info, CustomGuiData *dat)

Description GUI

It is possible to create custom dialogs with the Description GUI element. With a parameter it is possible to disable the Take System for that GUI. This is needed e.g. if the GUI element is used to display a custom node.

// This example configurse a new DescriptionCustomGui element.
BaseContainer customguiSettings;
customguiSettings.SetBool(DESCRIPTION_ALLOWFOLDING, true);
customguiSettings.SetBool(DESCRIPTION_NO_TAKE_OVERRIDES, true);
const Int32 guiFlags = BFH_SCALEFIT | BFV_SCALEFIT;
void* customGUI = AddCustomGui(GADGET_ID, CUSTOMGUI_DESCRIPTION, ""_s, guiFlags, 400, 200, customguiSettings);
DescriptionCustomGui* const descriptionGUI = static_cast<DescriptionCustomGui*>(customGUI);
#define CUSTOMGUI_DESCRIPTION
Description custom GUI ID.
Definition: customgui_description.h:20
#define DESCRIPTION_NO_TAKE_OVERRIDES
::Bool: If true ignore the overrides enabling/disabling.
Definition: customgui_description.h:37
#define DESCRIPTION_ALLOWFOLDING
::Bool Allow folding.
Definition: customgui_description.h:25
@ BFV_SCALEFIT
Scale fit. BFV_SCALE|BFV_FIT.
Definition: gui.h:308
@ BFH_SCALEFIT
Scale fit. BFH_SCALE|BFH_FIT.
Definition: gui.h:316

Bits

These bits are used by the Take System to mark objects and tags changed by it:

// This example loops through the tags of the given object and checks if a tag was created by a BaseOverrideGroup.
BaseTag* tag = object->GetFirstTag();
while (tag != nullptr)
{
if (tag->GetNBit(NBIT::TAKE_LOCK))
{
const String message { "The Tag " + tag->GetName() + "was created by a BaseOverrideGroup" };
}
tag = tag->GetNext();
}
const char * message
Definition: pyerrors.h:189
TAKE_LOCK
A node in an override group cannot be changed.
Definition: ge_prepass.h:107

Take Rendering

It is possible to check if the Take System is currently rendering in the background:

// This example checks if takes are rendered. If not, the render process will be started.
if (IsTakeRenderRunning() == false)
CallCommand(431000068); // render marked takes to PV
Bool IsTakeRenderRunning()
void CallCommand(Int32 id, Int32 subid=0)

Further Reading