SyntaxHighlighter

2014年8月21日木曜日

メモ_maya(選択したオブジェクトのアトリビュートを変更)

他のページからのコピペ

選択したオブジェクトのアトリビュートを変更

string $obj[] = `ls -sl`;

for ($objSel in $obj)
{
//変更可能なのは、ここから//
setAttr ($objSel+".miReflectionBlur") 2.5;
//ここまで//
}

-------------------------------------------------------
これは、「選択したマテリアルにリフレクションブラーを入れる」ってこと

1.//「for ($objSel in $obj)」は、「$objの中の$objSel」を//
2.//setAttr ($objSel+".miReflectionBlur") 2.5;しますって意味//
3.「2.5」って数値は、リフレクションブラーを2.5にしますって意味。
----------------------------------------------------------------------

つまり、2の「.miReflectionBlur」の中身を変えれば、どんなものでも一括で変更できる。また、1行だけでなく何行入れてもいい。

たとえば、
@選択したマテリアルを全てブラックホールにする。
setAttr ($objSel+".matteOpacityMode") 0;

@選択したマテリアルを全てブラックホールをやめる。
setAttr ($objSel+".matteOpacityMode") 2;

@選択したマテリアルを全てグローを切る。
setAttr ($objSel+".glowIntensity") 0;

@選択したマテリアルのambientColorに、occlusionをつける。
connectAttr -force mib_amb_occlusion1.outValue ($objSel+".ambientColor");
//「mib_amb_occlusion1」は、オクルージョンの名前//



---------------------------------------------------------------------------------------------
//選んだカメラのアトリビュートを変更

string $obj[] = `ls -sl`;
for($lsCam in $obj)
{
setAttr($lsCam+".filmFit")1;
setAttr($lsCam+".cameraScale")1.2;
}
---------------------------------------------------------------------------------------------
//
マニピュレータをオンにする

string $slCam[] = `ls -sl`;
for($lsCam in $slCam)
{
renderManip -e -cam 0 0 0 1 0 $lsCam ;
}

---------------------------------------------------------------------------------------------

string $pMesh[] = `ls -type "mesh"`;
//select $pMesh;
for ($spMesh in $pMesh)
{
    print ($spMesh + "\n");
    setAttr ($spMesh + ".overrideEnabled")0;
    //setAttr ($spMesh + ".template")0;
}
---------------------------------------------------------------------------------------------
//カメラのイメージプレーンを削除
string $list[] = `lsType imagePlane`;
for ($node in $list)
{
select -r $node;
delete;
}
---------------------------------------------------------------------------------------------



string $before = "hoge";
string $after = "hoge";

string $node[] = `ls -type file`;
  
    for ($fileNode in $node){
  
        string $path = `getAttr ($fileNode + ".fileTextureName")`;
        print ($path + "\n") ;              
        string $changePath = `substitute $before $path $after`;
        print ($changePath + "\n") ;   
        setAttr -type "string" ($fileNode + ".fileTextureName") $changePath;
    }






2014年7月11日金曜日

メモ_maya(チャネル ボックスカラー)

ほかページからの転記

チャネル ボックス(Channel Box) カラー

ロックされている
グレー
キー設定不可
ライト グレー
ミュートされている
茶色
ブレンドされている
緑色
キー設定されている
明るいオレンジ色
エクスプレッション
紫色
コンストレイントされている
青色
接続済み
黄色


========================================================
Mel覚え書き
========================================================

--------------------------------------------------------
■for分テンプレート
--------------------------------------------------------
string $sentaku[] = ` ls -sl -tr ` ;
int $kazu = ` size ( $sentaku ) ` ;
int $x ;

for ( $x = 0 ; $x < $kazu ; $x++ )
{
string $locName = $sentaku[$x];
spaceLocator -n $locName;
}//for

--------------------------------------------------------
■指定した文字を含むオブジェクトをリスト
--------------------------------------------------------
ls "locator?"; 
ls "locator?""locator?2";//複数の文字列を指定する版 

↑結構簡単だった、、、。
「ls」コマンド後、「" "」で囲って文字列を指定するだけ。フラグもいらない。

