CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 03-13-2006, 06:54 PM   #1
PEN
R&D/Technical Director
 
PEN's Avatar
portfolio
Paul Neale
PEN Productions
Canada
 
Join Date: Jun 2002
Posts: 7,415
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
http://paulneale.com
 
Old 03-13-2006, 07:49 PM   #2
Moosley
Frequenter
 
Moosley's Avatar
Moosley
Senior Technical Artist
United Kingdom
 
Join Date: Jun 2005
Posts: 104
I've used it in a couple of scripts... What sort of trouble are you having?
 
Old 03-13-2006, 08:38 PM   #3
PEN
R&D/Technical Director
 
PEN's Avatar
portfolio
Paul Neale
PEN Productions
Canada
 
Join Date: Jun 2002
Posts: 7,415
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
http://paulneale.com
 
Old 03-13-2006, 09:23 PM   #4
stuh505
Lord of the posts
 
stuh505's Avatar
portfolio
Stu H
USA
 
Join Date: Jan 2005
Posts: 2,012
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
Attached Files
File Type: zip graphEditor.zip (1.0 KB, 41 views)
 
Old 03-13-2006, 09:36 PM   #5
PEN
R&D/Technical Director
 
PEN's Avatar
portfolio
Paul Neale
PEN Productions
Canada
 
Join Date: Jun 2002
Posts: 7,415
Thanks. I have used all the other mouse tracking tools before just never mouseTrack().
__________________
Paul Neale
http://paulneale.com
 
Old 03-14-2006, 09:55 AM   #6
cyberluigi2k
Veteran
 
cyberluigi2k's Avatar
Jose Gomez
L.A, US
 
Join Date: Feb 2004
Posts: 38
I think this way works, although #mouseAbout doesn't seem to work... (press ESC to exit tracking)


Code:
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
 
Old 03-14-2006, 10:28 AM   #7
Moosley
Frequenter
 
Moosley's Avatar
Moosley
Senior Technical Artist
United Kingdom
 
Join Date: Jun 2005
Posts: 104
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-14-2006, 01:18 PM   #8
magicm
Maxscript Generator
 
magicm's Avatar
CGSociety Member
portfolio
Martijn van Herk
VFX Technical Director
Freelance
Rotterdam, Netherlands
 
Join Date: Jun 2002
Posts: 1,139
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
 
Old 03-14-2006, 01:38 PM   #9
PEN
R&D/Technical Director
 
PEN's Avatar
portfolio
Paul Neale
PEN Productions
Canada
 
Join Date: Jun 2002
Posts: 7,415
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..

Martijn
__________________
Paul Neale
http://paulneale.com

Last edited by magicm : 03-14-2006 at 11:13 PM.
 
Old 03-14-2006, 01:50 PM   #10
Moosley
Frequenter
 
Moosley's Avatar
Moosley
Senior Technical Artist
United Kingdom
 
Join Date: Jun 2005
Posts: 104
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-14-2006, 01:56 PM   #11
PEN
R&D/Technical Director
 
PEN's Avatar
portfolio
Paul Neale
PEN Productions
Canada
 
Join Date: Jun 2002
Posts: 7,415
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
http://paulneale.com
 
Old 03-14-2006, 05:30 PM   #12
cyberluigi2k
Veteran
 
cyberluigi2k's Avatar
Jose Gomez
L.A, US
 
Join Date: Feb 2004
Posts: 38
Quote:
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-14-2006, 05:35 PM   #13
Moosley
Frequenter
 
Moosley's Avatar
Moosley
Senior Technical Artist
United Kingdom
 
Join Date: Jun 2005
Posts: 104
Oh yeah! Never noticed that, always 'misread' it to be 'Abort '
 
Old 03-14-2006, 11:14 PM   #14
magicm
Maxscript Generator
 
magicm's Avatar
CGSociety Member
portfolio
Martijn van Herk
VFX Technical Director
Freelance
Rotterdam, Netherlands
 
Join Date: Jun 2002
Posts: 1,139
I mixed up the two functions.. I use mouseTrack only instead of tools because mouseTrack does indeed allow viewport manipulations.

- Martijn
 
Old 03-14-2006, 11:14 PM   #15
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 04:04 PM.


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