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

    Progress within a loop

    SDK Help
    0
    4
    398
    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
      Helper
      last edited by

      On 13/02/2016 at 07:17, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R17 
      Platform:   Windows  ; Mac  ;  
      Language(s) :     C++  ;

      ---------
      Some time I posted "Different behavior on Mac versus PC" asking an explanation of the difference between pc and mac.
      PC updates the gui during a loop, while the mac does not.
      I solved it, with the help of Andreas, using threading.

      Now I have something similar.
      In Command I download multiple images.
      for x=o to 10
         for y=0 to 10
              download image
              set slider to indicate progress

      On the pc the slider is updated. On the Mac the slider is not updated. Only after the whole loop, the slider is updated.
      While the loop is running cinema gui is completely blocked.

      I can put the loop in a thread, but I was wondering if there is no other way to do this.
      How did others solve this issue?

      -Pim

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

        On 13/02/2016 at 08:57, xxxxxxxx wrote:

        Coroutine programming would be your only other choice. But
        C++ doesn't (yet) support it natively and even if it would, the C4D SDK
        would probaby need to be updated to support it.

        You have to stick to threading.

        Edit: If you do want to look into Coroutines, there's boost::coroutine
        for example. Haven't tried it myself though.

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

          On 15/02/2016 at 01:25, xxxxxxxx wrote:

          Hello,

          as Niklas said, the best solution would be so do your operations from a background thread and to update the GUI from the main thread. Please be aware that we cannot provide any support for the use of third party libraries as boost.

          Best wishes,
          Sebastian

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

            On 15/02/2016 at 05:25, xxxxxxxx wrote:

            Ok, I will stick to threading and have a look at Coroutines.

            - Pim

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