--------------------------------------------------------
■文字列を置き換え(又は削除)
--------------------------------------------------------
string substituteAllString(string $text, string $searchStr, string $replaceStr)

$replaceStrを空の"" にすると削除と同じになる。

例:
string $text = "one + two + three + four";
string $result1 = substituteAllString($text, "+", "plus");
print $result1;

--------------------------------------------------------
■シーンのファイル名を調べる
--------------------------------------------------------
file -q -shortName -sceneName;

--------------------------------------------------------
■-typeフラグで使えるタイプを調べるコマンド
--------------------------------------------------------
ls -showType

--------------------------------------------------------
■アニメーションカーブを指定フレーム分ズラす
--------------------------------------------------------
string $animCurve[] = `ls -type animCurveTL -type animCurveTU -type animCurveTA -type animCurveTT`;
keyframe -edit -r -timeChange ( この括弧内にズラしたいフレーム数を記述してください ) $animCurve;

--------------------------------------------------------
■トランスフォームノードをリストUP
--------------------------------------------------------
ls -sl -typ transform;

--------------------------------------------------------
■ウィンドウ表示位置などをコントロールする
--------------------------------------------------------
windowPref -enableAll false;//多分、ウィンドウ作成時に強制されるデフォルト設定的なものを切ってる...。

//このコマンドで挟むようにウィンドウを作成する。

windowPref -enableAll true;//↑で切った設定をONに戻す



「-enableAll」フラグが何をしてるかは不明、、、。
(多分、ウィンドウ作成時に強制されるデフォルト設定的なものを切ってるんだと思う。)
「-w」や「-h」などのコマンドも機能するようになります。

--------------------------------------------------------
■ウィンドウにコメントなどのテキストを表示
--------------------------------------------------------
string $winName = "test";

windowPref -enableAll false;

if((`window -ex $winName`) == true)
deleteUI $winName;

window -w 360 -title $winName $winName;

scrollLayout;

text -al left//「left」、「right」、「center」の引数を指定する。

//-------------------------
"■テストコメント\n\
  test\n\
  test";
//-------------------------

showWindow;

windowPref -enableAll true;


--------------------------------------------------------
■可視性ONのパネルを検索→最後のパネルネームを取得
--------------------------------------------------------
string $panel[] = `getPanel -visiblePanels`;
int $kazu = `size($panel)`;
print $panel[($kazu - 1)];

※作成したモデルパネルの設定変更する際にパネルネームを取得して使用


--------------------------------------------------------
■論理演算子
--------------------------------------------------------
=====================================================
&& ~かつ・・・
|| ~または・・・("||"半角でshift+\で書ける。)
! ~じゃない
=====================================================

もし $num が0より大きくてかつ5以下であるなら…
という場合は

if(0 < $num && $num <= 5)

もし $num が0以下かまたは5より大きいなら
という場合は

if($num <= 0 || 5 < $num)

この様に書きます。

また、『~じゃなければ』という否定には、『!』記号を使います。

例えば、
if(!($num < 5))

この様に書くと、「もし$numが5より小さくなければ」という意味になります。



--------------------------------------------

int:整数型(整数のみ代入可能)
float:浮動小数点型(小数も代入可能)
string:文字列型(文字列を代入可能)

vector:ベクトルデータ型(3つの浮動小数点の組み合わせ)
配列型:同じ型の要素のリスト
matrix:行列型(2次元の表)

【↓例↓】
int $a = 10; 
float $b = 1.234; 
vector $v = <<1.2, 3.4, 6.5>>; 
※個々の値を参照するには、$v.x、$v.y、$v.zと記述する。
float $ar[] = {1.2, 3.4, 4.5}; // 浮動小数点の配列
matrix $mtx[3][2]; // 3*2の浮動小数点の表

■代入演算子

$x++ // $x = $x + 1と同じ意味。
$x-- // $x = $x - 1
$x += 5 // $x = $x + 5 
$x -= 3 // $x = $x - 3

■比較演算子

a == b // aはbと等しい
a != b // aはbと等しくない
a < b // aはb未満
a >= b // aはb以上である
a <= b // aはb以下である

■論理演算子

