Message 1 of 3
apply random rotation animation to selected objects

Not applicable
05-25-2017
03:28 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
disclaimer: total MEL / Expression newb.
i'm trying to develop a mel script that will automatically apply rotation animation expressions to selected objects. i found this script, which works for translation.
proc applyExpressionToSelection() { vector $rMx = << 10,2,10 >>; // maximum x,y,z randomizations vector $rMn = << -10,0,-10 >>; // minimum x,y,z randomizations string $mode = "move"; // "move", "rotate" or "scale" for ($object in `ls -sl -tr`) evalEcho($mode+" "+`rand ($rMn.x) ($rMx.x)`+" "+`rand ($rMn.y) ($rMx.y)`+" "+`rand ($rMn.z) ($rMx.z)`+" "+$object); } applyExpressionToSelection();
i cannot figure out how to convert this to rotation. also when i first execute this script my objects move around. i'd like everything to stay in place, then begin moving when i hit play.
any help is greatly appreciated.
thanks!