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

    Modeling tool, viewport update

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 245 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 08/12/2010 at 12:51, xxxxxxxx wrote:

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

      ---------
      Hi all!
      I'm implementing an interactive modeling tool (ToolData), that operates on polygon objects and adds new geometry to the object. (Like, e.g., the extrude tool)

      I'm having some problems with getting the object to update in the viewport. To update the viewport, i call "DrawViews" each time the user interacts with the object (drags the mouse). Most of the time it works just fine, but sometimes it seems a little buggy.

      In general, what flags/messages must i use to make sure my scene is properly updated in the viewport after modifying a polygon object?

      Best regards
      /Filip

      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 08/12/2010 at 15:26, xxxxxxxx wrote:

        win->MouseDragStart(KEY_MLEFT,mouseX,mouseY,MOUSEDRAGFLAGS_DONTHIDEMOUSE|MOUSEDRAGFLAGS_NOMOVE);  
        while (win->MouseDrag(&dx,&dy,&device) == MOUSEDRAGRESULT_CONTINUE)  
        {  
         // No movement  
         if (dx == 0.0 && dy == 0.0) continue;  
         // Do your stuff  
         ...  
         //  
         doc->AddUndo(UNDOTYPE_CHANGE_NOCHILDREN, op);  
         // For asynchronous AM update while in Mouse loop  
         GeSyncMessage(EVMSG_ASYNCEDITORMOVE);  
         // Update display to show drag results  
         DrawViews(DRAWFLAGS_ONLY_ACTIVE_VIEW|DRAWFLAGS_NO_THREAD|DRAWFLAGS_NO_ANIMATION);  
        }  
        if (win->MouseDragEnd() == MOUSEDRAGRESULT_ESCAPE)    doc->DoUndo();  
        

        Careful, I'm using R12 enumeration flags here.

        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 09/12/2010 at 00:21, xxxxxxxx wrote:

          Yup, that's pretty much exactly what my code looks like. Seems like i've got to look for my bug elsewhere then. 🙂

          Thanks a lot for the help!

          /Filip

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