I have a command plugin with a (floating) dialog.
After the user gives a command, he must click on the screen to indicate the location where the command plugin should place the object.
I can get the mouse coordinates, but I do not know how to convert them to coordinates to place the object.
For example, if the user clicks on the Top View in the center, the object must be placed at (0,0,0).
msg = c4d.BaseContainer()
while self.GetInputState(c4d.BFM_INPUT_MOUSE, c4d.BFM_INPUT_MOUSELEFT, msg): #While the left mouse button is held down
if msg.GetLong(c4d.BFM_INPUT_VALUE)==0: break
while self.GetInputState(c4d.BFM_INPUT_MOUSE, c4d.BFM_INPUT_MOUSELEFT, msg): #Wait for next mouse click
if msg.GetLong(c4d.BFM_INPUT_VALUE)==1: break
while self.GetInputState(c4d.BFM_INPUT_MOUSE, c4d.BFM_INPUT_MOUSELEFT, msg): #While the left mouse button is held down
if msg.GetLong(c4d.BFM_INPUT_VALUE)==0: break
mouseX = int(msg[c4d.BFM_INPUT_X])
mouseY = int(msg[c4d.BFM_INPUT_Y])
print mouseX, mouseY