THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/07/2006 at 06:11, xxxxxxxx wrote:
Cinema 4D Version: 9.6
Platform: Mac OSX ;
Language(s) : C.O.F.F.E.E ;
Maybe I'm nuts... when I try to use CallCommand within an expression, Cinema4D freezes.
CallCommand(13957); // Clear all console entries
Regardless of which command I try to call, it freezes.
Is this a bug?
On 10/07/2006 at 07:12, xxxxxxxx wrote:
I have that CallCommand working in a settup of mine.
Try add a Println() : either static or another variable, after the Command so cinema has something to delete for each Event.
On 10/07/2006 at 10:18, xxxxxxxx wrote:
Thanks for the reply. But the println doesn't stop C4D from freezing
It seems as if CallCommand doesn't work with expresions.
On 10/07/2006 at 14:16, xxxxxxxx wrote:
It's dangerous to use CallCommand() within an expression, since the command you call may well trigger the scene to be redrawn in which case the expressions are evaluated again. Then you will have an infinite loop, freezing CINEMA 4D.
On 13/07/2006 at 03:03, xxxxxxxx wrote:
Jup. That's why I called a command which shouldn't force the editor to be redrawn: 13957 - clear all console entries.
But also if I write some code which don't let CallCommand() be executed multiple times (only the first time, then a bool variable is set which avoids executing CallComand the next time) I get the freeze.
On 17/07/2006 at 14:05, xxxxxxxx wrote:
Hm, it could be because the expression is executed in a thread. So GUI functions, such as dialogs, are not allowed for that reason. And "Clear All Console Entries" seemingly belongs to the same category, as I suspect many callable commands do. So using CallCommand() from an expression is not safe.
A workaround is to put the code in a menu plugin instead.