|| // or 
&& // and 
! // not 

--------------------------------------------




--------------------------------------------------------
■ウィンドウ作成
--------------------------------------------------------

{
/* 
「-exists」フラグは:指定した名前のウィンドウが存在するかどうかによってtrueまたはfalseを返します。
「if」コマンドでは( )の中の結果がTrueであればそれに続くコマンドを実行する。
*/

string $window = `window -title test aaa`;

if(`window -exists aaa`)
deleteUI aaa;

formLayout ;

button -label"ボタンの名前" ;

//window -title test aaa;
showWindow $window ;

}


string $kaz = 123 ;

if(`window -exists aaa`)
deleteUI aaa;

string $windowA = `window -title test aaa`;

//formLayout ;
columnLayout;
button -label "ボタン1" -command "print $kaz";

showWindow $windowA ;


window -title "レイアウト1";
columnLayout;
button -label "A";
rowLayout -numberOfColumns 2 -columnWidth2 20 20;
button -label "B";
button -label "C";
setParent ..;

/*
-numberOfColumn 2
横に何個の部品を並べるかを指定します。

-columnWidth2 20 20
各部品を並べる間隔の指定です。(2 個の場合) 
この場合、B・C ボタンがそれぞれ 20 ピクセル幅の範囲にレイアウトされます。 
3 個の部品を並べる場合には代わりに -columnWidth3 を使用します。

setParent ..;
rowLayout の有効範囲の終りです。 
これ以後は columnLayout が有効になるので、これ以降は部品が縦に並びます。
*/

button -label "D";
rowLayout -numberOfColumns 3 -columnWidth3 20 20 20;
button -label "E";
button -label "F";
button -label "G";
setParent ..;
showWindow;





//ボタンの間隔のパラメーター
int $cWibth = 20;

if(`window -ex XXX`)
deleteUI XXX;

string $winX = `window -title "kmoriyama" XXX`;
columnLayout;
button -label "A";

rowLayout -numberOfColumns 2 -columnWidth2 $cWibth $cWibth;
button -label "B";
button -label "C";
setParent ..;

rowLayout -numberOfColumns 3 -columnWidth3 $cWibth $cWibth $cWibth;
button -label "D";
button -label "E";
button -label "F";
setParent ..;

rowLayout -numberOfColumns 4 -columnWidth4 $cWibth $cWibth $cWibth $cWibth;
button -label "G";
button -label "H";
button -label "I" -w 20;
button -label "J";
setParent ..;

showWindow $winX;

========================================
アニムレイヤーを作成して、特定のリグを適用する
========================================

string $anmName = "Pose";

string $setRo = $anmName + ".rotationAccumulationMode" ;
string $setSc = $anmName + ".scaleAccumulationMode" ;

animLayer $anmName;

setAttr $setRo 0;
setAttr $setSc 1;

select -cl ;
select -r Rigroot Righara Rigkoshi Rigmune Rigkubi Rigatama Rigashi_RVec Rigashi_LVec Rigtekubi_LVec Rigtekubi_RVec Rigashi_RAll Rigashi_RReverse Rigtsumasaki_RReverse Rigtsumasaki_RDummy Rigashi_LAll Rigashi_LReverse Rigtsumasaki_LReverse Rigtsumasaki_LDummy ;

animLayer -e -addSelectedObjects -excludeScale -excludeDynamic -excludeBoolean -excludeEnum $anmName;

========================================
チャンネルボックスの余計なチャンネルの非表示
========================================
setAttr ノード名.ini 0;//これで非表示
setAttr ノード名.ini 2;//これで初期化。1ではないようです。

========================================
アニムカーブを検索してフレーム移動
========================================
int $StarFrame = `getAttr PRM.StartFrame`;
int $EndFrame = `getAttr PRM.EndFrame`;
int $LoopStart = `getAttr PRM.LoopStart`;
int $LoopEnd = `getAttr PRM.LoopEnd`;

string $animCurve[] = `ls -type animCurveTL -type animCurveTU -type animCurveTA -type animCurveTT`;
keyframe -edit -r -timeChange (-$LoopEnd) $animCurve;

