Skip to content

Instantly share code, notes, and snippets.

@deathponta
Created October 24, 2018 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deathponta/10a39bddc9ac80e745564785af04153e to your computer and use it in GitHub Desktop.
Save deathponta/10a39bddc9ac80e745564785af04153e to your computer and use it in GitHub Desktop.
指定フォルダ以下から、特定のノードが存在するシーンを見つけます
/*
特定のノードが存在するシーンを検索
*/
proc SearchDir( string $_path ){
string $Dirpass = $_path ;
string $list[] = `getFileList -fld $Dirpass` ;
for( $s in $list ){
$fullPath = $_path + "/" + $s;
// ***.mb ファイルが見つかった場合のみ処理を行うときはこの if 文内に処理を追記
if( gmatch( $s , "*.mlt") > 0 ){
file( "-o" , "-f" , $fullPath );
$searchNodeType = textField( "-q" , "-tx" , "tf_nodeType" );
if( size( ls( "-type" , $searchNodeType ) ) > 0 ){
print "============================================================\n";
print ($searchNodeType + " が以下のシーンには含まれています。\n");
print ($fullPath+"\n");
print "============================================================\n";
}
}
SearchDir( $fullPath );
}
}
proc SearchSceneByNodeType(){
string $window = "SearchSceneByNodeType";
if( window( "-ex" , $window ) ){
deleteUI $window;
}
window( "-t" , $window , "-w" , 300 , "-tb" , true , $window );
columnLayout( "-cat" , "both" , 5 , "-cw" , 250 );
rowLayout( "-numberOfColumns" , 2 , "-adj" , 2 );
text( "-l" , "フォルダパス");
textField( "-tx" , "" , "tf_workDir");
setParent( ".." );
rowLayout( "-nc" , 2 , "-adj" , 2 );
text( "-l" , "ノードタイプ");
textField( "-tx" , "uvChooser" , "tf_nodeType" );
setParent( ".." );
text( "-l","指定したフォルダ以下の全mltファイルに、\n指定ノードタイプが含まれているか?" );
button( "-l" , "スクリプトエディターに表示" , "-c" , "SearchDir( textField( \"-q\" , \"-tx\" , \"tf_workDir\" ) )" );
showWindow $window;
}
SearchSceneByNodeType();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment