Need Help on Mel scripting


#1


hey am not a professional programmer i want a script please Help me with this the image shows what is does currently. but it works on a single object i want to execute that with multiple objects plz help


string $nos[] = ls -sl;

float $popd[] = pointPosition -w $nos;

SelectToggleMode;

SelectToggleMode;

string $obh[] = ls -sl -fl;

move -rpr $popd[0] $popd[1] $popd[2] ($obh[0]+".scalePivot") ($obh[0]+".rotatePivot");



#2

Put the code in a separate function that recieves one parameter: The mesh.
Write a for-loop where you go through all meshes in your selection. Call your pivot-function for every mesh there.

How to write for-loops:
https://nccastaff.bournemouth.ac.uk/jmacey/RobTheBloke/www/mel/for_in_loop.html


#3

Doesn’t it actually take longer to do this than to snap the pivot manually toggling D-V?