Randomize Channel Revisited and/or shaker script

Didn't have any luck before getting an answer to this question, either from the forum or from the author, but I've got to ask again; has anyone had any luck getting the Randomize Channel script to work in Maya 3.0? If so, PLEASE PLEASE I'd appreciate it immensely if you could contact me, or reply with some hints at getting it setup to work. As it stands, I can add the thing to a shelf, open it in the script editor, whatever, but it won't create a UI, or in fact do anything else. Alternatively, if someone has been able to DL the Shaker script, I'd love to get my hands on that as well; the link to DL from it's homepage seems to be dead.

Hey.
RndChannel script works fine in 4.0, and it should have no problems in 3.0, not just because Dirk states it so but because the script was created in '99 and hasnt needed an update since.

Have you checked what the script editor has to say about calling the script ....messages at the point of failure to initiate its UI? Should dump them here if you cant see the prob yourself. It maybe conflicting with some-other-majig you have flipped or installed. You've tried calling it on fresh prefs right? It's a sweet lil script (love your work Dirk), worth figuring where your prob is.

Shaker DL was fine. Its a fair bit simpler, just jigles tranz channels as random values w/i a definable range, output as keyed anim curves. It may well be just the ticket your after. Here it is:

// Shaker 1.2 - Maya 2.5

// Changes in 1.2
//
// you dont have to input the name, just pre-select
// the objects you want to animate and hit enter....
//
// tanx to Alexandre PIT !
//

// Created by:
// Luiz Fernando Valente
// e-motion digital studios inc.
// lfvsouza@zipmail.com.br

// This script allows you "shake" an object creating
// automatic keyframe with random animation over time

// usage:
//
// just type:
//
// shaker;
//
//
// enjoy.

// ------- Program ------------

global proc shaker ()
{
// choose select tool
global string $gSelect;
setToolTo $gSelect;

if (`window -exists ui\_shaker` == true)
	deleteUI ui\_shaker;

window -maximizeButton false -resizeToFitChildren true
       -title "Shaker 1.2" -iconName "Shaker" ui\_shaker;

columnLayout -adjustableColumn true -cal "left";

                    floatSliderGrp
			-label "Translate X"
			-field true
			-precision 1
			-value 1
			-minValue 0
			-maxValue 50
			-sliderStep .1
			trax;
		floatSliderGrp
			-label "Translate Y"
			-field true
			-precision 1
			-value 1
			-minValue 0
			-maxValue 50
			-sliderStep .1
			tray;
                    floatSliderGrp
			-label "Translate Z"
			-field true
			-precision 1
			-value 1
			-minValue 0
			-maxValue 50
			-sliderStep .1
			traz;
		floatSliderGrp
			-label "Rotate X"
			-field true
			-precision 0
			-value 20
			-minValue 0
			-maxValue 360
			-sliderStep 1
			rotx;
                    floatSliderGrp
			-label "Rotate Y"
			-field true
			-precision 0
			-value 20
			-minValue 0
			-maxValue 360
			-sliderStep 1
			roty;
                    floatSliderGrp
			-label "Rotate Z"
			-field true
			-precision 0
			-value 20
			-minValue 0
			-maxValue 360
			-sliderStep 1
			rotz;
		intSliderGrp
			-label "Anim Start"
			-field true
			-value 0
			-minValue 0
			-maxValue 300
                            -sliderStep 1
			anistart;
                    intSliderGrp
			-label "Anim End"
			-field true
			-value 50
			-minValue 0
			-maxValue 300
                            -sliderStep 1
			aniend;
                    intSliderGrp
			-label "Anim Step"
			-field true
			-value 10
			-minValue 0
			-maxValue 300
                            -sliderStep 1
			anistep;
                    button
			-label "Execute Shaker"
			-align "center"
			-command "v\_shaker";

                    button
			-label "Close Shaker"
			-align "center"
			-command "c\_shaker";

showWindow ui\_shaker;

}

global proc v_shaker ()

