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

    DRAWHANDLE_CUSTOM?

    Scheduled Pinned Locked Moved SDK Help
    6 Posts 0 Posters 631 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 18/08/2012 at 17:12, xxxxxxxx wrote:

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

      ---------
      Hey gang.
      Here's one I haven't seen addressed yet.
      How the heck do we create our own custom handle shapes?
      There's a flag called DRAWHANDLE_CUSTOM in the SDK. But absolutely no mention on how to actually use it.

      I've been playing around with the DoubleCircle example in the SDK. And I've been able to add things like lines and highlight color changing by adding a Draw() method to it:

      DRAWRESULT DoubleCircleData::Draw(BaseObject *op, DRAWPASS drawpass, BaseDraw *bd, BaseDrawHelp *bh)  
      {  
        LONG hitid, i;  
        Matrix mx;  
        HandleInfo info;  
        
        if(drawpass != DRAWPASS_HANDLES)                      //Only draw the handles in this plugin  
        return DRAWRESULT_SKIP;  
        
        hitid = op->GetHighlightHandle(bd);                      //Check if the user is hovering over the handle  
        bd->SetMatrix_Matrix(op, bh->GetMg());                        //Converts coordinates into global space  
        bd->SetPen(GetViewColor(VIEWCOLOR_ACTIVEPOINT));              //Sets the color of the handle to this color  
        
        for(i = 0; i < HANDLES; i++)  
        {  
            if(i == hitid)                                             //If the handle is hit  
                bd->SetPen(GetViewColor(VIEWCOLOR_SELECTION_PREVIEW)); //Draw it in a different color so we can tell it's been hit  
        
            GetHandle(op, i, info);                                    //Get the handle's info from the GetHandle function  
            bd->DrawHandle(info.position, DRAWHANDLE_BIG, 0);          //Use the info to create a big ball type looking handle  
        }  
        
        //We only have handles at this point...This next code draws the lines  
        GetHandle(op, 0, info);                                        //Get the first handle and it's info  
        bd->DrawLine(info.position, Vector(0.0), 0);                   //Draws a line from the center of the object to the handle  
        GetHandle(op, 1, info);                                        //Get the second handle and it's info  
        bd->DrawLine(info.position, Vector(0.0), 0);                   //Draws a line from the center of the object to the handle  
        
        return DRAWRESULT_OK;  
      }
      

      It would be very cool If I could replace DRAWHANDLE_BIG with DRAWHANDLE_CUSTOM.
      But the SDK never tells us what it requires.

      -ScottA


      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 19/08/2012 at 07:56, xxxxxxxx wrote:

        Hei Scott,

        have you actually tried replacing _BIG with _CUSTOM? 🙂
        I'm at the beach and cannot try it out now. But I could imagine that it doesn't actually
        draw a handle into the viewport, but makes the passed point available to handle-detection.

        -Nik

        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 19/08/2012 at 08:34, xxxxxxxx wrote:

          At the beach huh?
          Cowabunga dude...Surfs up!
          Watch out for sharks! !Wink[URL-REMOVED]

          Yeah I've tried it. But I don't know how to pass another object as the new handle object.
          I don't even know if we can pass an object, array of points, whatever..?
          I can't find any information about doing this at all in the SDK.

          -ScottA


          [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

          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 24/08/2012 at 00:48, xxxxxxxx wrote:

            Hi,

            I asked the developers and here's the answer I got: if DRAWHANDLE_CUSTOM is specified the handle point is drawn with the size set by BaseDraw::SetPointSize(). So there's no way to pass an object, array of points etc.

            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 24/08/2012 at 08:05, xxxxxxxx wrote:

              In other words, it is just a 'custom' handle size specification.  Gotcha. 🙂

              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 24/08/2012 at 08:19, xxxxxxxx wrote:

                Thanks for asking them Yannick.
                Kind of a bummer that it's a size only flag. But at least I know what that flag is used for now.

                -ScottA

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