Is there a way to show selected points in world position in Maya ?
I'm trying to understand repeat command at mouse position, if you move a point on a mesh what is it related to; world or local position because, if you repeat the same command on another point on the mesh the results are not the same as was the first point ?
Replies
edit : not sure if that answered your question tho
Which means it will only give you the mouse position when you click somewhere in the viewport.First you need to declare the -pressCommand flag and give it a procedure or any other command to execute.The procedure we are talking about here is the queried result of the -anchorPoint flag.
Basically,everytime you click somewhere in the viewport the -pressCommand will get the -anchorPoint which will retrieve the mouse position.
This is what it looks like in MEL :
Pretty sure you can shorten the script,but having the -pressCommand in a procedure can help for future use.
The script worked, although after I run it a few times it fires an error on line 8 ?
Where did you get MPosition ?
MPosition is the name of your context tool here.
That's because you're trying to create a context tool twice,which is technically impossible since two tools can't have the same name AFAIK.
The line "setToolTo MPosition" is all you need to start the tool if you have already run it at least one time in a Maya session.To make the tool persistent forever,you need to add an if statement that run the whole script I've provided if the "MPosition" context tool doesn't exist,and if it exists only the "setToolTo MPosition" line will be executed.
The final result should look like this :
If you see an "-exists" flag in a Maya command always assume that it might be there to let the user change his script's behavior depending on it's value.
That's just a personal preference here.When working on big projects you tend to manage hundreds of lines and i really like making everything clear and using "float $Something" instead of "$Something" is also more readable imho.I've also never encountered a bug using this technique,so this might explain that
Store the point mouse position, select another point then repeat command. I'm not sure what repeat command does at present but when you select a point, followed by moving it, select another point and apply the repeat command it is erratic, where the other point is moved.
dagObjectHit
http://tech-artists.org/forum/showthread.php?419-popUpMenu-mel-notes-quot-dagObjectHit-quot
example showing right click viewport feedback but the same could be done with modifiers only.
(without clicking on the highlighted component)