root関係めも
nuke.root()['format'].setValue("HD")
nuke.root()['format'].setValue( "square_2K" )
scriptFormats = nuke.formats()
for f in scriptFormats:
print f.name()
print f.width()
print f.height()
print f.pixelAspect()
print 10*'-'
nuke.root()['format'].value().name() # renvoi le nom du format
nuke.root()['format'].value().setName("nomDuFormat")
print nuke.root()['format'].value().width()
print nuke.root()['format'].value().height()
print nuke.root()['format'].value().pixelAspect()
print nuke.root()['format'].value().name()
square2k = '2048 2048 square 2k'
nuke.addFormat( square2k )
nuke.root()['format'].setValue(nuke.addFormat("1024 960 1"))
quare2k = '2048 2048 square 2k'
nuke.addFormat( square2k )
nuke.root()[‘format’].setValue( ‘square 2k’ )
# DEFINE BASE AND PROXY FORMATS
square2k = '2048 2048 square 2k'
square1k = '1024 1024 square 1k'
# ADD FORMATS TO SESSION
for f in ( square2k, square1k ):
nuke.addFormat( f )
# SET THE ROOT TO USE BOTH BASE AND PROXY FORMATS
root = nuke.root()
root['format'].setValue( 'square 2k' )
root['proxy_type'].setValue( 'format' )
root['proxy_format'].setValue( 'square 1k' )
SyntaxHighlighter
2015年10月2日金曜日
2015年10月1日木曜日
選んだオブジェクトにロケータをペアレントコンストレイントしてベイク
選んだオブジェクトにロケータをペアレントコンストレイントしてベイク
proc BakeLocator(){
string $Selobjs[] =`ls -sl -tr`;
int $Selsum = `size( $Selobjs )`;
//print $Selsum;
string $addStr = "_nukeLightLoc";
string $tagStr = "hoge";
string $repStr = "hogehoge";
string $conStr = "_parentConstraint1";
//print ($addStr + "," + $tagStr + "," + $repStr + "," + $conStr);
int $x;
for($x = 0; $x < $Selsum; $x++ ){
CreateLocator;
string $LocSelA[] = `ls -sl`;
select $Selobjs[$x];
string $RnmLoc = (substituteAllString($Selobjs[$x], $tagStr , $repStr )) + $addStr ;
string $rnmObj = `rename $LocSelA[0] $RnmLoc`;
select -r $Selobjs[$x] $rnmObj;
//ペアレントコンストレイントコマンド
doCreateParentConstraintArgList 1 { "0","0","0","0","0","0","0","1","","1" };
parentConstraint -weight 1;
print($rnmObj + $conStr);
}
select -r ("*" + $addStr);
string $SelLocs[] =`ls -sl -tr`;
int $SelLocSum = `size( $SelLocs )`;
string $sFrame =`playbackOptions -query -minTime`;
string $eFrame =`playbackOptions -query -maxTime`;
string $bRange = ($sFrame + ":" + $eFrame);
//print $bRange;
bakeSimulation -t $bRange -at "tx" -at "ty" -at "tz" -at "rx" -at "ry" -at "rz";
select -r ("*" + $addStr + $conStr);
delete;
}
BakeLocator();
登録:
投稿 (Atom)