playbackOptions -ast $StarFrame -aet ($EndFrame - $LoopEnd) -min $StarFrame -max ($EndFrame - $LoopEnd)

========================================
textフィールドウィンドウ
========================================
window;
columnLayout -adj true;
textField;
textFieldButtonGrp -label "ラベル" -text "textFieldButtonGrp" -buttonLabel "ボタン";
showWindow;


rowLayout -numberOfColumns 2;
button -label "<-StartOrEnd->" -w 102 -command "command7" ;

text -label "テストメッセージ";
separator -height 1 -style "double";
text -label "テストメッセージ";

========================================
選択したキーのアトリビュートネームをメモ帳に書き出す
========================================

//BlShapeのkeyを全て選択してく実行してください。
{
string $attName[] = `keyframe -q -name`;
$size = size($attName);

for($i=0; $i<$size; $i++){
string $FilePath = "C:/Users/k_moriyama.MEDIAV/Desktop/ぶれんどたーげっとリスト.txt"; //書き込み用テキストの場所指定
string $blnamea[] = `ls -typ blendShape`;
string $blnamea2 = $blnamea[0] + "_";
string $output = substituteAllString($attName[$i], $blnamea2 , "");
system("echo " + $output + ">> " + $FilePath);
}
print ("total = " + $size );
}

========================================
改行
========================================

string\n;// "\n"で改行

string $aaa = $attName[$i] + "\n";




例:

//BlShapeのkeyを全て選択してく実行してください。
{
string $attName[] = `keyframe -q -name`;
$size = size($attName);

for($i=0; $i<$size; $i++){
string $aaa = $attName[$i] + "\n";//MAYA上では"\"はスラッシュを逆のヤツになる。
print $aaa;
}
print ("total = " + $size );
}


========================================
.txtに書き込むmelSample
========================================

if(`window -q -exists TsTimeWindow`) deleteUI TsTimeWindow;

window TsTimeWindow;
columnLayout;
textFieldButtonGrp -bc "TsTimeCmd" -bl "OK" TsTimeTFG; //文末の"TsTimeTFG"はこのボタンの名称と思われ!

showWindow TsTimeWindow;

global proc TsTimeCmd(){
string $FilePath = "C:/Users/k_moriyama.MEDIAV/Desktop/test1.txt"; //書き込み用テキストの場所指定
string $time = `about -ct`; //多分、現在の時刻を取得して、変数に格納してる。
string $output = `textFieldButtonGrp -q -tx TsTimeTFG`; //"TsTimeTFG"という名前のフィールドの内容を"-q"を使って問い、取得してる。

system("echo " + $time + " " + $output + ">> " + $FilePath);
//deleteUI TsTimeWindow;
}

========================================
ボタン付ウィンドウテンプレ
========================================

//ウィンドウ、ボタン生成--------------------------------------------

string $windowName = "buttonWin" ; //ウィンドウ名はこの変数で指定してください。
string $windowTitle = "適当" ; //ウィンドウに表示するタイトルはこの変数で指定してください。


if(`window -exists $windowName`)
deleteUI $windowName;

window -w 100 -h 30 -title $windowTitle $windowName;
columnLayout;
button -label "ボタン1" -w 206 -command "command1";

rowLayout -numberOfColumns 4 ;
button -label "ボタン2" -w 50 -command "command2";
button -label "ボタン3" -w 50 -command "command3";
button -label "ボタン4" -w 50 -command "command4";
button -label "ボタン5" -w 50 -command "command5";


setParent ..;
rowLayout -numberOfColumns 2;

// button -label "ボタン6" -w 102 -command "timRangeCTRL" ;
button -label "ボタン7" -w 102 -command "select PRM" ;
button -label "ボタン8" -w 102 -command "command6" ;

setParent ..;

rowLayout -numberOfColumns 2;
button -label "ボタン9" -w 206 -command "command7" ;

setParent ..;


showWindow $windowName ;


//ボタンのコマンド生成--------------------------------------------

proc command1() //ボタン1
{
playblast -format avi -filename "C:/Users/k_moriyama.MEDIAV/Desktop/test1" -offScreen
-forceOverwrite -sequenceTime 0 -clearCache 1 -viewer 1 -showOrnaments 0 -fp 0 -percent 100 -compression "none" -quality 100 -widthHeight 1280 720;

}

