X-Ray shortcut
In the tutorials you use an X-Ray shortcut now ive found a script which can do this only it does not say where i should put this?
And how can i make it a button on the custom menu ? // Toggle Xray // string $visPanel[]=`getPanel -vis`; int $mode; if (size($visPanel)>0) { for ($panel in $visPanel) { if (`match "^modelPanel" $panel`=="modelPanel") { $mode=`modelEditor -q -xray $panel`; if ($mode>0) modelEditor -e -xray 0 $panel; else modelEditor -e -xray 1 $panel; } } print ("\nxray="+$mode+"."); } else print ("\nNo model panels to modify."); |
Run in the script editor (bottom-left bottom in UI) from the pull-down menu, in the script editor, you can specify a shelf item....
Hope this helps.... |
Or you can run the script, select it in the script editor, and MMB drag it onto the shelf...
EDIT: The other way is probably better since you can then name the script... |
Ah works great thanks allot, :D do you also know how i can modify the icon?
|
Heres the one I use, its a lot better. do the script editor thing.
____________________________________________ // declare variables string $selected[]; string $hilited[]; string $object; int $test[]; int $hold; // assign values to variables for selected objects $selected = `ls -sl -dag -ap -typ surfaceShape`; $hilited = `ls -hl -dag -ap -typ surfaceShape`; // loop through any objects in component mode // and toggle their x-ray display for ($object in $hilited){ $test = `displaySurface -q -xRay $object`; $hold = $test[0]; if ($hold != false) displaySurface -xRay false $object; else displaySurface -xRay true $object; // clear test variable clear $test; } // loop through any objects in object mode // and toggle their x-ray display for ($object in $selected){ $test = `displaySurface -q -xRay $object`; $hold = $test[0]; if ($hold != false) displaySurface -xRay false $object; else displaySurface -xRay true $object; // clear test variable clear $test; } // clear selection variables clear $selected; clear $hilited; // Result: 0 // |
hmm your does not seem to work? also why is yours better ?
Ah nevermind i see nw it only x-rays selected parts this is better thanks ;) |
It works good;)
|
All times are GMT. The time now is 02:26 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018