Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > PYTHON Development
  New Posts New Posts
  FAQ FAQ  Forum Search

Drawing crosshairs

Author
Message
  Topic Search Topic Search
hgcafe View Drop Down
Member
Member


Joined: 2011 Oct 26
Online Status: Offline
Posts: 60
Direct Link To This Post Topic: Drawing crosshairs
    Posted: 2013 Jan 16 at 1:00am

Hey guys,

I got myself stuck again in something maybe not so easy.

I'm trying to create crosshairs in the orthogonal views for my tool-plugin, corresponding to the mouse-position.

In particular I have problems in my "Draw" method, as it seems to be the only place to draw lines into the viewport but only updates as something in the scenes changes: camera, objects, but not the mouseposition.

The mouse position is another problem, as the "MouseInput" method only seems to kick in when one mouse button is clicked. 

So while I got this hole process working with clicking and then dragging the mouse, I would really prefer not to click first. In a way this seems so be possible as the internal lighting-tool does something similar, or just selecting polygons or points of mesh results in a highlighting.

Again a short recap what I'm doing:

- checking the mouse position in the MouseInput method (sadly by clicking first), and forcing a redraw by using c4d.DrawViews(c4d.DA_ONLY_ACTIVE_VIEW|c4d.DA_NO_THREAD|c4d.DA_NO_ANIMATION)

- drawing some lines in the viewport according to the retrieved mouse position in the Draw method

Maybe there is an easier or more logical way someone could explain to me.

Thanx

Phil

Back to Top
Satara View Drop Down
Member
Member


Joined: 2009 Mar 30
Location: Germany
Online Status: Offline
Posts: 128
Direct Link To This Post Posted: 2013 Jan 16 at 2:59am
Maybe you could use GetCursorInfo() which is called when the mouse is moved over the viewport and call DrawViews there?
Back to Top
hgcafe View Drop Down
Member
Member


Joined: 2011 Oct 26
Online Status: Offline
Posts: 60
Direct Link To This Post Posted: 2013 Jan 16 at 3:13am

I honestly don't know why I overlooked that method.

Thanks for the tip, works perfectly :)

Phil



Edited by hgcafe - 2013 Jan 16 at 3:16am
Back to Top

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.109 seconds.