Hello everyone, I'm trying to learn MEL scripting coming from a background of Unity C#. Currently I'm working on a script that moves all selected vertices to 0 on the x-axis. I borrowed this script from another forum but it doesn't seem to work when the object has moved: string $verts[] = `ls -sl -fl`;<br> for($vert in…
What Axi5 said that one little line will do. If, however, you still want to know how to select move pivot to the origin and freeze transformation you really don't have to switch selection mode back and forward from Object to Component. The trick is that all you need is somehow to get the name of the object while you still…
Something to be aware of: If you use the -hilite flag with the ls command, you can potentially get more objects returned than just the object on which you have vertices selected. For example, make two cylinders, select both objects, press F9, then select vertices on just one of the cylinders. If you perform:…
This will only change if you used selectMode -component first, hotkeys or marking menus use a different method to enter component mode. (I forget what, offhand toggleSelSomething?)
Thank you very much for your detailed answer, Klaidio2U!That is very educating for me. Your workaround for toggling between the selection modes also seems to work well. Maybe it's me, but I'm still wondering why the selectMode -object<span>;</span> doesn't seem to work properly. Is this just a limitation/bug of the Mel…