PDA

View Full Version : Maya Hotkeys


Sanctuary
07-28-2002, 10:49 PM
i`ve saw a lot of ppl is interested in hotkey ... :D

well ... post whatever you think it`s useful

Sanctuary
07-28-2002, 10:50 PM
make a new hotkey and assign this code (i have Alt+x)


string $currPanel = `getPanel -withFocus`;
if ("" != $currPanel && ("modelPanel" == `getPanel -to $currPanel`))
{
int $xrayonoff = `modelEditor -q -xray $currPanel`;
switch ($xrayonoff)
{
case 0: modelEditor -e -xray true $currPanel;
break;
case 1: modelEditor -e -xray false $currPanel;
break;
default: break;
}
$xrayonoff = `modelEditor -q -xray $currPanel`;
print("X-Ray: "+$xrayonoff+"\n");
} else {
error "No modeling panel selected or invalid.";
}

Sanctuary
07-28-2002, 10:51 PM
make a new hotkey and assign this code (i have Alt+w)


string $currPanel = `getPanel -withFocus`;
if ("" != $currPanel && ("modelPanel" == `getPanel -to $currPanel`))
{
int $xrayonoff = `modelEditor -q -wos $currPanel`;
switch ($xrayonoff)
{
case 0: modelEditor -e -wos true $currPanel;
break;
case 1: modelEditor -e -wos false $currPanel;
break;
default: break;
}
$wosonoff = `modelEditor -q -wos $currPanel`;
print("WireframeOnShaded: "+$wosonoff+"\n");
} else {
error "No modeling panel selected or invalid.";
}

Sanctuary
07-28-2002, 10:53 PM
make two new hotkeys and assign this code (i use Ctrl+, and Ctrl+.)

Decrease Grid Size


float $myRes ;
$myRes = `grid -q -sp`;
$myRes=$myRes*2.0;
$myRes=numZero($myRes);
string $myExe = "grid -spacing "+$myRes;
eval $myExe;
print ("Grid size is : "+ $myRes +"\n");

global proc float numZero(float $myRes){
string $myString;
int $mySize;
if ($myRes < 1){
$myString=(string) $myRes ;
$mySize=`size($myString)`;
$myString=substring($myString,3,$mySize);
$myString=`match "0*" $myString`;
$myString="1"+$myString+"0";
$myScale=(float) $myString;
$myRes=$myRes*$myScale;
$myRes=`floor $myRes`;
if ($myRes == 4 ){
$myRes = 5;
}
$myRes=$myRes/$myScale;

return $myRes;
}else{
$myRes = `trunc $myRes`;
$myString=(string) $myRes ;
$mySize=`size($myString)`;
$mySize=$mySize-1;
$myString = substring($myString ,1,1);
if ($myString == "4") {
$myString = "5";
}
$myRes=(float) $myString;
$myRes = $myRes * (`pow 10 $mySize`);
return $myRes;
}
}



Increase Grid Size


float $myRes ;
$myRes = `grid -q -sp`;
$myRes=$myRes/2.0;
$myRes=numZero($myRes);
string $myExe = "grid -spacing "+$myRes;
eval $myExe;
print ("Grid is : "+ $myRes +"\n");

global proc float numZero(float $myRes){
string $myString;
int $mySize;
if ($myRes < 1){
$myString=(string) $myRes ;
$mySize=`size($myString)`;
$myString=substring($myString,3,$mySize);
$myString=`match "0*" $myString`;
$myString="1"+$myString+"0";
$myScale=(float) $myString;
$myRes=$myRes*$myScale;
$myRes=`floor $myRes`;
if ($myRes == 4 ){
$myRes = 5;
}
$myRes=$myRes/$myScale;

return $myRes;
}else{
$myRes = `trunc $myRes`;
$myString=(string) $myRes ;
$mySize=`size($myString)`;
$mySize=$mySize-1;
$myString = substring($myString ,1,1);
if ($myString == "4") {
$myString = "5";
}
$myRes=(float) $myString;
$myRes = $myRes * (`pow 10 $mySize`);
return $myRes;
}
}



inspired by a mel script from www.Highend3D.com

bigfatMELon
07-29-2002, 12:17 AM
Sheesh. You guys are workin too hard at this. Go to www.highend3d.com and download ToggleMania. It creates hotkey code and shelf buttons for single and custom multi-toggles from a huge list of possibilities.

-jl

Sanctuary
07-29-2002, 07:01 AM
hehe ... i have the script, but i`m not using it because it`s too HUGE and i don`t like the GUI, sorry

Razvan
07-29-2002, 07:42 AM
Or you can use this little thingy...

--cut here--

//toggle Xray

string $panel=(`getPanel -wf`);
modelEditor -e -xray(! `modelEditor -q -xray $panel`) $panel;

--cut here--

...for toggling Xray ;)

try not to steel this one too Alin :thumbsdow

bigfatMELon
07-29-2002, 07:59 AM
Originally posted by Sanctuary
hehe ... i have the script, but i`m not using it because it`s too HUGE and i don`t like the GUI, sorry

Ummm... you only need the GUI on screen long enough to use the Make Button or Print Toggle feature. It's a toggle BUILDER as well as a toggler.

-jl

CitizenVertex
07-29-2002, 08:35 AM
I don't find it useful to assign toggles for viewmodes to individual hotkeys. I don't find myself switching them often enough to warrant a seperate key for each toggle. I used toggle mania to make a marking menu and assigned that to a hotkey. I just make hotkeys for functions I use often and repetitively. Here's a list of some of my keys form another thread.

I have the MJPolytools functions in a marking menu assigned to a hotkey.

ctrl+w: Append Polygon
ctrl+e: Collapse
ctrl+r: Flip Triangle Edge
ctrl+t: Triangulate Polygon
ctrl+y: Quadrangulate Polygon
ctrl+f: Split Polygon Tool
alt+ctrl+v: Delete Vertex
alt+ctrl+e: Extrude Face
alt+ctrl+w: Extrude Edge
alt+ctrl+q: Merge Vertecies

Sanctuary
07-29-2002, 10:37 AM
try not to steel this one too Alin :thumbsdow

well Razvan sorry to disappoint you, but i haven`t steal anything, i haven`t say that is my piece of code (wich means i`m not the one how wrote it) ... i just say i`m using it ... so next time when you try to offend someone make sure you have all the pieces for the puzzle ok?

tkx for the code anyway ... if i`ll use the code you`ve posted means i`m a thief ? :(

Razvan
07-29-2002, 11:13 AM
tkx for the code anyway ... if i`ll use the code you`ve posted means i`m a thief ? :(

No but I've seen you post before and you never said you didn't wrote the code so ...

bigfatMELon
07-29-2002, 03:46 PM
Heh... you know, when a script is just two lines of code that mostly consists of calls to functions written by Alias, I'm not so sure the issue of credit lies with any of us here.

-jl

Sanctuary
07-29-2002, 07:26 PM
Razvan let`s drop it and focus on the thread topic

bigfatMELon you have right

CGTalk Moderation
01-13-2006, 12:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.