proc command2() //ボタン2
{
print "コマンドを記述してください";
}

========================================
選択したオブジェクトのビジビリティをoff
========================================

string $sentaku[] = ` ls -sl -tr ` ;
int $kazu = ` size ( $sentaku ) ` ;
int $x ;

for ( $x = 0 ; $x < $kazu ; $x++ )
{
string $listShp[] = `listRelatives -s`;
string $visib = $listShp[$x] + ".visibility";
int $joutai = `getAttr $visib`;

if( $joutai == 1 )
{
setAttr $visib 0;
}
else
{
setAttr $visib 1;
}//elseのブロックエンド
}//forのブロックエンド

========================================
エクスプレッションMemo
========================================

================================================================================
■「基本的な記述の仕方」のメモ
================================================================================
joint1.translateZ = joint2.translateZ * 0.3;//ジョイント1(tz)にジョイント2の"tz*0.3"の値を代入

================================================================================
■指定フレーム数、遅れて追従するエクスプレッション
================================================================================
{
$ct = `currentTime -q`; //現在のフレーム位置
int $tm = 15; //遅れるフレーム数

if($ct >= $tm)
{
pSphere1.translateX = `getAttr -t ($ct - $tm) pCube1.tx`;
}
else
{
pSphere1.translateX = `getAttr -t 1 pCube1.tx`;
}
}



========================================
シェイプノードをペアレント
========================================
parent -shape -r;

※"シェイプノード"→"ペアレント先のトランスフォームノード"を選択して実行しないとエラーになる。


========================================
シェイプノード名取得
========================================
listRelatives -s;//選択されたオブジェクトのShapeノード名を取得する





========================================
選択されたオブジェクトのキーフレームの範囲とレンジの範囲を合わせる
========================================
selectKey -time ":";
float $allKeys[] = sort(`keyframe -q -sl`);
playbackOptions -min $allKeys[0] -max $allKeys[(size($allKeys) -1)];





========================================
シーン全体のアニメーションのキーを一括でオフセットする
========================================

global proc offsetAllAnimation(int $offsetVal)
{
string $animCurve[] = `ls -type animCurveTL -type animCurveTU -type animCurveTA -type animCurveTT`;
keyframe -edit -r -timeChange $offsetVal $animCurve;
}

animCurveの種類は、 input がTimeなら animCurveT(L U A T)
DrivenKeyのように  inputがDouble(数値)なら animCurveU(L U A T)
それぞれ、
L distance
A angle
T time
U double
の意味。
OffsetするのはDrivenKey以外のTimeと接続しているものなので animCurveT系のノードをリストし、
keyframe に -r(相対移動)のフラグを付ける。


========================================
文字列の置き換えコマンド
========================================
substituteっていうコマンドは

substitute A B C;

でBの文字列の中にあるAという文字列をCで置き換えるというコマンドです。

A:"B"内をこの文字列で検索する
B:置き換え対象の文字列
C:この文字列に置き換える



========================================
ボタンのサイズをウィンドウにあわせる
========================================
例: rowLayout -numberOfColumns 4 -adjustableColumn 1;//横にボタンを並べるレイアウト

レイアウトに「-adjustableColumn 1」フラグをつける。0で多分off。


========================================
実行するたびにon/offを切り替える書き方
========================================
setAttr time1.enableTimewarp (!`getAttr time1.enableTimewarp`);

・多分()内で、取得した数値を[!]コマンド?で反転することでon⇔off切り替えを実現している。
・一行で済むから美しい!


========================================
チェックボックスの状態を取得
========================================
string $checkBox1 = `checkBox -label "スケールX"`;//チェックボックスは変数に格納する
if(`checkBox -q -value $checkBox1`)//チェックボックスの状態[-value]を[-q]で取得してonならif実行
{
print "チェックボックスのチェックがonなら実行"
}


========================================
アトリビュートがノード上に存在を確認(attributeExistsコマンド)
========================================
基本: attributeExists("attributeName","nodeName")

