Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    R20 equivalent of GeSignal

    Cinema 4D SDK
    r20 sdk c++
    3
    7
    1.6k
    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.
    • P
      peterakos
      last edited by

      Hello.

      In Cinema 4D R19, I was using GeSignal instead of while/GeSleep to "wake up" a thread.
      Which is the equivalent in maxon API ?

      Thank you.

      1 Reply Last reply Reply Quote 0
      • S
        s_bach
        last edited by

        Hello,

        to "wake" a thread one should use a condition variable. You find information in the Condition Variables Manual. General information on threading with the MAXON API is found here: MAXON API Threading.

        best wishes,
        Sebastian

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 2
        • P
          peterakos
          last edited by

          Hello and thank you very much for the help.

          It appears that I cannot use it in a custom thread that inherits C4DThread.
          I have a private member maxon::ConditionVariableRef, but the following call fails compilation:
          condition = maxon::ConditionVariableRef::Create();

          Do I have to use it only in a thread inheriting maxon::ThreadInterfaceTemplate<ExampleThread> ?

          Thank you.

          S 1 Reply Last reply Reply Quote 0
          • S
            s_bach @peterakos
            last edited by

            @peterakos said in R20 equivalent of GeSignal:

            I have a private member maxon::ConditionVariableRef, but the following call fails compilation:
            condition = maxon::ConditionVariableRef::Create();

            Hello,

            what compilation error exactly do you get?

            MAXON SDK Specialist

            Development Blog, MAXON Registered Developer

            1 Reply Last reply Reply Quote 1
            • P
              peterakos
              last edited by

              Hello.

              Here is the error:
              error C2679: binary '=': no operator found which takes a right-hand operand of type 'maxon::ResultMemTmaxon::ConditionVariableRef' (or there is no acceptable conversion)

              note: could be 'maxon::ConditionVariableInterface::Reference &maxon::ConditionVariableInterface::Reference::operator =(const maxon::ConditionVariableInterface::Reference &)'
              note: or 'maxon::ConditionVariableInterface::Reference &maxon::ConditionVariableInterface::Reference::operator =(maxon::ConditionVariableInterface::Reference &&)

              I have used it exactly as in ConditionVariable manual, but the thread is C4DThread instead of maxon::ThreadInterfaceTemplate<ExampleThread>.

              Thank you.

              1 Reply Last reply Reply Quote 0
              • r_giganteR
                r_gigante
                last edited by

                Hi Peterakos, thanks for following up.

                It seems that the issue you're reporting is related to the fact that you're not properly handling the result of the BaseRef::Create() with the usual error handling means.

                Please check Error handling in our the C++ API Documentation.

                Best, Riccardo

                1 Reply Last reply Reply Quote 1
                • P
                  peterakos
                  last edited by peterakos

                  Hello.

                  The problem was that I didn't add the definitions.

                  iferr_scope;
                  signal = maxon::ConditionVariableRef::Create() iferr_return;

                  Thank you for your time and sorry for that 😞

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