THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/06/2006 at 06:41, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 9.5
Platform: Windows ;
Language(s) : C++ ;
---------
I have written a tool plugin. When updating the Active Tool tab, C4D sometimes freezes. To isolate the problem, I used the following code:
LONG Tool::Draw(BaseDocument* doc, BaseContainer& data, BaseDraw* bd, BaseDrawHelp* bh, BaseThread* bt, LONG flags)
{
BaseObject *o = doc->GetActiveObject();
if (o == obj) return 0;
obj = o;
if (!dialog) return 0;
Real r;
dialog->GetReal(10001, r);
dialog->SetReal(10001, r+1);
return 0;
}
- dialog is the dialog created and returned in AllocSubDialog
- obj is used to store the active object
This code updates the tool dialog when a different object is selected, but it seems to cause a deadlock. C4D R8 freezes only sometimes, C4D R9 always when dialog->SetReal is executed (but only, if a different value is set). My idea was to reset the tool parameters when a different object is selected, but I skipped this feature due to the deadlock.
Now, someone using my plugin reports a similar problem when updating the tool dialog while interacting with the tool using the mouse. I can't reproduce the problem in C4D R9, but R9.5 seems to freeze sometimes when the dialog id updated from Tool::MouseInput. My tool has handles for some parameters, so it is important that I can update the parameters in the dialog when they are modified using the handles.
Is this kind of problem with updating the Active Tool tab known to anyone, and does someone know a way around it?