I have taken the EditorWindow.MouseDragStart() example from the manual and it works well in a flat view.
In perspective view the z coordinate is a bit strange, although I set it to 0.
What am I doing wrong?
obj = doc.GetActiveObject()
mousex = msg[c4d.BFM_INPUT_X]
mousey = msg[c4d.BFM_INPUT_Y]
win.MouseDragStart(c4d.KEY_MLEFT, mousex, mousey, c4d.MOUSEDRAGFLAGS_DONTHIDEMOUSE|c4d.MOUSEDRAGFLAGS_NOMOVE)
mx = mousex
my = mousey
while True:
result, dx, dy, channels = win.MouseDrag()
if result!=c4d.MOUSEDRAGRESULT_CONTINUE: break
mx += dx
my += dy
coord = bd.SW(c4d.Vector(mx,my, 0))
obj[c4d.ID_BASEOBJECT_REL_POSITION] = coord