Quantcast
Channel: mel wiki
Viewing all articles
Browse latest Browse all 610

How do I turn the mouse into a mocap device?

$
0
0
recordAttr
Note : This tool only appears to work if Maya is in cm UI units :S
  • Example:
  • Select the object you want to record motion on.
  • In the script editor, enter
recordAttr -at "translateX" -at "translateY"; 
// to control the tx and ty for example
  • Execute that bit of code. You'll see new "record1" outputs on your object
  • Next type in the script editor, but don't execute yet:
play -record;
  • Now:
    • select your object in the camera view,
    • go back and highlight 'play -record' in the script editor,
    • move your mouse back over your object (but do not pick it!),
    • and hit the 'Enter' button on the NUMBER pad.
    • This will execute the mel code, but leave your mouse right over your object ready to be selected and moved.
  • This will start the recorder, capturing your mouse movement.Click on the object, and start moving it.Obviously, you should constrain you translation plane to the two axes you've selected before you start this process.Hit Esc when done.
  • This can work for any attr you want actually, I just used trans as an example.
  • Also, if you want to delete the motion and try again, you'll need to also delete the "record" nodes that are output connections to your animated node as well. You can use this code:
delete `ls -type record`;

Viewing all articles
Browse latest Browse all 610

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>