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.

case MSG_DESCRIPTION_ALLOWOVERRIDE : { DescriptionAllowOverride * const dao = ( DescriptionAllowOverride *)data; if (dao && dao-> _descId ) { dao-> _allow = false ;
return true ; } break ; }

and

// This example catches the message MSG_DESCRIPTION_TAKECHANGED // to be informed what parameter was changed.

case MSG_DESCRIPTION_TAKECHANGED : { DescriptionTakeChanged * const dtc = ( DescriptionTakeChanged *)data; if (dtc && dtc-> _descId ) { const Int32 parameterID = (*dtc-> _descId )[0]. id ; ApplicationOutput ( String::IntToString (parameterID)); } break ; }
注意
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.

// 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 ; }

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), TAG_EXPRESSION | TAG_VISIBLE | TAG_ADDTOTAKEGROUP , LookAtCamera::Alloc, "Tlookatcameraexp" , AutoBitmap ( "lookatcamera.tif" ), 0); }

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)))

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);

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" }; ApplicationOutput (message); } tag = tag-> GetNext (); }

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

延伸阅读

CUSTOMGUI_DESCRIPTION
#define CUSTOMGUI_DESCRIPTION
Description custom GUI ID.
定义: customgui_description.h:21
RegisterCustomGuiPlugin
Bool RegisterCustomGuiPlugin(const maxon::String &str, Int32 info, CustomGuiData *dat)
MSG_DESCRIPTION_TAKECHANGED
#define MSG_DESCRIPTION_TAKECHANGED
Sent to each overridden node when the user changes the current Take. Sent to both the node storing th...
定义: c4d_baselist.h:419
RegisterTagPlugin
Bool RegisterTagPlugin(Int32 id, const maxon::String &str, Int32 info, DataAllocator *g, const maxon::String &description, BaseBitmap *icon, Int32 disklevel)
DescriptionAllowOverride::_allow
Bool _allow
true if the parameter can be overridden, otherwise false.
定义: lib_description.h:953
DescriptionAllowOverride::_descId
const DescID * _descId
Description ID to be overridden.
定义: lib_description.h:950
TAG_VISIBLE
#define TAG_VISIBLE
The tag can be seen in the Object Manager.
定义: c4d_basetag.h:31
BaseTag
定义: c4d_basetag.h:46
DESCRIPTION_NO_TAKE_OVERRIDES
#define DESCRIPTION_NO_TAKE_OVERRIDES
Bool: If true ignore the overrides enabling/disabling.
定义: customgui_description.h:38
DescriptionTakeChanged::_descId
const DescID * _descId
The description ID for the message, can be nullptr so is sent at the end of the operation just once.
定义: lib_description.h:973
BaseContainer::SetBool
void SetBool(Int32 id, Bool b)
定义: c4d_basecontainer.h:498
TAG_ADDTOTAKEGROUP
#define TAG_ADDTOTAKEGROUP
The tag is added to the Take override groups system.
定义: c4d_basetag.h:37
NBIT::TAKE_LOCK
@ TAKE_LOCK
A node in an override group cannot be changed.
String
定义: c4d_string.h:38
EVMSG_TAKECHANGED
#define EVMSG_TAKECHANGED
Sent by the Take System when the current Take ID changed to let all managers react to the new status.
定义: ge_prepass.h:2564
String::IntToString
static String IntToString(Int32 v)
定义: c4d_string.h:495
GeLoadString
const String & GeLoadString(Int32 id)
BFV_SCALEFIT
@ BFV_SCALEFIT
Scale fit. BFV_SCALE|BFV_FIT.
定义: gui.h:302
DescriptionTakeChanged
定义: lib_description.h:962
CallCommand
void CallCommand(Int32 id, Int32 subid=0)
CUSTOMGUI_DISALLOW_TAKESOVERRIDE
#define CUSTOMGUI_DISALLOW_TAKESOVERRIDE
Disallows Takes override e.g. the GUI does not hold real data but just react to the node changes (e....
定义: c4d_customguidata.h:76
Int32
maxon::Int32 Int32
定义: ge_sys_math.h:58
ApplicationOutput
#define ApplicationOutput(formatString,...)
定义: debugdiagnostics.h:207
DescriptionAllowOverride
定义: lib_description.h:938
IsTakeRenderRunning
Bool IsTakeRenderRunning()
AutoBitmap
A simple BaseBitmap wrapper created from a filename or resource ID.
定义: c4d_basebitmap.h:1501
DescriptionCustomGui
定义: customgui_description.h:99
MSG_DESCRIPTION_ALLOWOVERRIDE
#define MSG_DESCRIPTION_ALLOWOVERRIDE
Sent before the Take override is added to allow it or not. The corresponding data is DescriptionAllow...
定义: c4d_baselist.h:418
TAG_EXPRESSION
#define TAG_EXPRESSION
The tag is an expression.
定义: c4d_basetag.h:34
Bool
maxon::Bool Bool
定义: ge_sys_math.h:53
BFH_SCALEFIT
@ BFH_SCALEFIT
Scale fit. BFH_SCALE|BFH_FIT.
定义: gui.h:310
BaseTag::GetNext
BaseTag * GetNext(void)
定义: c4d_basetag.h:78
BaseList2D::GetName
String GetName() const
定义: c4d_baselist.h:2318
GeListNode::GetNBit
Bool GetNBit(NBIT bit) const
BaseContainer
定义: c4d_basecontainer.h:46
DESCRIPTION_ALLOWFOLDING
#define DESCRIPTION_ALLOWFOLDING
Bool Allow folding.
定义: customgui_description.h:26

Copyright  © 2014-2025 乐数软件    

工业和信息化部: 粤ICP备14079481号-1