Solved! Go to Solution.
Solved by rajasekaransurjen. Go to Solution.
Hi,
Try this...
global proc UE4_Man_Scale() { string $file_Path = (`internalVar -userPrefDir`) + "icons/3D_Ghost_Script/Unreal_Character_Scale.ma"; file -r -type "mayaAscii" -ignoreVersion $file_Path; }
Yes this working thank you so much. I have one doubt I assigned this procedure to the button (as a command) but when I click on the ( button1 ) it is refrencing that character. Is that possible when I again hit that button it should remove the refrenced character using any alternate key (like holding alt + Button1) or (ctrl + button1).
To remove the refrence - - - The command is ( -removeReference(-rr) )
SEE THE COMMAND _ _ _ _
{
// create a window
window;
// define the layout of controls added
// to the window.
columnLayout;
// create a couple of buttons
button -label "button1" -c "UE4_Man_Scale()";
// show the window we last created
showWindow;;
}
// It will import your character as a refrence
UE4_Man_Scale();
global proc UE4_Man_Scale()
{
string $file_Path = (`internalVar -userPrefDir`) + "icons/3D_Ghost_Script/Unreal_Character_Scale.ma";
file -r -type "mayaAscii" -ignoreVersion $file_Path;
}
Hi,
Try this....
global proc UE4_Man_Scale() { string $file_Path = (`internalVar -userPrefDir`) + "icons/3D_Ghost_Script/Unreal_Character_Scale.ma"; string $rsRefQry[] = `file -q -r`; string $rsRefFile[]; int $rsCont; for($i=0;$i<size($rsRefQry);$i++) { $rsRefFile[$i] = `referenceQuery -f -shn $rsRefQry[$i]`; } for($j=0;$j<size($rsRefQry);$j++) { if($rsRefFile[$j]=="Unreal_Character_Scale.ma") { $rsCont += 1; } } if($rsCont==0) { file -r -type "mayaAscii" -ignoreVersion $file_Path; } else { file -rr $file_Path; } }
And on more thing If I press any button in the keyboard and left mouse button it is removing the reference which I don't want. ex ( F + LMB ) removing the reference.
Finally Figured it out thank you so much man here is the final command
// final
{
// create a window
window -title "Nut" -menuBar true -w 220 -h 200 "";
// define the layout of controls added
// to the window.
columnLayout;
// create a collapsible frame layout
frameLayout -collapsable true -label "Nuts";
// add the other controls
flowLayout -columnSpacing 1 -w 220 -h 30;
// create six symbol buttons with related mel command
symbolButton -image "commandButton.png" -command "Character()";
setParent ..;
// show the window we last created
showWindow;
}
global proc Character()
{
string $file_Path = (`internalVar -userPrefDir`) + "icons/3D_Ghost_Script/Unreal_Character_Scale.ma";
int $mods = `getModifiers`;
print ("Modifiers are:");
int $getModifierPressed = `getModifiers`;
if ( $getModifierPressed == 0)
{
string $file_Path = (`internalVar -userPrefDir`) + "icons/3D_Ghost_Script/Unreal_Character_Scale.ma";
file -r -type "mayaAscii" -ignoreVersion $file_Path;
}
//If I PRESSED SHIFT IT WILL IMPORT CHARACTER
if (($mods / 1) % 2)
{
file -rr $file_Path;
}
//If I PRESSED CTRL IT WILL IMPORT CHARACTER
if (($mods / 4) % 2)
{
file -ir $file_Path;
}
}
// if you want to use alt then here is the command I'm writing this so it would be benefit for other users
if (($mods / 😎 % 2) print (" Alt");
Can't find what you're looking for? Ask the community or share your knowledge.