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

    DrawLine2D on top of everything else

    PYTHON Development
    0
    4
    688
    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 09/02/2014 at 14:27, xxxxxxxx wrote:

      Hi
      Im struggeling with how i can get DrawLine2D to be draw on top of the other scene objects. I have a tooldata plugin and im drawing a simple rectangle inside the MouseInput function:

        
      (omitted code)   
      # Draw a rectangular region in the picture viewer   
              while result==c4d.MOUSEDRAGRESULT_CONTINUE:   
                  mx += dx   
                  my += dy   
        
                  p2 = c4d.Vector(mx,firstMy,0)   
                  p3 = c4d.Vector(mx,my,0)   
                  p4 = c4d.Vector(firstMx,my,0)   
        
                  # bd.SetDepth()   
                  bd.LineZOffset(100)   
                  bd.SetMatrix_Screen()   
                  # bd.SetMatrix_Camera()   
        
                  bd.SetPen(c4d.Vector(0.9,0.9,0.9),c4d.SET_PEN_USE_PROFILE_COLOR)   
                  bd.SetDepth(True)   
        
                  bd.DrawLine2D(p1, p2)   
                  bd.DrawLine2D(p2, p3)   
                  bd.DrawLine2D(p3, p4)   
                  bd.DrawLine2D(p4, p1)   
        
                  c4d.DrawViews(c4d.DA_ONLY_ACTIVE_VIEW|c4d.DA_NO_THREAD|c4d.DA_NO_ANIMATION)   
                  result, dx, dy, channel = win.MouseDrag()   
        
      (omitted code)   
      

      The rectangle is drawn on top of the grid but behind shaded objects. How can i draw it on top of everything else in the scene? Setting the LineZOffset doesn't seem to have an effect.

      Any help appreciated

      Cheers
      Bonsak

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

        On 10/02/2014 at 14:02, xxxxxxxx wrote:

        Ok. Moving the drawing of the lines to the Draw function solves the problem 🙂

        Cheers
        Bonsak

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

          On 11/02/2014 at 06:31, xxxxxxxx wrote:

          Yep, drawing only in the Draw procedures. 😉 Anything else could even crash the program!

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

            On 11/02/2014 at 07:33, xxxxxxxx wrote:

            I had a couple of crashes with the old version so i rewrote the whole thing 🙂 Thanks.

            Cheers
            Bonsak

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