PDA

View Full Version : mouseTrack() function Any one use it?


PEN
03-13-2006, 06:54 PM
For the life of me I can't get this one working. I'm trying to get the call back setup and I can't find the syntax that works. The help needs some help I think.

Moosley
03-13-2006, 07:49 PM
I've used it in a couple of scripts... What sort of trouble are you having?

PEN
03-13-2006, 08:38 PM
Do you have any example code on how to use the call back function? I just can't get the syntax right. It isn't doing a thing.

stuh505
03-13-2006, 09:23 PM
Hey Paul,

I haven't used the mouseTrack() function specifically but I did use mouse tracking in this script....it might be helpful to look at

PEN
03-13-2006, 09:36 PM
Thanks. I have used all the other mouse tracking tools before just never mouseTrack().

cyberluigi2k
03-14-2006, 09:55 AM
I think this way works, although #mouseAbout doesn't seem to work... (press ESC to exit tracking)



fn MyCallbackFn msg ir obj faceNum shift ctrl alt =
(
myStr = "Pos ("+mouse.pos.x as string +", "+ mouse.pos.y as string + ")"

case msg of
(
#freeMove: myStr += " [freeMove]"
#mousePoint: myStr += " [left click]"
#mouseMove: myStr += " [left drag]"
#mouseabout: myStr += " [righ click]"
)

print myStr
#continue
)

mouseTrack trackCallback:MyCallbackFn



hope this helps

/Lui

Moosley
03-14-2006, 10:28 AM
cyberluigi2k's code is right except that it's #mouseAbort instead of #mouseAbout.
You can also get it to track on a specific object using the ' on:<node> ' option in the call.

magicm
03-14-2006, 01:18 PM
I've used the mousetrack function before but if I remember correctly it doesn't allow any viewport operations (panning/zooming). That's why I prefer mouse tools.

Cheers,
Martijn

PEN
03-14-2006, 01:38 PM
Mouse tools doesn't allow of it either that is why I'm looking at other methods

Oops!! Sorry Paul... I thought I was replying to your message but I accidentally pressed the Edit button instead and removed most part of your post.. :blush:

Martijn

Moosley
03-14-2006, 01:50 PM
You can rotate and pan/zoom with mousetrack via the middle mouse button. Just not with the viewport control buttons (which change the focus of the cursor).

PEN
03-14-2006, 01:56 PM
Interesting, mouseTools doesn't allow for that at all. I still think that I will script my own solution so that I don't have to start and stop the tool. MouseTrack disables the rest of the keyboard from working though so you can't change from say right to front viewport.

cyberluigi2k
03-14-2006, 05:30 PM
cyberluigi2k's code is right except that it's #mouseAbort instead of #mouseAbout.
You can also get it to track on a specific object using the ' on:<node> ' option in the call.

LOL!! it seems so obvious... i was thinking why on earth they choose mouseabout for the right button.... anyway in my deffense i can say that i took it from the documentation... you can read at "mouseTrack() Function" topic


The 'msg' argument is a message code that indicates what kind of action occurred, and can be one of:

#freeMove - means the mouse is moved without a button being pressed

#mousePoint - means the left mouse button has just been pressed

#mouseMove - means the mouse is being dragged with the left button down

#mouseAbout- means the right mouse button was clicked, normally meaning cancel

Moosley
03-14-2006, 05:35 PM
Oh yeah! Never noticed that, always 'misread' it to be 'Abort ' :)

magicm
03-14-2006, 11:14 PM
I mixed up the two functions.. I use mouseTrack only instead of tools because mouseTrack does indeed allow viewport manipulations. :)

- Martijn

CGTalk Moderation
03-14-2006, 11:14 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.