Created
May 4, 2013 20:06
-
-
Save phmongeau/5518575 to your computer and use it in GitHub Desktop.
mel script to get opposite object name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc string getMirror(string $obj_name) { | |
string $reg = "_[RL]_"; | |
string $side = `match $reg $obj_name`; | |
string $otherside = "_L_"; | |
if($side == "_L_") { | |
$otherside = "_R_"; | |
} | |
else if ($side == "_T_" || $side == "_C_") { | |
$otherside = $side; | |
} | |
string $s1 = `substitute $reg $obj_name $otherside`; | |
return $s1; | |
} | |
//TEST | |
string $result = getMirror("JT_C_hip_1"); | |
print $result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment