On 15/02/2016 at 10:53, xxxxxxxx wrote:
Hello everybody,
i´d like to draw a PolygonObject in Xray mode into the viewport. Im able to draw the object, but just without xray.
def Draw(self, op, drawpass, bd, bh) :
if drawpass!=c4d.DRAWPASS_XRAY:
obj = MachCube(100, 75, 50)
bd.DrawPolygonObject(bh, obj, c4d.DRAWOBJECT_0)
return c4d.DRAWRESULT_OK
...
def MachCube(size_x, size_y, size_z) :
size = c4d.Vector()
size.x = size_x
size.y = size_y
size.z = size_z
cube = c4d.PolygonObject(8, 6)
pnts = [c4d.Vector() for x in xrange(8)]
pnts[0] = c4d.Vector(-size.x/2, -size.y/2, -size.z/2)
pnts[1] = c4d.Vector(-size.x/2, size.y/2, -size.z/2)
pnts[2] = c4d.Vector( size.x/2, -size.y/2, -size.z/2)
pnts[3] = c4d.Vector( size.x/2, size.y/2, -size.z/2)
pnts[4] = c4d.Vector( size.x/2, -size.y/2, size.z/2)
pnts[5] = c4d.Vector( size.x/2, size.y/2, size.z/2)
pnts[6] = c4d.Vector(-size.x/2, -size.y/2, size.z/2)
pnts[7] = c4d.Vector(-size.x/2, size.y/2, size.z/2)
plys = c4d.CPolygon(0,1,3,2), c4d.CPolygon(2,3,5,4), c4d.CPolygon(4,5,7,6), c4d.CPolygon(6,7,1,0), c4d.CPolygon(1,7,5,3), c4d.CPolygon(6,0,2,4)
cube.SetAllPoints(pnts)
for index, ply in enumerate(plys) : cube.SetPolygon(index, ply)
return cube
Is it possible to do?
Greetings
rown