//ObjectID_Pass_Creator // Date: 2010/01/22 // Author: Dai Sato dstruevision@dstruevision.com http://www.dstruevision.com // Procedure Name: ObjectID_Pass_Creator // Description: This scripts enable you to to create ObjectID pass. // It also detects trasnparent shader, and keep that's transparency. //addAttr -ln miLabel -sn miLabel -nn miLabel -at long -k 1; global proc my_assign_miLabel() { int $temp_label_number = `intField -q -v my_label_number`; $current_selection = `ls -sl`; $progressMax = size($current_selection); if($progressMax) { progressBar -edit -beginProgress -isInterruptable true -status "Calculation ..." -maxValue $progressMax mainProgressBar; for($i=0;$i < size($current_selection);$i++) { select $current_selection[$i]; $temp_check_exist = `attributeQuery -node $current_selection[$i] -ex miLabel`; if($temp_check_exist) { deleteAttr ($current_selection[$i] + ".miLabel" ); } addAttr -ln miLabel -sn miLabel -nn miLabel -at long -k 1; setAttr ($current_selection[$i] + ".miLabel" ) $temp_label_number; progressBar -edit -step 1 mainProgressBar; } } progressBar -edit -endProgress mainProgressBar; } proc float my_create_RandomNumber() { float $temp_rand = 0.0; while( $temp_rand <0.004) { $temp_rand = `rand 1.0`; } return $temp_rand; } proc string extractTransCount(string $label) { print "extractTransCount(string $label)!!!!!)"; string $tokens[]; string $surfaceShader_count[] = `ls -type surfaceShader`; $current_MaxNumber = 0; if(size($surfaceShader_count) >0 ) { for($i=0; $i