DrawLine2D on top of everything else

On 09/02/2014 at 14:27, xxxxxxxx wrote:

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.SetMatrix_Camera()   
            bd.DrawLine2D(p1, p2)   
            bd.DrawLine2D(p2, p3)   
            bd.DrawLine2D(p3, p4)   
            bd.DrawLine2D(p4, p1)   
            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


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

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


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

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

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.