Hello!
I decided to create script to toggle between Bevel parameters. It should work like this: you press a hotkey and it launch Bevel tool, then, when the tool is active, you can press the same hotkey and toggle between parameteres like fraction, segment, chamfer, etc. I wrote some code as you can see on the GIF below, but i'm new to MEL, so i dont really know how to make script run with a one hotkey. I know that i should add a proc but i dont know how to do it properly and get errors every time. Maybe someone with good scripting skills can help me with that.
I will include current code here.
if(!`dragAttrContext -ex "attrDrag"`)
dragAttrContext "attrDrag";
string $toggle[];
int $cycle;
dragAttrContext -e -r "attrDrag";
setToolTo "attrDrag";
$toggle = `polyBevel3 -oaf 1 -fp 0 -o 0 -f 0.5 -sg 1 -d 1 -m 0 -ma 0 -c 1 -at 180 -sn 1 -mv 1 -mvt 0 -sa 30 -ch 1`;
if(`currentCtx` != "attrDrag")
$cycle= 0;
switch($cycle){
case 0:
dragAttrContext -e -ct ($toggle[0] + ".f") "attrDrag";
break;
case 1:
dragAttrContext -e -ct ($toggle[0] + ".sg") "attrDrag";
break;
case 2:
dragAttrContext -e -ct ($toggle[0] + ".c") "attrDrag";
break;
default:
dragAttrContext -e -ct ($toggle[0] + ".f") "attrDrag";
$cycle= 0;
break;
}
$cycle++;
Thanks!
Replies
The documentation will say between ctrl and alt, but from what i've experienced, its actually shift and ctrl, i think alt conflicts with other built in context tools, like marking menus.
you could have each method in a different function and use modifiers to toggle between them, without needing to switch tools.
UPD: also there a dr_beveltool in modeling toolkit in Maya, which allows you to add bevel on left click and controls the number of segments on ctrl+shift+LMM. But it works very strangely - after adding this bevel, I can't add more. Even the Script Editor not showing that command
Any update on the tool script? Looks fantastic