{

// Criando Variaveis entradas pelo usuario

string $nomes[] = ls -sl;
int $quant = size($nomes);
float $trax = floatSliderGrp -q -value trax;
float $tray = floatSliderGrp -q -value tray;
float $traz = floatSliderGrp -q -value traz;
float $rotx = floatSliderGrp -q -value rotx;
float $roty = floatSliderGrp -q -value roty;
float $rotz = floatSliderGrp -q -value rotz;
int $anistart = intSliderGrp -q -value anistart;
int $aniend = intSliderGrp -q -value aniend;
int $anistep = intSliderGrp -q -value anistep;

// Criando Variaveis auxiliares

int $conta, $lope;
float $antigo;
float $atual;
float $randomico;
float $teste;
float $itrax,$itray,$itraz,$irotx,$iroty,$irotz;
string $nome;

// Criando LOOP para todos os elementos
// selecionados para Shaker.

for($lope=0;$lope{

$nome = $nomes[$lope];

// Setup inicial da animacao

select $nome;
currentTime -e $anistart;
setKeyframe -at translateX;
setKeyframe -at translateY;
setKeyframe -at translateZ;
setKeyframe -at rotateX;
setKeyframe -at rotateY;
setKeyframe -at rotateZ;

// Pegando os parametros iniciais

$itrax = eval ("getAttr " + $nome + ".translateX");
$itray = eval ("getAttr " + $nome + ".translateY");
$itraz = eval ("getAttr " + $nome + ".translateZ");
$irotx = eval ("getAttr " + $nome + ".rotateX");
$iroty = eval ("getAttr " + $nome + ".rotateY");
$irotz = eval ("getAttr " + $nome + ".rotateZ");

// Animando agora nos tempos pedidos

for ($conta= $anistart+$anistep; $conta<= $aniend; $conta=$conta + $anistep)
{
currentTime -e $conta;

// TRANSLATE X

$randomico=eval("rand(-" + $trax + "," + $trax + ")" );
$antigo= eval("getAttr " + $nome + ".translateX" );
$wait = $antigo + $randomico ;
if ($wait>$itrax + $trax) $wait=$itrax + $trax;
if ($wait    eval("setAttr " + $nome + ".translateX " + $wait);
setKeyframe -at translateX;

// TRANSLATE Y

$randomico=eval("rand(-" + $tray + "," + $tray + ")" );
$antigo= eval("getAttr " + $nome + ".translateY" );
$wait = $antigo + $randomico ; 
if ($wait>$itray + $tray) $wait=$itray + $tray;
if ($wait    eval("setAttr " + $nome + ".translateY " + $wait);
setKeyframe -at translateY;

// TRANSLATE Z

$randomico=eval("rand(-" + $traz + "," + $traz + ")" );
$antigo= eval("getAttr " + $nome + ".translateZ" );
$wait = $antigo + $randomico ; 
if ($wait>$itraz + $traz) $wait=$itraz + $traz;
if ($wait    eval("setAttr " + $nome + ".translateZ " + $wait);
setKeyframe -at translateZ;

// ROTATE X

$randomico=eval("rand(-" + $rotx + "," + $rotx + ")" );
$antigo= eval("getAttr " + $nome + ".rotateX" );
$wait = $antigo + $randomico ; 
if ($wait>$irotx + $rotx) $wait=$irotx + $rotx;
if ($wait    eval("setAttr " + $nome + ".rotateX " + $wait);
setKeyframe -at rotateX;

// ROTATE Y

$randomico=eval("rand(-" + $roty + "," + $roty + ")" );
$antigo= eval("getAttr " + $nome + ".rotateY" );
$wait = $antigo + $randomico ; 
if ($wait>$iroty + $roty) $wait=$iroty + $roty;
if ($wait    eval("setAttr " + $nome + ".rotateY " + $wait);
setKeyframe -at rotateY;

// ROTATE Z

$randomico=eval("rand(-" + $rotz + "," + $rotz + ")" );
$antigo= eval("getAttr " + $nome + ".rotateZ" );
$wait = $antigo + $randomico ; 
if ($wait>$irotz + $rotz) $wait=$irotz + $rotz;
if ($wait    eval("setAttr " + $nome + ".rotateZ " + $wait);
setKeyframe -at rotateZ;

}  // FINAL DO FOR DE ANIMACAO

} // FINAL DO FOR DE REPETICAO PARA CADA ELEMENTO

} // FINAL DO PROCEDIMENTO

global proc c_shaker ()
{
deleteUI ui_shaker;
}

C.

Hi,

Well I had absolutly no problem using randomize channel on Maya 3...it's really simple just folow the instruction and honnestly it works like a charme..I really love that script.
Anyway I remenber something about Tom Kluysken did in a tut using a fractal node connecting to the attribute you need to randomize + it has all sort of link to some random stuff mel..

Check it out at
http://aw.aliaswavefront.com/pit/maya/mayaqueen/

Cheers

thematt

Okay, sorry if I wasn't clear. I'm absolutely positive the problem lies with me, and NOT with the script, and I'm determined to get it working becuase I've heard how good it is. Tried setting up the way the site reccommends (MEL in the My DocumentsMaya3.0scipts folder, and the icon file in MY DocumentsMaya3.0prefsicons folder, using Win2K). Opened the script in the editor, highlighted and dragged to the shelf. This creates the shelf button, but when clicked, generates the error "Error: line 1: Cannot find procedure "rndChannel.mel". Since I'm not familiar with MEL syntax, and only slightly more used to using the editor window, I'm not clear on just what this is indicating. Should the script be somewhere else? Is there something I've missed in setting it up? Agian, thanx for all the responses!

Hum...when you say My document do you really mean that or do you mean...WinntProfile(yourLogMaya3.0script..cause that's where it suppose to go.
If still it doesn't work just go on Dick site it had put a command line that you type in the mel script of maya and it return the complete path of where you should put the mel.
With that you should be fine.

cheers

thematt

Edited by thematt on 08/16/01 08:16:55 AM.

[Sorry, didn't realize it was on window 2000...maybe you're right then...
Check on Dick Bialluch it'll help you with that little script ( the one that return the path)

Cheers

thematt

hi there...
please try this...
Make sure the MELscript is in the correct folder... then start Maya...
on the command line, simply type in the name of the script eg. "shaker" (without the inverted commas - do not bother importing it into the script editor or onto a shelf) and press return.
hopefully this should work.
good luck
Ayman

Just had to say thanx to everyone who responded...I learned a few cool things about calling scripts thanks to all of you! At the same time, I have to, rather shame-facedly, admit that I finally figured out what was going wrong, and boy do I feel like a total chode...apparently, I...er....um....FORGOT that MEL insists on everything being case-sensitive, and therefore, when I'd call for "rndchannel", Maya had NO idea that what I really wanted was "rndChannel". Shaker (or rather "shaker") on the other hand worked perfectly, which tipped me off to what I was doing. Still don't know why they don't work from the shelf, but thanx for the tip on calling the scripts from the command line! And thanx to both authors for such cool, and flexible scripts!!