Hi,
I have a questions about behavior of ToolData class member function GetDDescription().
I can't find any example and I don't understand why Cinema is calling this function several times after each user event in GUI.
Below is the code of overridden member function.
I am filling description with controls every time now. (function LoadControls())
Bool LwCadToolData::GetDDescription (BaseDocument* doc, BaseContainer& data, Description* description, DESCFLAGS_DESC& flags)
{
// validation
if (description == nullptr) return false;
ApplicationOutput("GetDDescription flags: @", flags);
// initialize controls
LoadControls(C4dControls(description, description->GetSingleDescID()));
// controls loaded into tool description
flags |= DESCFLAGS_DESC::LOADED;
//---------------------
// base
return SUPER::GetDDescription(doc, data, description, flags);
}
Problem is that after each mouse event , this function is executed several times, always a different description pointer.
Below is the list of calls after a single click.
GetDDescription flags: NONE
GetDDescription flags: NONE
GetDDescription flags: NONE
GetDDescription flags: NONE
GetDDescription flags: RESOLVEMULTIPLEDATA|MAPTAGS
GetDDescription flags: NONE
Could you please give me a hint, how to optimize this properly?
Optimal way is to fill description only once.
Is it necessary fill it every time the GetDDescription() function is executed?
Thanks!