//================================================= // SRTc_and_p_zoe Ver. 0.3 //================================================= /////////////////////////////////////////////////////////// proc SRTcopy_zoe() { string $names[] = `ls -sl`; float $tra[] = ` xform -q -t $names[0]`; float $rot[] = ` xform -q -ro $names[0]`; float $sca[] = ` xform -q -s $names[0]`; //もしtmp_srt_zoeがなければ作る。 if( 0 == `objExists tmp_srt_zoe` ){ spaceLocator -n tmp_srt_zoe -p 0 0 0; } setAttr "tmp_srt_zoe.visibility" 0; xform -t $tra[0] $tra[1] $tra[2] "tmp_srt_zoe" ; xform -ro $rot[0] $rot[1] $rot[2] "tmp_srt_zoe" ; xform -s $sca[0] $sca[1] $sca[2] "tmp_srt_zoe" ; } /////////////////////////////////////////////////////////// proc SRTpaste_zoe() { string $names[] = `ls -sl`; // float $tra[] = ` xform -q -t "tmp_srt_zoe"` ; float $rot[] = ` xform -q -ro "tmp_srt_zoe"` ; float $sca[] = ` xform -q -s "tmp_srt_zoe"` ; xform -t $tra[0] $tra[1] $tra[2] $names[0] ; xform -ro $rot[0] $rot[1] $rot[2] $names[0] ; xform -s $sca[0] $sca[1] $sca[2] $names[0] ; } /////////////////////////////////////////////////////////// proc SRTpaste_mirror_zoe() { string $names[] = `ls -sl`; // float $tra[] = ` xform -q -t "tmp_srt_zoe"` ; float $rot[] = ` xform -q -ro "tmp_srt_zoe"` ; float $sca[] = ` xform -q -s "tmp_srt_zoe"` ; xform -t (- $tra[0]) $tra[1] $tra[2] $names[0] ; xform -ro $rot[0] (- $rot[1]) (- $rot[2]) $names[0] ; xform -s $sca[0] $sca[1] $sca[2] $names[0] ; } /////////////////////////////////////////////////////////// proc Spaste_zoe() { string $names[] = `ls -sl`; // float $sca[] = ` xform -q -s "tmp_srt_zoe"` ; xform -s $sca[0] $sca[1] $sca[2] $names[0] ; } /////////////////////////////////////////////////////////// proc Rpaste_zoe() { string $names[] = `ls -sl`; // float $rot[] = ` xform -q -ro "tmp_srt_zoe"` ; xform -ro $rot[0] $rot[1] $rot[2] $names[0] ; } /////////////////////////////////////////////////////////// proc Tpaste_zoe() { string $names[] = `ls -sl`; // float $tra[] = ` xform -q -t "tmp_srt_zoe"` ; xform -t $tra[0] $tra[1] $tra[2] $names[0] ; } /////////////////////////////////////////////////////////// proc Rpaste_mirror_zoe() { string $names[] = `ls -sl`; // float $rot[] = ` xform -q -ro "tmp_srt_zoe"` ; xform -ro $rot[0] (- $rot[1]) (- $rot[2]) $names[0] ; } /////////////////////////////////////////////////////////// proc Tpaste_mirror_zoe() { string $names[] = `ls -sl`; // float $tra[] = ` xform -q -t "tmp_srt_zoe"` ; xform -t (- $tra[0]) $tra[1] $tra[2] $names[0] ; } /////////////////////////////////////////////////////////// proc SetKey_zoe() { int $currentTime = `currentTime -q`; setKeyframe -time $currentTime; } /////////////////////////////////////////////////////////// proc CutKey_zoe() { int $currentTime = `currentTime -q`; cutKey -time $currentTime; } /////////////////////////////////////////////////////////// //================================================= // SRTc_and_p_zoe GUI //================================================= global proc SRTc_and_p_zoe() { global string $SRTc_and_p_zoeWin = "sonnzai_site_masu"; if (`window -ex $SRTc_and_p_zoeWin`) { deleteUI $SRTc_and_p_zoeWin; } if( 0 == `objExists tmp_srt_zoe` ){ spaceLocator -n tmp_srt_zoe -p 0 0 0; } setAttr "tmp_srt_zoe.visibility" 0; window -wh 170 380 -t "SRTc_and_p_zoe Ver. 0.3" -mnb on -s off -i off sonnzai_site_masu; //columnLayout -adjustableColumn true; columnLayout -adjustableColumn false; text -w 170 -l "SRTc_and_p_zoe Ver. 0.3"; text -l " "; button -w 170 -l "Copy SRT" -bgc 0.95 0.95 0.85 -c "SRTcopy_zoe();"; text -l " "; text -w 170 -l "Paste"; rowColumnLayout -numberOfColumns 3 -columnWidth 1 80 -columnWidth 2 10 -columnWidth 3 80; button -l "SRT" -c "SRTpaste_zoe();"; text -l ""; button -l "SRT(mirror)" -bgc 0.9 0.9 0.9 -c "SRTpaste_mirror_zoe();"; button -l "S" -c "Spaste_zoe();"; text -l ""; text -l " "; button -l "R" -c "Rpaste_zoe();"; text -l ""; button -l "R(-y -z)" -bgc 0.9 0.9 0.9 -c "Rpaste_mirror_zoe();"; button -l "T" -c "Tpaste_zoe();"; text -l ""; button -l "T(-x)" -bgc 0.9 0.9 0.9 -c "Tpaste_mirror_zoe();"; text -l ""; setParent ..; text -w 170 -l "Key"; rowColumnLayout -numberOfColumns 2 -columnWidth 1 40 -columnWidth 2 130; button -l "Delet" -bgc 1.0 0.8 0.7 -c "CutKey_zoe();"; button -l "Set" -bgc 0.7 0.8 1.0 -c "SetKey_zoe();"; setParent ..; text -l ""; button -w 170 -l "CLOSE" -bgc 0.8 0.8 0.8 -c "deleteUI $SRTc_and_p_zoeWin; delete tmp_srt_zoe ;"; setParent ..; showWindow; }; SRTc_and_p_zoe();