例: if (attributeExists("visibility","mySphere")) {
setAttr mySphere.visibility on;
}

・指定のノードに指定したアトリビュートが存在するかを確認できます。


========================================
サイズ、位置などを復元しない
========================================
windowPref -remove $WindowName このコマンドを実行することで復元をやめさせることができる。
「showWindow」の前に実行させる。

windowPref -enableAll false ┬このコマンドでウィンドウ生成コマンドを挟む
windowPref -enableAll true ┘


========================================
ファイルに書き出す
========================================

$exampleFileName = "C:/Users/k_moriyama.MEDIAV/Desktop/test1.txt";//ファイルパスを変数に格納
$fileId=`fopen $exampleFileName "w"`;//ファイル識別子を変数に格納

/*
■識別子の種類↓
"w" 書き込み用のファイルを開く(ファイルの以前の内容を破棄する)
"a" 書き込み用にアペンドする(ファイルの最後にアペンドする)
"r" 読み取り用に開く
*/

fprint $fileId "書き込みたい文字列(変数指定可)";
fclose $fileId;//終了する


2014年7月1日火曜日

メモ_nuke

選択したノードの後に指定のノードを作って値も入れる

sn = nuke.selectedNodes()
for i in sn:

nuke.nodes.Colorspace(channels = 'all',colorspace_in = 3 ).setInput(0, i)

print nuke.selectedNode()
スクリプトで指定する項目の文字列が表示される

sn = nuke.selectedNodes()
for i in sn:

i.knob('frame_rate').setValue(30)


sn = nuke.selectedNodes()
for i in sn:
    i.knob('width').setValue(2560)

    i.knob('height').setValue(720)

sn = nuke.selectedNodes()
for i in sn:

nuke.nodes.Premult().setInput(0,i)

snSR = nuke.allNodes('ScanlineRender')
for i in snSR:

    i['samples'].setValue(6)


for a in nuke.allNodes():
    if a.Class()=='Constant':
        a['format'].setValue('2080x1520')
最後の行コロンを付けない...

2014年4月28日月曜日

プロジェクト設定

//プロジェクト設定スクリプト CS6
//=============================================================================================
//Pref_SCRIPTING_FILE_NETWORK_SECURITYの値判定

function isSecurityPrefSet(){
    var securitySetting = app.preferences.getPrefAsLong("Main Pref Section", "Pref_SCRIPTING_FILE_NETWORK_SECURITY");
    return (securitySetting == 1);
    }

//=============================================================================================

