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
    • Recent
    • Tags
    • Users
    • Login
    The Maxon SDK Team is currently short staffed due to the winter holidays. No forum support is being provided between 15/12/2025 and 5/1/2026. For details see Maxon SDK 2025 Winter Holidays.

    SceneHook polling and refreshing

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 461 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

      On 24/05/2013 at 01:55, xxxxxxxx wrote:

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

      ---------
      Hi Folks,

      I'm polling the mouse while in a scenehook plugin. However I'm not able to get the viewport to update while the poll is running.

      I've tried EventAdd() and DrawViews() with various flags to no avail. I've also tried sending a message (e.g. MSG_UPDATE) but this yields the same result.

      The viewport does update with EventAdd/DrawViews but only when I let go of the mouse button. I really need it to refresh while it's down and polling if possible. Can this be done from a scenehook?

      WP.

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

        On 24/05/2013 at 02:06, xxxxxxxx wrote:

        Hi WickedP,

        DrawViews() should actually do it. What flags do you pass?

        -Nik

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

          On 24/05/2013 at 02:10, xxxxxxxx wrote:

          Hi there Nik,

          this was the last one I tried "DRAWFLAGS_FORCEFULLREDRAW".

          Thanks for your quick response!

          WP.

          EDIT: that flag is the one that's in the latest build incidently too... no refresh until the mouse is let go.

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

            On 24/05/2013 at 02:20, xxxxxxxx wrote:

            Hm.. I usually use this combination of flags (see below) and it worked fine for me always.
            Though, I've never implemented MouseInput() in a SceneHookPlugin. But it shouldn't differ much from
            the way you would do it in a ToolData plugin. Maybe you want to try flags like this:

                    DrawViews(DRAWFLAGS_ONLY_ACTIVE_VIEW | DRAWFLAGS_NO_THREAD |
                              DRAWFLAGS_NO_REDUCTION | DRAWFLAGS_STATICBREAK);
            

            My guess is that you must pass DRAWFLAGS_NO_THREAD if you want a synchronous redraw.

            -Nik

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

              On 24/05/2013 at 02:41, xxxxxxxx wrote:

              Yeah - that seems to have done the trick. I'm a little surprised the full redraw didn't work on it's own. But it's all going now!

              Thanks Nik,

              WP.

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