PDA

View Full Version : the mel run again have bug ,who can help me


leecool0506
06-04-2007, 05:59 PM
global proc real_motion_tail()
{
///////////////////////////////////////////////////介面///////////////////////////////////////////////////////////////////
window -title "SOFA Real Motion tail Tool" -widthHeight 500 100;
scrollLayout scrollLayout;
columnLayout -columnAttach "both" 5 -columnWidth 500 -rowSpacing 6 ;
string $ExpainName = "使用說明:至少選取一個Set Key的物件同時執行 ( Build Motion Tail ) 鈕便可產生Motion tail效果";
text -al left -label $ExpainName;
rowColumnLayout -numberOfColumns 3 -columnWidth 1 115 -columnWidth 2 40 -columnWidth 3 30 -ro 1 "both" 6 ;
text -al left -label "動作遲緩總長度";
floatField -pre 2 -value 3 -dragCommand Full_Delayed_time Full_Delayed_value ;
text -label " 秒";
text -al left -label "遲緩彼此間格數";
intField -value 10 -dragCommand Each_Between_time Each_Between_value ;
text -label " frame";
text -al left -label "漸大或漸小比例縮放";
floatField -pre 2 -value 1 -dragCommand Each_Scale_Change Each_Scale_Value;
text -label "value";
button -label "Build Motion Tail" -align "center" -c getMotion_tail;
showWindow;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

global proc getMotion_tail()
{
string $allObjects[]=`ls -sl`; int $allObj_size=`size($allObjects)`;
string $Curve_first[],$Mot_Tail_First[],$Mot_Tail_Inh_Group[],$Mot_Tail_All[];
if( $allObj_size != 0)
{
float $floatField_V = `floatField -q -v Full_Delayed_value`;
int $intField_V = `intField -q -v Each_Between_value`;
float $Numbers_Unit; int $Numbers_Count;

//當前規格
string $Unit_time=`currentUnit -query -time`;
switch ($Unit_time)
{
case "game":
$Numbers_Unit=15;
break;

case "film":
$Numbers_Unit=24;
break;

case "pal":
$Numbers_Unit=25;
break;

case "ntsc":
$Numbers_Unit=30;
break;

case "show":
$Numbers_Unit=48;
break;

case "palf":
$Numbers_Unit=50;
break;

case "ntscf":
$Numbers_Unit=60;
break;
}
////////////////////////////////////////////////////////查數量///////////////////////////////////////////////////////////////////////////////////////////
string $ListMot_Tail_All[],$subNum[]; int $Mot_Tail_All_size=size($ListMot_Tail_All),$lastNewsize,$News_Num[];
string $all[]=`ls -tr`; int $z =0;
for ($one in $all)
{

if (`gmatch $one "Mot_Tail_All*"`)
{
$ListMot_Tail_All[$z] = $one;
$z++;
}
}
if( $Mot_Tail_All_size !=0 )
{

for($z=0;$z<$Mot_Tail_All_size;$z++)
{
$subNum[$z]=`substring $ListMot_Tail_All[$z] 13 13`;
}

for($z=0;$z<$Mot_Tail_All_size;$z++)
{
$News_Num[$z]=$subNum[$z];
}
int $p,$k,$a,$b;
for ($p=0;$p<$Mot_Tail_All_size;$p++)
{
for ($k=$p;$k<$Mot_Tail_All_size;$k++)
{
$a=$News_Num[$p];
$b=$News_Num[$k];
if ($News_Num[$p]>$News_Num[$k])
{
$a=$News_Num[$k];
$b=$News_Num[$p];
$News_Num[$p]=$a;
$News_Num[$k]=$b;
}
}
}
$lastNewsize=$News_Num[$Mot_Tail_All_size-1];
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


int $Numbers_Count=($floatField_V*$Numbers_Unit)/$intField_V;

for ($i=0; $i<$allObj_size; $i++)
{
$j=$i+$lastNewsize+1;
$Curve_first[$i]=`curve -d 1 -p 0 0 -2 -p 0 0 0 -p 0 0 2 -k 0 -k 1 -k 2 -n "Mot_Tail_Fix"`;
$Mot_Tail_First[$i]=`group -n "Mot_Tail_First"`;
$Mot_Tail_All[$i]=`group -n ("Mot_Tail_All"+$j) `;
for ($n=0; $n<$Numbers_Count; $n++)
{
int $s=$n+1; int $****=$i+$lastNewsize+1;
$duplicate=`duplicate -n ("Mot_Tail_Inherit"+$s) ("Mot_Tail_All"+$****+"|Mot_Tail_First")`;
}
pointConstraint $allObjects[$i] ("Mot_Tail_All"+$j+"|Mot_Tail_First");
}
clear $all;

}
}

yarniso
06-04-2007, 07:15 PM
Before going through your code could you tell us what exactly you are trying to do and what is going wrong?

Bart

CGTalk Moderation
06-04-2007, 07:15 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.