Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
指定フォルダ以下から、特定のノードが存在するシーンを見つけます
/*
特定のノードが存在するシーンを検索
*/
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
You can’t perform that action at this time.