call a mouse click command in viewport
On 30/04/2018 at 06:23, xxxxxxxx wrote:
Cinema 4D Version: 16+
Language(s) : C++ ;
what I want to do:
pick camera focus (the pick icon from the camera object, then click in the viewport to pick the focus)
I can already call the command for that camera button
doc->SetActiveObject(cam); DescriptionCommand dcommand; dcommand.id = CAMERAOBJECT_TARGETDISTANCE_PICK; cam->Message(MSG_DESCRIPTION_COMMAND, &dcommand); EventAdd();
now what I want is call a click in the viewport (I already have the BaseDraw*, x and y screen coordinates).
On 03/05/2018 at 02:10, xxxxxxxx wrote:
it is not possible to "inject" mouse clicks via the API.
Instead of virtually trying to imitate user behavior, rather do it the other way round.
You already know the coordinates and do have the BaseDraw. With this you should be able to get the needed distance in various ways and could then simply set the parameter for the camera object.
On 10/05/2018 at 15:58, xxxxxxxx wrote:
thanks, pickobject was what I needed.