if (isSecurityPrefSet() == true){
/*  プロジェクト設定  */

//=============================================================================================
/*  時間の表示形式   */

//タイムコード
//app.project.timeDisplayType = TimeDisplayType.TIMECODE;
//alert (app.project.timeDisplayType)
/*  タイムコード指定時フッテージの開始時間
FTCS_START_0
FTCS_USE_SOURCE_MEDIA
*/
//app.project.footageTimecodeDisplayStartType = FootageTimecodeDisplayStartType.FTCS_USE_SOURCE_MEDIA;

//フレーム
app.project.timeDisplayType = TimeDisplayType.FRAMES;

/*  フレーム指定時にフィート+フレームのオンオフ
0
1
*/
app.project.framesUseFeetFrames = 0;

/*  フレーム指定時にフィート+フレームのタイプ指定 
MM16
MM35
*/
//app.project.feetFramesFilmType = FeetFramesFilmType.MM35;

/*  プロジェクト設定ダイアログの「フレーム数」の設定
FC_START_0
FC_START_1
FC_TIMECODE_CONVERSION で指定
*/
app.project.framesCountType = FramesCountType.FC_START_1;

//=============================================================================================
/*  カラー設定   */
/*  プロジェクトの色深度
8
16
32
*/
app.project.bitsPerChannel = 8;

/*  ガンマ1.0でカラーをブレンド
0
1
*/
app.project.linearBlending = 0;


//=============================================================================================
/*  環境設定  */

/*  読み込み設定_シーケンスフッテージ
"24.000000"
"30.000000"
*/
app.preferences.savePrefAsString("Import Options Preference Section", "Import Options Default Sequence FPS","24.000000");
/*  一般設定_ツールヒントを表示
00
01
*/    
app.preferences.savePrefAsBool("Main Pref Section", "Pref_TOOL_TIPS",01);

/*  一般設定_JavaScriptデバッガーを使用
"0"
"1"
*/ 
app.preferences.savePrefAsString("Main Pref Section", "Pref_JAVASCRIPT_DEBUGGER","1");

/*  ディスプレイ設定_情報パネルとフローチャートにレンダリングの進行状況を表示
00
01
*/ 
app.preferences.savePrefAsBool("Main Pref Section", "Pref_SHOW_INFO_FLOATER_PROGRESS",01);

//app.preferences.saveToDisk();
//app.preferences.reload();
//=============================================================================================
/*  プロジェクト設定  */

//プロジェクト設定の「時間の表示形式」に相当。タイムコードかフレームかの設定
var tDisplayType = app.project.timeDisplayType;
//タイムコード指定時フッテージの開始時間
var pfTimecodeDsiplayStartType = app.project.footageTimecodeDisplayStartType;
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------
//フレーム指定時のフィート+フレームのオン・オフ設定
var pFramesUseFeetFrames = app.project.framesUseFeetFrames;
//フレーム指定時のフィート+フレームのタイプの設定
var pFeetFramesFilmType  = app.project.feetFramesFilmType;
//フレーム指定時の「フレーム数」の設定
var pFramesCountType = app.project.framesCountType;
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------
//プロジェクトの色深度
var pBitPerChannel = app.project.bitsPerChannel;
//ガンマ1.0でカラーをブレンド
var pLinearBlending = app.project.linearBlending;
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------
/*  環境設定  */

//読み込み設定_シーケンスフッテージ
var pPrefImportFps = app.preferences.getPrefAsString("Import Options Preference Section", "Import Options Default Sequence FPS");
//一般設定_ツールヒントを表示
var pPrefToolTips =app.preferences.getPrefAsBool("Main Pref Section", "Pref_TOOL_TIPS");
//一般設定_JavaScriptデバッガーを使用
var pPrefJavascriptDebugger = app.preferences.getPrefAsString("Main Pref Section", "Pref_JAVASCRIPT_DEBUGGER");
//ディスプレイ設定_情報パネルとフローチャートにレンダリングの進行状況を表示
var pPrefShowInfoProgress = app.preferences.getPrefAsBool("Main Pref Section", "Pref_SHOW_INFO_FLOATER_PROGRESS");

//-------------------------------------------------------------------------------------------------------------------------------------------------------------------

if  (tDisplayType == 1812){
    var tDisplayType = "表示形式>>>タイムコード";
    if (pfTimecodeDsiplayStartType == 2012){
        var  pfTimecodeDsiplayStartType = "メディアのデータを使用";
        }
    else if (pfTimecodeDsiplayStartType == 2013){
        var  pfTimecodeDsiplayStartType = "00:00:00:00";
        }
    }
else if (tDisplayType == 1813){
        var tDisplayType = "表示形式>>>フレーム";
        if  (pFramesUseFeetFrames == true){
            var pFramesUseFeetFrames = "オン";
            if (pFeetFramesFilmType == 2213){
                var pFeetFramesFilmType = "35mm";
                }
            else if (pFeetFramesFilmType == 2212){
                var pFeetFramesFilmType = "16mm";
                }       
            }
        else if (pFramesUseFeetFrames == false){
            var pFramesUseFeetFrames = "オフ";
            }
        }

if (pFramesCountType ==  2413){
    var pFramesCountType = "1から開始"
    }
else if (pFramesCountType ==  2412){
    var pFramesCountType = "0から開始"
    }
else if (pFramesCountType ==  2414){
    var pFramesCountType = "タイムコード変換"
    }

if (tDisplayType == "表示形式>>>タイムコード"){
    var timeDisplay = tDisplayType +"\n"
    + "フレーム数"+">>>"+ pfTimecodeDsiplayStartType;
    }
else if (tDisplayType = "表示形式>>>フレーム"){
    if (pFramesUseFeetFrames == "オン"){
        var timeDisplay = tDisplayType +"\n"
        + "フィート+フレーム" +  ">>>" + pFramesUseFeetFrames +"\n"
        + "表示形式" + ">>>" + pFeetFramesFilmType + "\n" 
        + "フレーム数"+">>>"+ pFramesCountType;
        }
    else if (pFramesUseFeetFrames == "オフ"){
        var timeDisplay =  tDisplayType +"\n"
        + "フィート+フレーム" +  ">>>" + pFramesUseFeetFrames +"\n"
        + "フレーム数"+">>>"+ pFramesCountType;
         }
    }
 //-------------------------------------------------------------------------------------------------------------------------------------------------------------------

if (pBitPerChannel == 8){
    var pBitPerChannel = "色深度>>>8bit/チャンネル";
    }
else if (pBitPerChannel == 16){
    var pBitPerChannel = "色深度>>>16bit/チャンネル";
    }
else if (pBitPerChannel == 32){
    var pBitPerChannel = "色深度>>>32bit/チャンネル(浮動小数点数)";
    }

if (pLinearBlending == true){
    var pLinearBlending = "ガンマ値1.0でカラーをブレンド>>>オン";
    }
else if  (pLinearBlending == false){
    var pLinearBlending = "ガンマ値1.0でカラーをブレンド>>>オフ";
    }


var colorSetting = pBitPerChannel + "\n" + pLinearBlending

//-------------------------------------------------------------------------------------------------------------------------------------------------------------------
var importFPS = "環境設定>>>読み込み設定>>>"+pPrefImportFps+" FPS";

if (pPrefToolTips == true){
    var toolTips = "環境設定>>>一般設定>>>ツールヒントを表示>>>オン";
    }
else if  (pPrefToolTips == false){
    var toolTips = "環境設定>>>一般設定>>>ツールヒントを表示>>>オフ";
    }

if (pPrefJavascriptDebugger == "1"){
    var javascriptDebugger = "環境設定>>>一般設定>>>Javascriptデバッガーを使用>>>オン";
    }
else if  (pPrefJavascriptDebugger == "0"){
    var javascriptDebugger = "環境設定>>>一般設定>>>Javascriptデバッガーを使用>>>オフ";
    }

if (pPrefShowInfoProgress == true){
    var showInfoProgress = "環境設定>>>ディスプレイ設定>>>情報パネルに進行状況を表示>>>オン";
    }
else if  (pPrefShowInfoProgress == false){
    var showInfoProgress = "環境設定>>>ディスプレイ設定>>>情報パネルに進行状況を表示>>>オフ";
    }


alert 
(
"=============================================================="
+ "\n" 
+ "プロジェクト設定\n"
+ "\n"
+ "++++++時間の表示形式++++++\n"
+ timeDisplay + "\n"
+ "\n"
+ "++++++++カラー設定+++++++++\n"
+ colorSetting + "\n"
+ "\n"
+ "++++++++環境設定++++++++++\n"
+ "\n" 
+ importFPS
+ "\n" 
+toolTips
+ "\n" 
+javascriptDebugger
+ "\n" 
+showInfoProgress
+ "\n" 
+"=============================================================="
)


}
else{
alert ("環境設定>\n一般設定>\nスクリプトによるファイルへの書き込みとネットワークへのアクセス許可\n↑\nのチェックをオンにしてください、スクリプト実行時に必要な場合があります");

}

2014年4月21日月曜日

Launch Pad.jsxを複数起動する方法

Launch Pad.jsxを複数起動する方法
launchPad_scriptsFoloderの部分をすべて置換、スクリプト本体の名前も同様にリネームします
スクリプト本体の置き場所はLaunch Pad.jsxと同じで下記にしておかないとフローティングパネル化しないと思います
C:\Program Files\Adobe\Adobe After Effects CS[各バージョン]\Support Files\Scripts\ScriptUI Panels
初回起動時にLaunch Padに表示するスクリプトの場所を聞かれます

2014年4月8日火曜日

タイムリマップのオンオフ

control = thisComp.layer("expNull").effect("timeRemapOnOff")("チェックボックス") ;

if (control == 1){
value;
}else{
time;
}