mouseTrack() function Any one use it?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 03 March 2006   #1
mouseTrack() function Any one use it?

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.
Paul Neale
Old 03 March 2006   #2
I've used it in a couple of scripts... What sort of trouble are you having?
Old 03 March 2006   #3
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.
Paul Neale
Old 03 March 2006   #4
Hey Paul,

I haven't used the mouseTrack() function specifically but I did use mouse tracking in this might be helpful to look at
Attached Files
File Type: zip (1.0 KB, 42 views)
Old 03 March 2006   #5
Thanks. I have used all the other mouse tracking tools before just never mouseTrack().
Paul Neale
Old 03 March 2006   #6
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
  mouseTrack trackCallback:MyCallbackFn 

hope this helps

Old 03 March 2006   #7
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.
Old 03 March 2006   #8
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.

Old 03 March 2006   #9
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..

Paul Neale

Last edited by magicm : 03 March 2006 at 11:13 PM.
Old 03 March 2006   #10
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).
Old 03 March 2006   #11
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.
Paul Neale
Old 03 March 2006   #12
Originally Posted by Moosley: 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
Old 03 March 2006   #13
Oh yeah! Never noticed that, always 'misread' it to be 'Abort '
Old 03 March 2006   #14
I mixed up the two functions.. I use mouseTrack only instead of tools because mouseTrack does indeed allow viewport manipulations.

- Martijn
Old 03 March 2006   #15
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 11:51 AM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.