Sorry, I was not clear enough.
I get the coordinates (v1 and v2) in MouseInput().
So, how to get the coordinates I got from MouseInput() to Draw().
Just call MouseInput() in Draw() or use (class) variables to be able to use v1 and v2 in Draw()?
Something like this?
class PlaceTool(c4d.plugins.ToolData):
v1 = c4d.Vector(0,0,0)
v2 = c4d.Vector(0,0,0)
def Draw(self, doc, data, bd, bh, bt, flags):
bd.SetPen(c4d.Vector(256,256,256))
bd.DrawLine2D(self.v1, self.v2)
return True
def MouseInput(self, doc, data, bd, win, msg):
self.v1 = c4d.Vector(0,0,0)
self.v2 = c4d.Vector(msg[c4d.BFM_INPUT_X], msg[c4d.BFM_INPUT_Y], 0)
return True
Is MouseInput() always called before Draw()?
By the way, compliments on implementing Undo's in the sdk.
It was quite easy for me to implement Undo functionality.