Майа и звук.
- Автор темы Ifir
- Дата создания
- Рейтинг
- 2
Выбираешь audio ноду, жмешь кнокпку скрипта, создастся локатора с анимацией. Анимация равна амплитуде audio файла. Ествественно, файл должен быть размещен на анимационной дорожке и влезать туда весь.
Плаг в комплекте.
global proc WaveToCurve(){
if(catch(`loadPlugin "C:/Program Files/Autodesk/Maya2008/bin/plug-ins/audioWave.mll"`)){
confirmDialog -title "ERROR!"
-message "plug-in audioWave not found!"
-button "OK";
}
else{
int $min=eval("playbackOptions -q -min");
int $max=eval("playbackOptions -q -max");
string $Sel[]=`ls -sl`;
int $er=0;
if(size($Sel)==0) $er++;
if((eval("nodeType "+$Sel[0])!="audio")) $er++;
print($er);
if($er){
confirmDialog -title "ERROR!"
-message "Please select audio node!"
-button "OK";
}
else{
duplicate -rr;
$Sel=`ls -sl`;
int $offset=0;
string $Audio=$Sel[0];
$offset=eval("getAttr "+$Audio+".offset");
eval("sound -offset 0 "+$Audio);
string $AudioWave=`createNode audioWave`;
eval("connectAttr time1.outTime "+$AudioWave+".input");
eval("connectAttr "+$Audio+".filename "+$AudioWave+".audio");
string $Out[]=`spaceLocator -p 0 0 0`;
string $loc=$Out[0];
string $expr=$loc+".rotateX="+$AudioWave+".output";
expression -s $expr;
eval("bakeResults -simulation true -t \"0:"+$max+"\" -sampleBy 1 -disableImplicitControl true -preserveOutsideKeys false -sparseAnimCurveBake true -at rx "+$loc);
selectKey -clear ;
eval("selectKey -add -k "+$loc+"_rotateX");
eval("keyframe -e -iub true -r -o over -tc "+$offset+" "+$loc+"_rotateX");
}}}
WaveToCurve();
Плаг в комплекте.
global proc WaveToCurve(){
if(catch(`loadPlugin "C:/Program Files/Autodesk/Maya2008/bin/plug-ins/audioWave.mll"`)){
confirmDialog -title "ERROR!"
-message "plug-in audioWave not found!"
-button "OK";
}
else{
int $min=eval("playbackOptions -q -min");
int $max=eval("playbackOptions -q -max");
string $Sel[]=`ls -sl`;
int $er=0;
if(size($Sel)==0) $er++;
if((eval("nodeType "+$Sel[0])!="audio")) $er++;
print($er);
if($er){
confirmDialog -title "ERROR!"
-message "Please select audio node!"
-button "OK";
}
else{
duplicate -rr;
$Sel=`ls -sl`;
int $offset=0;
string $Audio=$Sel[0];
$offset=eval("getAttr "+$Audio+".offset");
eval("sound -offset 0 "+$Audio);
string $AudioWave=`createNode audioWave`;
eval("connectAttr time1.outTime "+$AudioWave+".input");
eval("connectAttr "+$Audio+".filename "+$AudioWave+".audio");
string $Out[]=`spaceLocator -p 0 0 0`;
string $loc=$Out[0];
string $expr=$loc+".rotateX="+$AudioWave+".output";
expression -s $expr;
eval("bakeResults -simulation true -t \"0:"+$max+"\" -sampleBy 1 -disableImplicitControl true -preserveOutsideKeys false -sparseAnimCurveBake true -at rx "+$loc);
selectKey -clear ;
eval("selectKey -add -k "+$loc+"_rotateX");
eval("keyframe -e -iub true -r -o over -tc "+$offset+" "+$loc+"_rotateX");
}}}
WaveToCurve();
Да, мльку я упустил из виду).
Но теперь другая ошибка(
// Error: Plug-in, "audioWave" was compiled against too old a version of the Maya API and is thus incompatible with the current Maya version. (audioWave) //
0// Warning: Unrecognized node type 'audioWave'; preserving node information during this session. //
// Error: The destination attribute 'unknown2.input' cannot be found. //
Может на 2009 майку не пойдёт этот плаг?
Но теперь другая ошибка(
// Error: Plug-in, "audioWave" was compiled against too old a version of the Maya API and is thus incompatible with the current Maya version. (audioWave) //
0// Warning: Unrecognized node type 'audioWave'; preserving node information during this session. //
// Error: The destination attribute 'unknown2.input' cannot be found. //
Может на 2009 майку не пойдёт этот плаг?