I draw a line and some points, but I want him to show it in front of all the objects (my target: just like measure objects, you can always see them, even if you don't choose to measure objects, they are not covered by any objects)
- 1: When drawpass = DRAWPASS_HANDLES draw, I only select the object to achieve the first display, but I have to choose, this is not what I want.
- 2: when draw pass = DRAWPASS_OBJECT draw, I don't choose Show lines, but he will be covered by other objects
this is my code:
def Draw(self,op, drawpass, bd, bh):
if drawpass == c4d.DRAWPASS_OBJECT:
if not op[c4d.S_MOTIONTRAIL_GTWO_DRAWENABLE]:
return c4d.DRAWRESULT_OK
bd.SetMatrix_Matrix(None, c4d.Matrix())
all_pos = self.parameters['all_pos']
color_lis = self.parameters['color_lis']
point_size = op[c4d.S_MOTIONTRAIL_GTWO_POINTSIZE]
bd.SetPointSize(point_size)
for per_pos,color in zip(all_pos,color_lis):
bd.SetPen(color)
cnt = len(per_pos)
for i in xrange(cnt-1):
bd.DrawLine(per_pos[i],per_pos[i+1],c4d.NOCLIP_D)
bd.DrawPoints(per_pos,None)
return c4d.DRAWRESULT_OK
Thanks for any help!