Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    CallCommand doesn't work with expressions

    Scheduled Pinned Locked Moved SDK Help
    6 Posts 0 Posters 442 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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:

      User Information:
      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.

      For example:

      main(doc,op)
      {
      CallCommand(13957);     // Clear all console entries
      }

      Doesn't work 😞
      Regardless of which command I try to call, it freezes.

      Is this a bug?

      Thanks,
      j.

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        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.

        Cheers
        Lennart

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 10/07/2006 at 10:18, xxxxxxxx wrote:

          Hi Lennart

          Thanks for the reply. But the println doesn't stop C4D from freezing 😞
          It seems as if CallCommand doesn't work with expresions.

          Umpf 😕

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            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.

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              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.

              Thanks,
              j.

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                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.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post