tag:blogger.com,1999:blog-31241034559843705892024-03-07T05:56:46.763+09:00Bblog個人的な忘備録とメモですtmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.comBlogger45125tag:blogger.com,1999:blog-3124103455984370589.post-4699539318914207592016-09-15T03:03:00.002+09:002016-09-15T03:03:55.981+09:00setProjectRootSettingsimport nuke,nukescripts<br />
<br />
def setProjectRootSettings():<br />
#<br />
setProjectFps = nuke.root()['fps'].setValue(30)<br />
#<br />
def largeFormat():<br />
sn = nuke.selectedNode()<br />
if sn.Class() != 'Read':<br />
print('#[WARNING]: リードノードが選択されてません')<br />
normalFormat()<br />
else:<br />
targetSizeFormat = nuke.selectedNode().knob("format").value()<br />
sizeFormatWidth = targetSizeFormat.width()<br />
sizeFormatHeight = targetSizeFormat.height()<br />
sizeFormatPixelAspect = targetSizeFormat.pixelAspect()<br />
hogehogeLarge = str(sizeFormatWidth) + " " + str(sizeFormatHeight) + " " + str(sizeFormatPixelAspect) + " " + "hogehoge(large)"<br />
nuke.addFormat( hogehogeLarge )<br />
nuke.root()['format'].setValue("hogehoge(large)")<br />
setProjectFps<br />
<br />
def normalFormat():<br />
hogehogeNormalSize = '2520 1418 hogehoge(normal)'<br />
nuke.addFormat( hogehogeNormalSize )<br />
nuke.root()['format'].setValue("hogehoge(normal)")<br />
setProjectFps<br />
<br />
nodeSelected = nuke.nodesSelected()<br />
#print nodeSelected<br />
if nodeSelected == False:<br />
normalFormat()<br />
else:<br />
largeFormat()<br />
<br />
setProjectRootSettings()tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-11712200213326790452015-12-29T16:35:00.002+09:002015-12-29T16:35:16.563+09:00openDirectory<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">var currentDate = dateAcquisition()[0] +"_"+ dateAcquisition()[1] +"_"+ dateAcquisition()[2] ;</span><br />
<span style="font-size: xx-small;">var currentTime = dateAcquisition()[3] +"_"+ dateAcquisition()[4];</span><br />
<span style="font-size: xx-small;">//カレントのAepファイルのパス "-project project_path"</span><br />
<span style="font-size: xx-small;">var aepProjectFileAbsolutePath = app.project.file.absoluteURI;</span><br />
<span style="font-size: xx-small;">//カレントのAepファイルのバージョン</span><br />
<span style="font-size: xx-small;">var aepFileVersion = fileNameVersionExtension(aepProjectFileAbsolutePath)[4];</span><br />
<span style="font-size: xx-small;">//年月日取得</span><br />
<span style="font-size: xx-small;">function dateAcquisition() {</span><br />
<span style="font-size: xx-small;"> //今日の日時示</span><br />
<span style="font-size: xx-small;"> var now = new Date();</span><br />
<span style="font-size: xx-small;"> var year = now.getYear(); // 年</span><br />
<span style="font-size: xx-small;"> var month = now.getMonth() + 1; // 月</span><br />
<span style="font-size: xx-small;"> var day = now.getDate(); // 日</span><br />
<span style="font-size: xx-small;"> var hour = now.getHours(); // 時</span><br />
<span style="font-size: xx-small;"> var min = now.getMinutes(); // 分</span><br />
<span style="font-size: xx-small;"> var sec = now.getSeconds(); // 秒</span><br />
<span style="font-size: xx-small;"> if(year < 2000) { year += 1900; }</span><br />
<span style="font-size: xx-small;"> // 数値が1桁の場合、頭に0を付けて2桁で表示する指定</span><br />
<span style="font-size: xx-small;"> if(month < 10) { month = "0" + month; }</span><br />
<span style="font-size: xx-small;"> if(day < 10) { day = "0" + day; }</span><br />
<span style="font-size: xx-small;"> if(hour < 10) { hour = "0" + hour; }</span><br />
<span style="font-size: xx-small;"> if(min < 10) { min = "0" + min; }</span><br />
<span style="font-size: xx-small;"> if(sec < 10) { sec = "0" + sec; }</span><br />
<span style="font-size: xx-small;"> return [ year , month , day , hour , min , sec ];</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//ファイル名と拡張子とバージョン取得</span><br />
<span style="font-size: xx-small;">function fileNameVersionExtension(AbsolutePath) {</span><br />
<span style="font-size: xx-small;"> //拡張子込ファイル名</span><br />
<span style="font-size: xx-small;"> var filePathAry = AbsolutePath.split("/");</span><br />
<span style="font-size: xx-small;"> var filePathAryLength = filePathAry.length -1;</span><br />
<span style="font-size: xx-small;"> var fileFullName = filePathAry[filePathAryLength];</span><br />
<span style="font-size: xx-small;"> //ファイル名とファイルタイプ(拡張子)</span><br />
<span style="font-size: xx-small;"> var fileNameAry = fileFullName.split(".");</span><br />
<span style="font-size: xx-small;"> var fileNameAryLength = fileNameAry.length -1;</span><br />
<span style="font-size: xx-small;"> var fileName = fileNameAry[0];</span><br />
<span style="font-size: xx-small;"> var fileExtension = fileNameAry[fileNameAryLength];</span><br />
<span style="font-size: xx-small;"> //ファイルネーム要素</span><br />
<span style="font-size: xx-small;"> var fileNameElement = fileName.split("_");</span><br />
<span style="font-size: xx-small;"> var fileVersionAryLength = fileNameElement.length -1;</span><br />
<span style="font-size: xx-small;"> var fileVersion = fileNameElement[fileVersionAryLength];</span><br />
<span style="font-size: xx-small;"> return [fileFullName , fileName , fileExtension , fileNameElement , fileVersion ];</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">function openDirectory() {</span><br />
<span style="font-size: xx-small;"> var aepPathObj = new Folder(app.project.file.path);</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;"> var imagesDir = app.project.file.path +"/"+ "images";</span><br />
<span style="font-size: xx-small;"> var imagesDirObj = new Folder( imagesDir );</span><br />
<span style="font-size: xx-small;"> var outputDir = app.project.file.path +"/"+ "images" +"/"+ aepFileVersion;</span><br />
<span style="font-size: xx-small;"> var outputDirObj = new Folder( outputDir );</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;"> var userTempDirObj = new Folder ( Folder.temp) ;</span><br />
<span style="font-size: xx-small;"> var aerenderDir = (userTempDirObj.toString() + "/afterEffect/aerender/");</span><br />
<span style="font-size: xx-small;"> var aerenderDirObj = new Folder( aerenderDir );</span><br />
<span style="font-size: xx-small;"> var aeBatDir = (userTempDirObj.toString() + "/afterEffect/aerender/batch/");</span><br />
<span style="font-size: xx-small;"> var aeBatchDirObj = new Folder( aeBatDir );</span><br />
<span style="font-size: xx-small;"> var aeTodayBatchDirObj = new Folder( aeBatDir + currentDate );</span><br />
<span style="font-size: xx-small;"> var aepDir = (userTempDirObj.toString() + "/afterEffect/aerender/project/");</span><br />
<span style="font-size: xx-small;"> var aepDirObj = new Folder( aepDir );</span><br />
<span style="font-size: xx-small;"> var aepTodayDirObj = new Folder( aepDir + currentDate );</span><br />
<span style="font-size: xx-small;"> return [ aepPathObj , imagesDirObj , outputDirObj , userTempDirObj , aerenderDirObj , aeBatchDirObj , aeTodayBatchDirObj , aepDirObj , aepTodayDirObj];</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">function openAepCopyDir() {</span><br />
<span style="font-size: xx-small;"> if (openDirectory()[8].exists == true) {</span><br />
<span style="font-size: xx-small;"> openDirectory()[8].execute();</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> if (openDirectory()[7].exists == true) {</span><br />
<span style="font-size: xx-small;"> openDirectory()[7].execute();</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> if (openDirectory()[4].exists == true) {</span><br />
<span style="font-size: xx-small;"> openDirectory()[4].execute();</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> if (openDirectory()[3].exists == true) {</span><br />
<span style="font-size: xx-small;"> openDirectory()[3].execute();</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> alert("ないっす!!!((((;゚Д゚))))ガクガクブルブル");</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">function openAepBatDir() {</span><br />
<span style="font-size: xx-small;"> if (openDirectory()[6].exists == true) {</span><br />
<span style="font-size: xx-small;"> openDirectory()[6].execute();</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> if (openDirectory()[5].exists == true) {</span><br />
<span style="font-size: xx-small;"> openDirectory()[5].execute();</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> if (openDirectory()[4].exists == true) {</span><br />
<span style="font-size: xx-small;"> openDirectory()[4].execute();</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> if (openDirectory()[3].exists == true) {</span><br />
<span style="font-size: xx-small;"> openDirectory()[3].execute();</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> alert("ないっす!!!((((;゚Д゚))))ガクガクブルブル");</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">function openImagesDir() {</span><br />
<span style="font-size: xx-small;"> if (openDirectory()[2].exists == true) {</span><br />
<span style="font-size: xx-small;"> openDirectory()[2].execute();</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> if (openDirectory()[1].exists == true) {</span><br />
<span style="font-size: xx-small;"> openDirectory()[1].execute();</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> if (openDirectory()[0].exists == true) {</span><br />
<span style="font-size: xx-small;"> openDirectory()[0].execute();</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> alert("ないっす!!!((((;゚Д゚))))ガクガクブルブル");</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">function openAepDir() {</span><br />
<span style="font-size: xx-small;"> if (openDirectory()[0].exists == true) {</span><br />
<span style="font-size: xx-small;"> openDirectory()[0].execute();</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> alert("ないっす!!!((((;゚Д゚))))ガクガクブルブル");</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">function inputPromptOpenDirectory() {</span><br />
<span style="font-size: xx-small;"> var selectChoice = prompt("0-2を入力してください\n"+</span><br />
<span style="font-size: xx-small;"> "0:カレントAEPファイルのフォルダを開く\n"+</span><br />
<span style="font-size: xx-small;"> "1:カレントイメージフォルダを開く\n"+</span><br />
<span style="font-size: xx-small;"> "2:バッチファイルフォルダを開く"</span><br />
<span style="font-size: xx-small;"> ,"0"</span><br />
<span style="font-size: xx-small;"> ,"OpenDirectory");</span><br />
<span style="font-size: xx-small;"> if (selectChoice != null) {</span><br />
<span style="font-size: xx-small;"> if (selectChoice == 0) {</span><br />
<span style="font-size: xx-small;"> openAepDir();</span><br />
<span style="font-size: xx-small;"> }else if (selectChoice == 1) {</span><br />
<span style="font-size: xx-small;"> openImagesDir();</span><br />
<span style="font-size: xx-small;"> }else if (selectChoice == 2) {</span><br />
<span style="font-size: xx-small;"> openAepBatDir();</span><br />
<span style="font-size: xx-small;"> }else if (selectChoice == 3) {</span><br />
<span style="font-size: xx-small;"> openAepCopyDir();</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> alert("むりっす:-p");</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> alert("キャンセルされました");</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">inputPromptOpenDirectory()</span><br />
<div>
<br /></div>
tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-31675643763662359222015-12-27T19:36:00.000+09:002015-12-29T16:37:03.446+09:00setRenderOutput<span style="font-size: xx-small;">レンダーキューでアクティブなキューの設定をする(ディレクトリも作成)</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//年月日取得</span><br />
<span style="font-size: xx-small;">function dateAcquisition(){</span><br />
<span style="font-size: xx-small;"> //今日の日時示</span><br />
<span style="font-size: xx-small;"> var now = new Date();</span><br />
<span style="font-size: xx-small;"> var year = now.getYear(); // 年</span><br />
<span style="font-size: xx-small;"> var month = now.getMonth() + 1; // 月</span><br />
<span style="font-size: xx-small;"> var day = now.getDate(); // 日</span><br />
<span style="font-size: xx-small;"> var hour = now.getHours(); // 時</span><br />
<span style="font-size: xx-small;"> var min = now.getMinutes(); // 分</span><br />
<span style="font-size: xx-small;"> var sec = now.getSeconds(); // 秒</span><br />
<span style="font-size: xx-small;"> if(year < 2000) { year += 1900; }</span><br />
<span style="font-size: xx-small;"> // 数値が1桁の場合、頭に0を付けて2桁で表示する指定</span><br />
<span style="font-size: xx-small;"> if(month < 10) { month = "0" + month; }</span><br />
<span style="font-size: xx-small;"> if(day < 10) { day = "0" + day; }</span><br />
<span style="font-size: xx-small;"> if(hour < 10) { hour = "0" + hour; }</span><br />
<span style="font-size: xx-small;"> if(min < 10) { min = "0" + min; }</span><br />
<span style="font-size: xx-small;"> if(sec < 10) { sec = "0" + sec; }</span><br />
<span style="font-size: xx-small;"> return [ year , month , day , hour , min , sec ];</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//ファイル名と拡張子とバージョン取得</span><br />
<span style="font-size: xx-small;">function fileNameVersionExtension(AbsolutePath){</span><br />
<span style="font-size: xx-small;"> //拡張子込ファイル名</span><br />
<span style="font-size: xx-small;"> var filePathAry = AbsolutePath.split("/");</span><br />
<span style="font-size: xx-small;"> var filePathAryLength = filePathAry.length -1;</span><br />
<span style="font-size: xx-small;"> var fileFullName = filePathAry[filePathAryLength];</span><br />
<span style="font-size: xx-small;"> //ファイル名とファイルタイプ(拡張子)</span><br />
<span style="font-size: xx-small;"> var fileNameAry = fileFullName.split(".");</span><br />
<span style="font-size: xx-small;"> var fileNameAryLength = fileNameAry.length -1;</span><br />
<span style="font-size: xx-small;"> var fileName = fileNameAry[0];</span><br />
<span style="font-size: xx-small;"> var fileExtension = fileNameAry[fileNameAryLength];</span><br />
<span style="font-size: xx-small;"> //ファイルネーム要素</span><br />
<span style="font-size: xx-small;"> var fileNameElement = fileName.split("_");</span><br />
<span style="font-size: xx-small;"> var fileVersionAryLength = fileNameElement.length -1;</span><br />
<span style="font-size: xx-small;"> var fileVersion = fileNameElement[fileVersionAryLength];</span><br />
<span style="font-size: xx-small;"> return [fileFullName , fileName , fileExtension , fileNameElement , fileVersion ];</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//コマンドラインオプション</span><br />
<span style="font-size: xx-small;">function commandLineOption(i){</span><br />
<span style="font-size: xx-small;"> //コンポジション名 "-comp comp_name"</span><br />
<span style="font-size: xx-small;"> var compositonName = app.project.renderQueue.item(i).comp.name;</span><br />
<span style="font-size: xx-small;"> //コンポジションのフレームレート</span><br />
<span style="font-size: xx-small;"> var compositonFrameRate = app.project.renderQueue.item(i).comp.frameRate;</span><br />
<span style="font-size: xx-small;"> //コンポジションのデュレーション</span><br />
<span style="font-size: xx-small;"> var compositonDuration = app.project.renderQueue.item(i).comp.duration * compositonFrameRate;</span><br />
<span style="font-size: xx-small;"> //コンポジションのスタートフレーム "-s start_frame"</span><br />
<span style="font-size: xx-small;"> var compostionStartTime = app.project.renderQueue.item(i).comp.displayStartTime * compositonFrameRate;</span><br />
<span style="font-size: xx-small;"> //コンポジションのエンドフレーム "-e end_frame"</span><br />
<span style="font-size: xx-small;"> var compostionEndTime = (compostionStartTime + compositonDuration) - 1;</span><br />
<span style="font-size: xx-small;"> //ワークエリアのスタートフレーム "-s start_frame"</span><br />
<span style="font-size: xx-small;"> var compostionWorkAreaStart = app.project.renderQueue.item(i).comp.workAreaStart * compositonFrameRate;</span><br />
<span style="font-size: xx-small;"> //ワークエリアのデュレーション</span><br />
<span style="font-size: xx-small;"> var compositonWorkAreaDuration = app.project.renderQueue.item(i).comp.workAreaDuration * compositonFrameRate;</span><br />
<span style="font-size: xx-small;"> //コンポジションのエンドフレーム "-e end_frame"</span><br />
<span style="font-size: xx-small;"> var compostionWorkAreaEndTime = (compostionWorkAreaStart + compositonWorkAreaDuration) - 1;</span><br />
<span style="font-size: xx-small;"> //レンダリング出力先 "-output output_path"</span><br />
<span style="font-size: xx-small;"> var renderPath = app.project.renderQueue.item(i).outputModule(1).file;</span><br />
<span style="font-size: xx-small;"> //レンダリング出力先その2 ※Absoluteをつけないと配列にならない</span><br />
<span style="font-size: xx-small;"> var renderAbsolutePath = app.project.renderQueue.item(i).outputModule(1).file.absoluteURI;</span><br />
<span style="font-size: xx-small;"> return [ compositonName , compostionStartTime , compostionEndTime , compostionWorkAreaStart , compostionWorkAreaEndTime , renderAbsolutePath ]</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//コンプレイヤネーム</span><br />
<span style="font-size: xx-small;">function compostionLayerName(i){</span><br />
<span style="font-size: xx-small;"> var compositonName = commandLineOption(i)[0];</span><br />
<span style="font-size: xx-small;"> var compNameElement = compositonName.split("_");</span><br />
<span style="font-size: xx-small;"> var compNameAryLength = compNameElement.length -1;</span><br />
<span style="font-size: xx-small;"> var compLayerName = compNameElement[compNameAryLength];</span><br />
<span style="font-size: xx-small;"> return [ compLayerName ];</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//</span><br />
<span style="font-size: xx-small;">function makeOutputDir(i){</span><br />
<span style="font-size: xx-small;"> var compLayerName = compostionLayerName(i)[0];</span><br />
<span style="font-size: xx-small;"> var folder = app.project.file.path +"/"+ "images" +"/"+ aepFileVersion +"/"+ compLayerName;</span><br />
<span style="font-size: xx-small;"> folderObj = new Folder(folder);</span><br />
<span style="font-size: xx-small;"> folderObj.create();</span><br />
<span style="font-size: xx-small;"> return [ folder ];</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//</span><br />
<span style="font-size: xx-small;">function setRenderOutput(i,selectChoice){</span><br />
<span style="font-size: xx-small;"> //パディング指定部分の文字列</span><br />
<span style="font-size: xx-small;"> var frameCountPadding = new RegExp("%5B#{1,7}%5D","i");</span><br />
<span style="font-size: xx-small;"> //ムービもしくはサウンドファイルの拡張子の文字列</span><br />
<span style="font-size: xx-small;"> var movieSoundFile = new RegExp("(aif|avi|f4v|flv|mp4|m4v|mp3|mpg|mxf|mov|wav)$","i");</span><br />
<span style="font-size: xx-small;"> //イメージファイルの拡張子文字列</span><br />
<span style="font-size: xx-small;"> var sequenceImageFile = new RegExp("dpx|cin|iff|jpg|exr|png|psd|hdr|sgi|tif|tga","i");</span><br />
<span style="font-size: xx-small;"> var curRnedSet = app.project.renderQueue.item(i).outputModule(1);</span><br />
<span style="font-size: xx-small;"> var renderAbsolutePath = app.project.renderQueue.item(i).outputModule(1).file.absoluteURI;</span><br />
<span style="font-size: xx-small;"> var fileNeme = fileNameVersionExtension(renderAbsolutePath);</span><br />
<span style="font-size: xx-small;"> var renderOutputFolder = makeOutputDir(i)[0];</span><br />
<span style="font-size: xx-small;"> if (selectChoice == 0) {</span><br />
<span style="font-size: xx-small;"> if ((frameCountPadding.test(fileNeme[0]) == 1)&&(sequenceImageFile.test(fileNeme[0]) == 1)) {</span><br />
<span style="font-size: xx-small;"> curRnedSet.file = new File(renderOutputFolder +"/"+ fileNameSetImage );</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> else if ((frameCountPadding.test(fileNeme[0]) == 0)&&(sequenceImageFile.test(fileNeme[0]) == 1)) {</span><br />
<span style="font-size: xx-small;"> curRnedSet.file = new File(renderOutputFolder +"/"+ fileNameSetImage );</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> else if (movieSoundFile.test(fileNeme[0]) == 1) {</span><br />
<span style="font-size: xx-small;"> curRnedSet.file = new File(renderOutputFolder +"/"+ fileNameSetMovieSound );</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> //</span><br />
<span style="font-size: xx-small;"> }else if (selectChoice == 1) {</span><br />
<span style="font-size: xx-small;"> curRnedSet.applyTemplate(outputModuleProject);</span><br />
<span style="font-size: xx-small;"> curRnedSet.file = new File(renderOutputFolder +"/"+ fileNameSetImage );</span><br />
<span style="font-size: xx-small;"> //</span><br />
<span style="font-size: xx-small;"> }else if (selectChoice == 2) {</span><br />
<span style="font-size: xx-small;"> if ((frameCountPadding.test(fileNeme[0]) == 1)&&(sequenceImageFile.test(fileNeme[0]) == 1)) {</span><br />
<span style="font-size: xx-small;"> curRnedSet.applyTemplate(outputModuleImage);</span><br />
<span style="font-size: xx-small;"> curRnedSet.file = new File(renderOutputFolder +"/"+ fileNameSetImage );</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> else if ((frameCountPadding.test(fileNeme[0]) == 0)&&(sequenceImageFile.test(fileNeme[0]) == 1)) {</span><br />
<span style="font-size: xx-small;"> curRnedSet.applyTemplate(outputModuleImage);</span><br />
<span style="font-size: xx-small;"> curRnedSet.file = new File(renderOutputFolder +"/"+ fileNameSetImage );</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> else if (movieSoundFile.test(fileNeme[0]) == 1) {</span><br />
<span style="font-size: xx-small;"> curRnedSet.applyTemplate(outputModuleMovieSound);</span><br />
<span style="font-size: xx-small;"> curRnedSet.file = new File(renderOutputFolder +"/"+ fileNameSetMovieSound );</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//</span><br />
<span style="font-size: xx-small;">function inputPromptSetRenderOutput(){</span><br />
<span style="font-size: xx-small;"> var selectChoice = prompt("0-2を入力してください\n"+</span><br />
<span style="font-size: xx-small;"> "0:出力モジュールは変更せず出力先を設定\n"+</span><br />
<span style="font-size: xx-small;"> "1:出力モジュールを一括設定して出力先を設定!\n"+</span><br />
<span style="font-size: xx-small;"> "2:出力モジュールを設定して出力先を設定(ファイル判別)"</span><br />
<span style="font-size: xx-small;"> ,"0"</span><br />
<span style="font-size: xx-small;"> ,"setRenderPath");</span><br />
<span style="font-size: xx-small;"> if (selectChoice != null){</span><br />
<span style="font-size: xx-small;"> for (i = 1 ; i <= renderQueNumberItem ; i++){</span><br />
<span style="font-size: xx-small;"> var renderQueActiveCompostion = app.project.renderQueue.item(i).render;</span><br />
<span style="font-size: xx-small;"> var renderAbsolutePath = app.project.renderQueue.item(i).outputModule(1).file.absoluteURI;</span><br />
<span style="font-size: xx-small;"> var fileNeme = fileNameVersionExtension(renderAbsolutePath);</span><br />
<span style="font-size: xx-small;"> if (renderQueActiveCompostion == 1) {</span><br />
<span style="font-size: xx-small;"> makeOutputDir(i);</span><br />
<span style="font-size: xx-small;"> setRenderOutput(i,selectChoice);</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> else if(renderQueActiveCompostion == 0) {</span><br />
<span style="font-size: xx-small;"> //alert("レンダーキューにアクティブなアイテムがねーっす:-q")</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> if (selectChoice <= 2) {</span><br />
<span style="font-size: xx-small;"> alert("設定しました");</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> alert("むりっす:-p");</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> alert("キャンセルされました")</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//日時</span><br />
<span style="font-size: xx-small;">var currentDate = dateAcquisition()[0] +"_"+ dateAcquisition()[1] +"_"+ dateAcquisition()[2] ;</span><br />
<span style="font-size: xx-small;">//時刻</span><br />
<span style="font-size: xx-small;">var currentTime = dateAcquisition()[3] +"_"+ dateAcquisition()[4];</span><br />
<span style="font-size: xx-small;">//カレントのAepファイルのパス "-project project_path"</span><br />
<span style="font-size: xx-small;">var aepProjectFileAbsolutePath = app.project.file.absoluteURI;</span><br />
<span style="font-size: xx-small;">//カレントのAepファイルの名前</span><br />
<span style="font-size: xx-small;">var afterEffectsFileNeme = fileNameVersionExtension(aepProjectFileAbsolutePath);</span><br />
<span style="font-size: xx-small;">//レンダーキューのアイテム数</span><br />
<span style="font-size: xx-small;">var renderQueNumberItem = app.project.renderQueue.numItems;</span><br />
<span style="font-size: xx-small;">//カレントのAepファイルのバージョン</span><br />
<span style="font-size: xx-small;">var aepFileVersion = fileNameVersionExtension(aepProjectFileAbsolutePath)[4];</span><br />
<span style="font-size: xx-small;">//出力モジュール</span><br />
<span style="font-size: xx-small;">var outputModuleImage = "TIFF シーケンス (アルファ付き)" //"Photoshop"</span><br />
<span style="font-size: xx-small;">var outputModuleMovieSound = "ロスレス圧縮(アルファ付き)" //"H.264"</span><br />
<span style="font-size: xx-small;">var outputModuleProject = "Photoshop" //"TIFF シーケンス (アルファ付き)"</span><br />
<span style="font-size: xx-small;">//ファイル名</span><br />
<span style="font-size: xx-small;">var fileNameSetImage = "[compName]_" + aepFileVersion + "_[####].[fileExtension]";</span><br />
<span style="font-size: xx-small;">var fileNameSetMovieSound = "[compName]_" + aepFileVersion + ".[fileExtension]";</span><br />
<span style="font-size: xx-small;">inputPromptSetRenderOutput();</span><br />
<div>
<br /></div>
tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-34236191764146830612015-12-24T01:58:00.001+09:002015-12-29T16:37:59.048+09:00aerenderDiv<span style="font-size: xx-small;">//aerender スキップフレーム版</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">var currentDate = dateAcquisition()[0] +"_"+ dateAcquisition()[1] +"_"+ dateAcquisition()[2] ;</span><br />
<span style="font-size: xx-small;">var currentTime = dateAcquisition()[3] +"_"+ dateAcquisition()[4];</span><br />
<span style="font-size: xx-small;">var randnum = Math.floor( Math.random() * 100000 );</span><br />
<span style="font-size: xx-small;">var userTempDir = new Folder (Folder.temp);</span><br />
<span style="font-size: xx-small;">//カレントのAepファイルのパス "-project project_path"</span><br />
<span style="font-size: xx-small;">var aepProjectFileAbsolutePath = app.project.file.absoluteURI;</span><br />
<span style="font-size: xx-small;">//カレントのAepファイルの名前</span><br />
<span style="font-size: xx-small;">var afterEffectsFileNeme = fileNameExtension(aepProjectFileAbsolutePath);</span><br />
<span style="font-size: xx-small;">//カレントaerenderのファイルのパス</span><br />
<span style="font-size: xx-small;">var aeRenderAbsolutePath = '"C:\\Program Files\\Adobe\\Adobe After Effects '+ applicationVersion() +'\\Support Files\\aerender.exe"';</span><br />
<span style="font-size: xx-small;">//レンダーキューのアイテム数</span><br />
<span style="font-size: xx-small;">var renderQueNumberItem = app.project.renderQueue.numItems</span><br />
<span style="font-size: xx-small;">//メモリの使用量とキャッシュの使用量 "-mem_usage image_cache_percent max_mem_percent"</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//年月日取得</span><br />
<span style="font-size: xx-small;">function dateAcquisition(){</span><br />
<span style="font-size: xx-small;"> //今日の日時示</span><br />
<span style="font-size: xx-small;"> var now = new Date();</span><br />
<span style="font-size: xx-small;"> var year = now.getYear(); // 年</span><br />
<span style="font-size: xx-small;"> var month = now.getMonth() + 1; // 月</span><br />
<span style="font-size: xx-small;"> var day = now.getDate(); // 日</span><br />
<span style="font-size: xx-small;"> var hour = now.getHours(); // 時</span><br />
<span style="font-size: xx-small;"> var min = now.getMinutes(); // 分</span><br />
<span style="font-size: xx-small;"> var sec = now.getSeconds(); // 秒</span><br />
<span style="font-size: xx-small;"> if(year < 2000) { year += 1900; }</span><br />
<span style="font-size: xx-small;"> // 数値が1桁の場合、頭に0を付けて2桁で表示する指定</span><br />
<span style="font-size: xx-small;"> if(month < 10) { month = "0" + month; }</span><br />
<span style="font-size: xx-small;"> if(day < 10) { day = "0" + day; }</span><br />
<span style="font-size: xx-small;"> if(hour < 10) { hour = "0" + hour; }</span><br />
<span style="font-size: xx-small;"> if(min < 10) { min = "0" + min; }</span><br />
<span style="font-size: xx-small;"> if(sec < 10) { sec = "0" + sec; }</span><br />
<span style="font-size: xx-small;"> return [ year , month , day , hour , min , sec ];</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//afterEffectsの確認</span><br />
<span style="font-size: xx-small;">function applicationVersion(){</span><br />
<span style="font-size: xx-small;"> var applicationBuildNumber = app.buildName;</span><br />
<span style="font-size: xx-small;"> var applicationVersion = applicationBuildNumber.substring(0,4);</span><br />
<span style="font-size: xx-small;"> if (applicationVersion == 10.0) {</span><br />
<span style="font-size: xx-small;"> var applicationVersionCharacter = "CS5";</span><br />
<span style="font-size: xx-small;"> return applicationVersionCharacter;</span><br />
<span style="font-size: xx-small;"> }else if (applicationVersion == 10.5){</span><br />
<span style="font-size: xx-small;"> var applicationVersionCharacter = "CS5.5";</span><br />
<span style="font-size: xx-small;"> return applicationVersionCharacter;</span><br />
<span style="font-size: xx-small;"> }else if ((applicationVersion == 11.0)||(applicationVersion == 11.1)){</span><br />
<span style="font-size: xx-small;"> var applicationVersionCharacter = "CS6";</span><br />
<span style="font-size: xx-small;"> return applicationVersionCharacter;</span><br />
<span style="font-size: xx-small;"> }else if ((applicationVersion == 13.0)||(applicationVersion == 13.1)){</span><br />
<span style="font-size: xx-small;"> var applicationVersionCharacter = "CC 2014";</span><br />
<span style="font-size: xx-small;"> return applicationVersionCharacter;</span><br />
<span style="font-size: xx-small;"> }else{</span><br />
<span style="font-size: xx-small;"> return "バージョンを確認してください";</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//ファイル名と拡張子取得</span><br />
<span style="font-size: xx-small;">function fileNameExtension(AbsolutePath){</span><br />
<span style="font-size: xx-small;"> //拡張子込ファイル名</span><br />
<span style="font-size: xx-small;"> var filePathAry = AbsolutePath.split("/");</span><br />
<span style="font-size: xx-small;"> var filePathAryLength = filePathAry.length -1;</span><br />
<span style="font-size: xx-small;"> var fileFullName = filePathAry[filePathAryLength];</span><br />
<span style="font-size: xx-small;"> //ファイル名とファイルタイプ(拡張子)</span><br />
<span style="font-size: xx-small;"> var fileNameAry = fileFullName.split(".");</span><br />
<span style="font-size: xx-small;"> var fileNameAryLength = fileNameAry.length -1;</span><br />
<span style="font-size: xx-small;"> var fileName = fileNameAry[0];</span><br />
<span style="font-size: xx-small;"> var fileExtension = fileNameAry[fileNameAryLength];</span><br />
<span style="font-size: xx-small;"> return [fileFullName , fileName , fileExtension];</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//プロジェクトファイルをtempへコピー</span><br />
<span style="font-size: xx-small;">function copyAepFileToTemp(copySourceAep,copyDestinationDir){</span><br />
<span style="font-size: xx-small;"> var currentAepFile = new File( copySourceAep );</span><br />
<span style="font-size: xx-small;"> var copyAepFile = new File( afterEffectsProjDir + currentDate +"/"+ afterEffectsFileNeme[0] );</span><br />
<span style="font-size: xx-small;"> currentAepFile.copy(copyAepFile);</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//ログファイル書き出し先 "-log logfile_path"</span><br />
<span style="font-size: xx-small;">function createPathAepLogDir(){</span><br />
<span style="font-size: xx-small;"> var afterEffectsLogDir = (userTempDir.toString() + "/afterEffect/aerender/log/" + currentDate);</span><br />
<span style="font-size: xx-small;"> var createAfterEffectsLogDir = new Folder( afterEffectsLogDir ).create();</span><br />
<span style="font-size: xx-small;"> return [ createAfterEffectsLogDir , afterEffectsLogDir ];</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//プロジェクトファイルコピー先</span><br />
<span style="font-size: xx-small;">function createPathAepProjDir(){</span><br />
<span style="font-size: xx-small;"> var afterEffectsProjDir = (userTempDir.toString() + "/afterEffect/aerender/project/");</span><br />
<span style="font-size: xx-small;"> var createAfterEffectsAepDir = new Folder( afterEffectsProjDir + currentDate ).create();</span><br />
<span style="font-size: xx-small;"> return [ createAfterEffectsAepDir , afterEffectsProjDir ];</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//バッチファイル書き出し先</span><br />
<span style="font-size: xx-small;">function createPathAepBatDir(){</span><br />
<span style="font-size: xx-small;"> var afterEffectsBatDir = (userTempDir.toString() + "/afterEffect/aerender/batch/");</span><br />
<span style="font-size: xx-small;"> var createAfterEffectsBatDir = new Folder( afterEffectsBatDir + currentDate ).create();</span><br />
<span style="font-size: xx-small;"> return [ createAfterEffectsBatDir , afterEffectsBatDir ];</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//バッチファイル作成</span><br />
<span style="font-size: xx-small;">function createPathBatchFile(afterEffectsBatDir){</span><br />
<span style="font-size: xx-small;"> var afterEffectsBatFileName = ("aerender" +"_" + afterEffectsFileNeme[1] +"_" + currentTime +"_"+ randnum + ".bat");</span><br />
<span style="font-size: xx-small;"> var afterEffectsBatFilePath = afterEffectsBatDir + currentDate +"/"+ afterEffectsBatFileName;</span><br />
<span style="font-size: xx-small;"> var afterEffectsBatFile = new File( afterEffectsBatFilePath );</span><br />
<span style="font-size: xx-small;"> return [ afterEffectsBatFile , afterEffectsBatFilePath , afterEffectsBatFileName ];</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//バッチファイルにコマンド追記</span><br />
<span style="font-size: xx-small;">function addCommandToBatchFile(afterEffectsBatFile){</span><br />
<span style="font-size: xx-small;"> var batFile = new File(afterEffectsBatFile);</span><br />
<span style="font-size: xx-small;"> var aepFileName = fileNameExtension(aepProjectFileAbsolutePath)[0];</span><br />
<span style="font-size: xx-small;"> batFile.open("w");</span><br />
<span style="font-size: xx-small;"> batFile.writeln("@echo off");</span><br />
<span style="font-size: xx-small;"> batFile.writeln("title" +" "+ aepFileName +" "+ applicationVersion() +" "+ "batch start at"+" "+ "%time%");</span><br />
<span style="font-size: xx-small;"> for ( i = 0; i < batCommandLineAry.length; i++){</span><br />
<span style="font-size: xx-small;"> batFile.writeln(batCommandLineAry[i]) + "\n";</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> batFile.close();</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//コマンドラインオプション</span><br />
<span style="font-size: xx-small;">function commandLineOption(i){</span><br />
<span style="font-size: xx-small;"> //コンポジション名 "-comp comp_name"</span><br />
<span style="font-size: xx-small;"> var compositonName = app.project.renderQueue.item(i).comp.name;</span><br />
<span style="font-size: xx-small;"> //コンポジションのフレームレート</span><br />
<span style="font-size: xx-small;"> var compositonFrameRate = app.project.renderQueue.item(i).comp.frameRate;</span><br />
<span style="font-size: xx-small;"> //コンポジションのデュレーション</span><br />
<span style="font-size: xx-small;"> var compositonDuration = app.project.renderQueue.item(i).comp.duration * compositonFrameRate;</span><br />
<span style="font-size: xx-small;"> //コンポジションのスタートフレーム "-s start_frame"</span><br />
<span style="font-size: xx-small;"> var compostionStartTime = app.project.renderQueue.item(i).comp.displayStartTime * compositonFrameRate;</span><br />
<span style="font-size: xx-small;"> //コンポジションのエンドフレーム "-e end_frame"</span><br />
<span style="font-size: xx-small;"> var compostionEndTime = (compostionStartTime + compositonDuration) - 1;</span><br />
<span style="font-size: xx-small;"> //ワークエリアのスタートフレーム "-s start_frame"</span><br />
<span style="font-size: xx-small;"> var compostionWorkAreaStart = app.project.renderQueue.item(i).comp.workAreaStart * compositonFrameRate;</span><br />
<span style="font-size: xx-small;"> //ワークエリアのデュレーション</span><br />
<span style="font-size: xx-small;"> var compositonWorkAreaDuration = app.project.renderQueue.item(i).comp.workAreaDuration * compositonFrameRate;</span><br />
<span style="font-size: xx-small;"> //コンポジションのエンドフレーム "-e end_frame"</span><br />
<span style="font-size: xx-small;"> var compostionWorkAreaEndTime = (compostionWorkAreaStart + compositonWorkAreaDuration) - 1;</span><br />
<span style="font-size: xx-small;"> //レンダリング出力先 "-output output_path"</span><br />
<span style="font-size: xx-small;"> var renderPath = app.project.renderQueue.item(i).outputModule(1).file;</span><br />
<span style="font-size: xx-small;"> //レンダリング出力先その2 ※Absoluteをつけないと配列にならない</span><br />
<span style="font-size: xx-small;"> var renderAbsolutePath = app.project.renderQueue.item(i).outputModule(1).file.absoluteURI;</span><br />
<span style="font-size: xx-small;"> return [ compositonName , compostionStartTime , compostionEndTime , compostionWorkAreaStart , compostionWorkAreaEndTime , renderAbsolutePath ]</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//分割しない場合のコマンドライン</span><br />
<span style="font-size: xx-small;">function indivisibleFileComandLine(i){</span><br />
<span style="font-size: xx-small;"> var comp = commandLineOption(i)[0];</span><br />
<span style="font-size: xx-small;"> var indivisibleFile = "start /wait"</span><br />
<span style="font-size: xx-small;"> +" "+ '"' + comp +" "+ applicationVersion() +" "+ "rendering start at"+" "+ "%time%"+'"'</span><br />
<span style="font-size: xx-small;"> +" "+ aeRenderAbsolutePath</span><br />
<span style="font-size: xx-small;"> +" "+ "-project" + " " + aepProjectFileAbsolutePath</span><br />
<span style="font-size: xx-small;"> +" "+ "-rqindex" + " " + i</span><br />
<span style="font-size: xx-small;"> +" "+ "-sound ON"</span><br />
<span style="font-size: xx-small;"> +" "+ "-continueOnMissingFootage";</span><br />
<span style="font-size: xx-small;"> batCommandLineAry.push(indivisibleFile);</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//分割する場合のコマンドライン</span><br />
<span style="font-size: xx-small;">function divideFileComandLine(i){</span><br />
<span style="font-size: xx-small;"> var comp = commandLineOption(i)[0];</span><br />
<span style="font-size: xx-small;"> var divideNum = numDiv</span><br />
<span style="font-size: xx-small;"> for (k = 1 ; k <= divideNum ; k++){</span><br />
<span style="font-size: xx-small;"> if (k < divideNum) {</span><br />
<span style="font-size: xx-small;"> var indivisibleFile = "start"</span><br />
<span style="font-size: xx-small;"> +" "+ '"' + comp +" "+ applicationVersion() +" "+ "rendering start at"+" "+ "%time%"+'"'</span><br />
<span style="font-size: xx-small;"> +" "+ aeRenderAbsolutePath</span><br />
<span style="font-size: xx-small;"> +" "+ "-project" + " " + aepProjectFileAbsolutePath</span><br />
<span style="font-size: xx-small;"> +" "+ "-rqindex" + " " + i</span><br />
<span style="font-size: xx-small;"> +" "+ "-RStemplate" + " " + "マルチマシン設定"</span><br />
<span style="font-size: xx-small;"> +" "+ "-continueOnMissingFootage";</span><br />
<span style="font-size: xx-small;"> batCommandLineAry.push(indivisibleFile);</span><br />
<span style="font-size: xx-small;"> }else if (k == divideNum) {</span><br />
<span style="font-size: xx-small;"> var indivisibleFile = "start /wait"</span><br />
<span style="font-size: xx-small;"> +" "+ '"' + comp +" "+ applicationVersion() +" "+ "rendering start at"+" "+ "%time%"+'"'</span><br />
<span style="font-size: xx-small;"> +" "+ aeRenderAbsolutePath</span><br />
<span style="font-size: xx-small;"> +" "+ "-project" + " " + aepProjectFileAbsolutePath</span><br />
<span style="font-size: xx-small;"> +" "+ "-rqindex" + " " + i</span><br />
<span style="font-size: xx-small;"> +" "+ "-RStemplate" + " " + "マルチマシン設定"</span><br />
<span style="font-size: xx-small;"> +" "+ "-sound ON"</span><br />
<span style="font-size: xx-small;"> +" "+ "-continueOnMissingFootage";</span><br />
<span style="font-size: xx-small;"> batCommandLineAry.push(indivisibleFile);</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> batCommandLineAry.push(":-q")</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//レンダーキューのアクティブキュー情報取得バッチファイルへ書き出し</span><br />
<span style="font-size: xx-small;">function renderQueueToBatchFile(){</span><br />
<span style="font-size: xx-small;"> //パディング指定部分の文字列</span><br />
<span style="font-size: xx-small;"> var frameCountPadding = new RegExp("%5B#{1,7}%5D","i");</span><br />
<span style="font-size: xx-small;"> //ムービもしくはサウンドファイルの拡張子の文字列</span><br />
<span style="font-size: xx-small;"> var movieSoundFile = new RegExp("(aif|avi|f4v|flv|mp4|m4v|mp3|mpg|mxf|mov|wav)$","i");</span><br />
<span style="font-size: xx-small;"> //イメージファイルの拡張子文字列</span><br />
<span style="font-size: xx-small;"> var sequenceImageFile = new RegExp("dpx|cin|iff|jpg|exr|png|psd|hdr|sgi|tif|tga","i");</span><br />
<span style="font-size: xx-small;"> </span><br />
<span style="font-size: xx-small;"> for (i = 1 ; i <= renderQueNumberItem ; i++){</span><br />
<span style="font-size: xx-small;"> var renderQueActiveCompostion = app.project.renderQueue.item(i).render;</span><br />
<span style="font-size: xx-small;"> var renderAbsolutePath = app.project.renderQueue.item(i).outputModule(1).file.absoluteURI;</span><br />
<span style="font-size: xx-small;"> var fileNeme = fileNameExtension(renderAbsolutePath);</span><br />
<span style="font-size: xx-small;"> if (renderQueActiveCompostion == 1) {</span><br />
<span style="font-size: xx-small;"> //alert (fileNeme[0] + "を" +"レンダーするっす:-p");</span><br />
<span style="font-size: xx-small;"> if ((frameCountPadding.test(fileNeme[0]) == 1)&&(sequenceImageFile.test(fileNeme[0]) == 1)) {</span><br />
<span style="font-size: xx-small;"> if (numDiv == 0){</span><br />
<span style="font-size: xx-small;"> //alert("レンダリングしないっす:-q");</span><br />
<span style="font-size: xx-small;"> }else if (numDiv == 1) {</span><br />
<span style="font-size: xx-small;"> //alert("レンダリングするっす:-q");</span><br />
<span style="font-size: xx-small;"> indivisibleFileComandLine(i);</span><br />
<span style="font-size: xx-small;"> }else if (numDiv >= 2 && numDiv <= 12) {</span><br />
<span style="font-size: xx-small;"> //alert("レンダリングするっす:-q");</span><br />
<span style="font-size: xx-small;"> divideFileComandLine(i);</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> else if ((frameCountPadding.test(fileNeme[0]) == 0)&&(sequenceImageFile.test(fileNeme[0]) == 1)) {</span><br />
<span style="font-size: xx-small;"> indivisibleFileComandLine(i);</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> else if (movieSoundFile.test(fileNeme[0]) == 1) {</span><br />
<span style="font-size: xx-small;"> indivisibleFileComandLine(i);</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> else if(renderQueActiveCompostion == 0) {</span><br />
<span style="font-size: xx-small;"> //alert ("レンダーキューにアクティブなアイテムがねーっす:-q")</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//入力ダイアログ</span><br />
<span style="font-size: xx-small;">function inputPrompt(){</span><br />
<span style="font-size: xx-small;"> var text = prompt("並列でレンダリングする数を入力してください \n 2-8 をお勧めします","4");</span><br />
<span style="font-size: xx-small;"> if (text != null){</span><br />
<span style="font-size: xx-small;"> //alert("並列数は"+text+"です")</span><br />
<span style="font-size: xx-small;"> }else {</span><br />
<span style="font-size: xx-small;"> alert("キャンセルされました")</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> return [ text ];</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//レンダリング条件分岐</span><br />
<span style="font-size: xx-small;">function renderingBranch(){</span><br />
<span style="font-size: xx-small;"> if (numDiv == 0){</span><br />
<span style="font-size: xx-small;"> alert("レンダリングしないっす:-q");</span><br />
<span style="font-size: xx-small;"> }else if (numDiv == 1) {</span><br />
<span style="font-size: xx-small;"> renderQueueToBatchFile();</span><br />
<span style="font-size: xx-small;"> createBatchFile;</span><br />
<span style="font-size: xx-small;"> addCommandToBatchFile(afterEffectsBatFile);</span><br />
<span style="font-size: xx-small;"> alert("並列レンダリングしないっす:-q");</span><br />
<span style="font-size: xx-small;"> }else if (numDiv >= 2 && numDiv <= 8) {</span><br />
<span style="font-size: xx-small;"> renderQueueToBatchFile();</span><br />
<span style="font-size: xx-small;"> createBatchFile;</span><br />
<span style="font-size: xx-small;"> addCommandToBatchFile(afterEffectsBatFile);</span><br />
<span style="font-size: xx-small;"> alert("並列レンダリングするっす:-D");</span><br />
<span style="font-size: xx-small;"> }else if (numDiv >= 9 && numDiv <= 12) {</span><br />
<span style="font-size: xx-small;"> renderQueueToBatchFile();</span><br />
<span style="font-size: xx-small;"> createBatchFile;</span><br />
<span style="font-size: xx-small;"> addCommandToBatchFile(afterEffectsBatFile); </span><br />
<span style="font-size: xx-small;"> alert("お勧めしないぴょん:-p");</span><br />
<span style="font-size: xx-small;"> }else if (numDiv >= 13) {</span><br />
<span style="font-size: xx-small;"> alert("むりっす(;´・ω・)");</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">//メイン</span><br />
<span style="font-size: xx-small;">var numDiv = inputPrompt()[0];</span><br />
<span style="font-size: xx-small;">var batCommandLineAry = new Array();</span><br />
<span style="font-size: xx-small;">var afterEffectsBatFile = createPathBatchFile(createPathAepBatDir()[1])[1];</span><br />
<span style="font-size: xx-small;">var batFile = new File(afterEffectsBatFile);</span><br />
<span style="font-size: xx-small;">var createBatchFile = createPathBatchFile(createPathAepBatDir()[1]);</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">renderingBranch();</span><br />
<span style="font-size: xx-small;">batFile.execute();</span><br />
<span style="font-size: xx-small;"><br /></span>
tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-84534171914677382492015-10-02T04:38:00.003+09:002015-10-02T04:38:19.162+09:00nuke_memoroot関係めも<br />
<br />
<br />
nuke.root()['format'].setValue("HD")<br />
nuke.root()['format'].setValue( "square_2K" )<br />
<br />
scriptFormats = nuke.formats()<br />
<br />
for f in scriptFormats:<br />
print f.name()<br />
print f.width()<br />
print f.height()<br />
print f.pixelAspect()<br />
<br />
print 10*'-'<br />
<br />
<br />
nuke.root()['format'].value().name() # renvoi le nom du format<br />
nuke.root()['format'].value().setName("nomDuFormat")<br />
<br />
<br />
print nuke.root()['format'].value().width()<br />
print nuke.root()['format'].value().height()<br />
print nuke.root()['format'].value().pixelAspect()<br />
<br />
print nuke.root()['format'].value().name()<br />
<br />
<br />
<br />
square2k = '2048 2048 square 2k'<br />
nuke.addFormat( square2k )<br />
<br />
<span style="background-color: white; color: #333333; font-family: Helvetica, Geneva, Arial, sans-serif; font-size: 13px; line-height: 17px;">nuke.root()['format'].setValue(nuke.addFormat("1024 960 1")) </span><br />
<span style="background-color: white; color: #333333; font-family: Helvetica, Geneva, Arial, sans-serif; font-size: 13px; line-height: 17px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Helvetica, Geneva, Arial, sans-serif; font-size: 13px; line-height: 17px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Helvetica, Geneva, Arial, sans-serif; font-size: 13px; line-height: 17px;"><br /></span>
quare2k = '2048 2048 square 2k'<br />
nuke.addFormat( square2k )<br />
nuke.root()[‘format’].setValue( ‘square 2k’ )<br />
<br />
# DEFINE BASE AND PROXY FORMATS<br />
square2k = '2048 2048 square 2k'<br />
square1k = '1024 1024 square 1k'<br />
<br />
# ADD FORMATS TO SESSION<br />
for f in ( square2k, square1k ):<br />
nuke.addFormat( f )<br />
<br />
# SET THE ROOT TO USE BOTH BASE AND PROXY FORMATS<br />
root = nuke.root()<br />
root['format'].setValue( 'square 2k' )<br />
root['proxy_type'].setValue( 'format' )<br />
<br />
root['proxy_format'].setValue( 'square 1k' )tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-4254798690051418402015-10-01T07:26:00.000+09:002015-10-01T07:26:18.050+09:00選んだオブジェクトにロケータをペアレントコンストレイントしてベイク<br />
<div>
選んだオブジェクトにロケータをペアレントコンストレイントしてベイク</div>
<br />
<br />
proc BakeLocator(){<br />
<br />
string $Selobjs[] =`ls -sl -tr`;<br />
int $Selsum = `size( $Selobjs )`;<br />
//print $Selsum;<br />
string $addStr = "_nukeLightLoc";<br />
string $tagStr = "hoge";<br />
string $repStr = "hogehoge";<br />
string $conStr = "_parentConstraint1";<br />
//print ($addStr + "," + $tagStr + "," + $repStr + "," + $conStr);<br />
int $x;<br />
<br />
for($x = 0; $x < $Selsum; $x++ ){<br />
CreateLocator; <span class="Apple-tab-span" style="white-space: pre;"> </span><br />
string $LocSelA[] = `ls -sl`; <span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<br />
select $Selobjs[$x];<br />
string $RnmLoc = (substituteAllString($Selobjs[$x], $tagStr , $repStr )) + $addStr ; <br />
string $rnmObj = `rename $LocSelA[0] $RnmLoc`;<br />
<br />
select -r $Selobjs[$x] $rnmObj;<br />
//ペアレントコンストレイントコマンド<br />
doCreateParentConstraintArgList 1 { "0","0","0","0","0","0","0","1","","1" };<br />
parentConstraint -weight 1;<br />
print($rnmObj + $conStr);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
select -r ("*" + $addStr);<br />
string $SelLocs[] =`ls -sl -tr`;<br />
int $SelLocSum = `size( $SelLocs )`;<br />
<br />
string $sFrame =`playbackOptions -query -minTime`;<br />
string $eFrame =`playbackOptions -query -maxTime`;<br />
string $bRange = ($sFrame + ":" + $eFrame);<br />
//print $bRange;<br />
bakeSimulation -t $bRange -at "tx" -at "ty" -at "tz" -at "rx" -at "ry" -at "rz";<br />
select -r ("*" + $addStr + $conStr);<br />
delete;<br />
}<br />
BakeLocator();tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-74160370869578980882015-07-13T01:30:00.003+09:002015-07-13T01:30:32.912+09:00メモ_nuke忘れないように...(^^;<br />
<br />
上流のノード取得<br />
for n in node.dependencies()<br />
<br />
下流のノード取得<br />
for n in node.dependent()<br />
<br />tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-8158786972888618122015-07-02T16:31:00.002+09:002015-07-03T00:43:12.262+09:00カレントディレクトリ等をExplorerで開くmel<span style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 15.0150146484375px; line-height: 30.030029296875px;">カレントディレクトリ等を開くmel</span><br />
<span style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 15.0150146484375px; line-height: 30.030029296875px;">数字でオープン先を選ぶ</span><br />
<br />
global proc sDirOpen()<br />
{ <br />
//-----------------------------------------------------------------------------------------------------<br />
string $fPath = `file -q -sceneName`;<br />
string $fName = `file -q -shortName -sceneName`;<br />
string $sPath = substituteAllString($fPath, $fName , "");<br />
string $iPath = substituteAllString($sPath, "scenes/" , "images/");<br />
string $itPath = substituteAllString($sPath, "scenes/" , "images/tmp/");<br />
//-----------------------------------------------------------------------------------------------------<br />
string $text;<br />
string $result = `promptDialog<br />
-title "sDirOpen"<br />
-message "input Number:"<br />
-text "0"<br />
-button "OK" -button "Cancel"<br />
-defaultButton "OK" -cancelButton "Cancel"<br />
-dismissString "Cancel"`;<br />
<br />
if ($result == "OK")<br />
{<br />
$text = `promptDialog -query -text`;<br />
if($text == 0)<br />
{<br />
print ($sPath + "\n");<br />
string $sOsPath = substituteAllString($sPath, "/", "\\");<br />
print ($sOsPath+ "\n");<br />
system ("explorer.exe "+ $sOsPath);<br />
}<br />
else if($text == 1)<br />
{<br />
print ($iPath + "\n");<br />
string $iOsPath = substituteAllString($iPath, "/", "\\");<br />
system ("explorer.exe "+ $iOsPath);<br />
}<br />
else if($text == 2)<br />
{<br />
string $itOsPath = substituteAllString($itPath, "/", "\\");<br />
system ("explorer.exe "+$itOsPath); <br />
}<br />
else<br />
{<br />
string $window = `window -title "alart"<br />
-iconName "Short Name"<br />
-widthHeight 64 24`;<br />
columnLayout -adjustableColumn true;<br />
button -label "ねーっす :-P" -command ("deleteUI -window " + $window);<br />
setParent ..;<br />
showWindow $window;<br />
//print "ねーっす";<br />
}<br />
}<br />
}<br />
sDirOpen()tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-66661362283621590612015-04-01T02:35:00.000+09:002015-07-14T02:36:39.623+09:00カレントディレクトリをExplorerで開く<span style="font-family: Roboto Slab, Times New Roman, serif;"><span style="background-color: white; font-size: 14px; line-height: 19px; white-space: pre-wrap;">別アプリで書かれていたものを丸パクリしたもの</span></span><br />
<br />
import nuke<br />
<span style="background-color: white; color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; font-size: 14px; line-height: 19px; white-space: pre-wrap;">import os.path</span><br />
<span style="background-color: white; color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; font-size: 14px; line-height: 19px; white-space: pre-wrap;">import sys</span><br />
<span style="background-color: white; color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; font-size: 14px; line-height: 19px; white-space: pre-wrap;">def openCurrent():</span><br />
<span style="background-color: white; color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; font-size: 14px; line-height: 19px; white-space: pre-wrap;"> path = </span><a href="http://nuke.root%28%29.name%28%29/" rel="nofollow" style="-webkit-user-drag: none; background-color: white; color: #6611cc; cursor: text; font-family: 'Roboto Slab', 'Times New Roman', serif; font-size: 14px; line-height: 19px; white-space: pre-wrap;" target="_blank">nuke.root().name()</a><br />
<span style="background-color: white; color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; font-size: 14px; line-height: 19px; white-space: pre-wrap;"> if path == 'Root':</span><br />
<span style="background-color: white; color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; font-size: 14px; line-height: 19px; white-space: pre-wrap;"> print('#[WARNING]: No scene is opened.')</span><br />
<span style="background-color: white; color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; font-size: 14px; line-height: 19px; white-space: pre-wrap;"> return</span><br />
<span style="background-color: white; color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; font-size: 14px; line-height: 19px; white-space: pre-wrap;"> nkp = '\\'.join(path.split('/')[:-1])</span><br />
<span style="background-color: white; color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; font-size: 14px; line-height: 19px; white-space: pre-wrap;"> if os.path.isdir(nkp):</span><br />
<span style="background-color: white; color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; font-size: 14px; line-height: 19px; white-space: pre-wrap;"> os.popen('explorer "%s"' % nkp)</span><br />
<span style="background-color: white; color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; font-size: 14px; line-height: 19px; white-space: pre-wrap;"> print('>> Open: %s' % nkp)</span><br />
<span style="background-color: white; color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; font-size: 14px; line-height: 19px; white-space: pre-wrap;"> else:</span><br />
<span style="background-color: white; color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; font-size: 14px; line-height: 19px; white-space: pre-wrap;"> print('#[WARANING]: Directory not found: %s' % nkp)</span><br />
<span style="background-color: white; color: rgba(0, 0, 0, 0.8); font-family: 'Roboto Slab', 'Times New Roman', serif; font-size: 14px; line-height: 19px; white-space: pre-wrap;">openCurrent()</span><br />
<br />
<pre class="brush: python;"><br />
// ココにソースを記述<br />
</pre><br />
<div>
<br /></div>
tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-68073017392712535972015-03-11T18:18:00.000+09:002015-03-11T18:18:15.909+09:00nukeでコマ落としコマ落としとバレ消しの注意書き<br />
<br />
import nuke<br />
<br />
readNodes = nuke.allNodes("Read")<br />
for node in nuke.allNodes():<br />
node["selected"].setValue(0)<br />
#print node<br />
for read in readNodes:<br />
read["selected"].setValue(1)<br />
first = read["first"].getValue()<br />
last = read["last"].getValue()<br />
<br />
timeWarp = nuke.createNode("TimeWarp")<br />
timeWarp["lookup"].setAnimated(0)<br />
timeWarp["lookup"].animations()[0].setKey(first, first)<br />
timeWarp["lookup"].animations()[0].setKey(last, last)<br />
if first%2 == 0:<br />
timeWarp["lookup"].setExpression('(int(curve/2))*2')<br />
else:<br />
timeWarp["lookup"].setExpression('((int((curve+1)/2))*2)-1') <br />
NoteOfCaution = nuke.nuke.createNode("Text2")<br />
NoteOfCaution["message"].setValue('バレ消しの必要はありません')<br />
NoteOfCaution["font"].setValue("Adobe Gothic Std", "B")<br />
NoteOfCaution["font_size"].setValue(72)<br />
if first%2 == 0:<br />
NoteOfCaution["opacity"].setExpression('(frame%2)')<br />
else:<br />
NoteOfCaution["opacity"].setExpression('((frame+1)%2)')<br />
<br />
read["selected"].setValue(0)<br />
timeWarp["selected"].setValue(0)<br />
NoteOfCaution["selected"].setValue(0)tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-6647902796482054742014-08-21T18:00:00.005+09:002015-06-30T19:08:48.063+09:00メモ_maya(選択したオブジェクトのアトリビュートを変更)<div class="titlebody" style="font-family: arial, sans-serif; line-height: 20.799999237060547px;">
<h3 class="title" style="color: #333333; font-size: 12px; margin: 0px; padding: 0px 15px 6px;">
他のページからのコピペ</h3>
<h3 class="title" style="color: #333333; font-size: 12px; margin: 0px; padding: 0px 15px 6px;">
</h3>
<h3 class="title" style="color: #333333; font-size: 12px; margin: 0px; padding: 0px 15px 6px;">
選択したオブジェクトのアトリビュートを変更</h3>
</div>
<div class="main" style="color: #333333; font-family: arial, sans-serif; font-size: 12px; line-height: 20.799999237060547px; padding: 0px 15px 10px;">
string $obj[] = `ls -sl`;<br />
<br />
for ($objSel in $obj)<br />
{<br />
//変更可能なのは、ここから//<br />
setAttr ($objSel+".miReflectionBlur") 2.5;<br />
//ここまで//<br />
}<br />
<br />
-------------------------------------------------------<br />
これは、「選択したマテリアルにリフレクションブラーを入れる」ってこと<br />
<br />
1.//「for ($objSel in $obj)」は、「$objの中の$objSel」を//<br />
2.//setAttr ($objSel+"<b>.miReflectionBlur</b>")<i> 2.5</i>;しますって意味//<br />
3.「2.5」って数値は、リフレクションブラーを2.5にしますって意味。<br />
----------------------------------------------------------------------<br />
<br />
つまり、2の「.miReflectionBlur」の中身を変えれば、どんなものでも一括で変更できる。また、1行だけでなく何行入れてもいい。<br />
<br />
たとえば、<br />
@選択したマテリアルを全てブラックホールにする。<br />
setAttr ($objSel+"<b>.matteOpacityMode</b>") 0;<br />
<br />
@選択したマテリアルを全てブラックホールをやめる。<br />
setAttr ($objSel+"<b>.matteOpacityMode</b>") 2;<br />
<br />
@選択したマテリアルを全てグローを切る。<br />
setAttr ($objSel+"<b>.glowIntensity</b>") 0;<br />
<br />
@選択したマテリアルのambientColorに、occlusionをつける。<br />
connectAttr -force <i>mib_amb_occlusion1</i>.outValue ($objSel+"<b>.ambientColor</b>");<br />
//「mib_amb_occlusion1」は、オクルージョンの名前//</div>
<br />
<br />
<br />
<span style="font-size: x-small;">---------------------------------------------------------------------------------------------</span><br />
<span style="font-size: x-small;">//選んだカメラのアトリビュートを変更</span><span style="font-size: x-small;"><br /></span><br />
<div>
<span style="font-size: x-small;">string $obj[] = `ls -sl`;<br />for($lsCam in $obj)<br />{<br />setAttr($lsCam+".filmFit")1;<br />setAttr($lsCam+".cameraScale")1.2;<br />}<br />---------------------------------------------------------------------------------------------<br />//</span><span style="font-size: x-small;">マニピュレータをオンにする</span><span style="font-size: x-small;"><br /></span><br />
<div>
<span style="font-size: x-small;">string $slCam[] = `ls -sl`;<br />for($lsCam in $slCam)<br />{<br />renderManip -e -cam 0 0 0 1 0 $lsCam ;<br />}</span><br />
<span style="font-size: x-small;">---------------------------------------------------------------------------------------------</span><span style="font-size: x-small;"><br /></span><br />
<span style="font-size: x-small;">string $pMesh[] = `ls -type "mesh"`;</span><br />
<span style="font-size: x-small;">//select $pMesh;</span><br />
<span style="font-size: x-small;">for ($spMesh in $pMesh)</span><br />
<span style="font-size: x-small;">{</span><br />
<span style="font-size: x-small;"> print ($spMesh + "\n");</span><br />
<span style="font-size: x-small;"> setAttr ($spMesh + ".overrideEnabled")0;</span><br />
<span style="font-size: x-small;"> //setAttr ($spMesh + ".template")0;</span><br />
<span style="font-size: x-small;">}</span><br />
<span style="font-size: x-small;">---------------------------------------------------------------------------------------------</span><br />
<span style="font-size: x-small;">//カメラのイメージプレーンを削除</span></div>
<div>
<span style="font-size: x-small;">string $list[] = `lsType imagePlane`;<br />for ($node in $list)<br />{<br />select -r $node;<br />delete;<br />}<br />---------------------------------------------------------------------------------------------</span><br />
<span style="font-size: x-small;"><br /></span>
<br />
<span style="font-size: x-small;">string $before = "hoge";</span><br />
<span style="font-size: x-small;">string $after = "hoge";</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">string $node[] = `ls -type file`;</span><br />
<span style="font-size: x-small;"> </span><br />
<span style="font-size: x-small;"> for ($fileNode in $node){</span><br />
<span style="font-size: x-small;"> </span><br />
<span style="font-size: x-small;"> string $path = `getAttr ($fileNode + ".fileTextureName")`;</span><br />
<span style="font-size: x-small;"> print ($path + "\n") ; </span><br />
<span style="font-size: x-small;"> string $changePath = `substitute $before $path $after`;</span><br />
<span style="font-size: x-small;"> print ($changePath + "\n") ; </span><br />
<span style="font-size: x-small;"> setAttr -type "string" ($fileNode + ".fileTextureName") $changePath;</span><br />
<span style="font-size: x-small;"> }</span><br />
<span style="font-size: x-small;"></span>
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;"><br /></span></div>
</div>
tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-41836913638862351982014-07-11T12:21:00.000+09:002015-04-01T02:17:46.796+09:00メモ_maya(チャネル ボックスカラー)<div>
ほかページからの転記</div>
<div>
<br /></div>
<div>
チャネル ボックス(Channel Box) カラー</div>
<div>
<br /></div>
<div>
ロックされている</div>
<div>
<b>グレー</b></div>
<div>
キー設定不可</div>
<div>
<b>ライト グレー</b></div>
<div>
ミュートされている</div>
<div>
<b>茶色</b></div>
<div>
ブレンドされている</div>
<div>
<b>緑色</b></div>
<div>
キー設定されている</div>
<div>
<b>明るいオレンジ色</b></div>
<div>
エクスプレッション</div>
<div>
<b>紫色</b></div>
<div>
コンストレイントされている</div>
<div>
<b>青色</b></div>
<div>
接続済み</div>
<div>
<b>黄色</b></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<div>
========================================================</div>
<div>
Mel覚え書き</div>
<div>
========================================================</div>
<div>
<br /></div>
<div>
--------------------------------------------------------</div>
<div>
■for分テンプレート</div>
<div>
--------------------------------------------------------</div>
<div>
string $sentaku[] = ` ls -sl -tr ` ;</div>
<div>
int $kazu = ` size ( $sentaku ) ` ;</div>
<div>
int $x ;</div>
<div>
<br /></div>
<div>
for ( $x = 0 ; $x < $kazu ; $x++ )</div>
<div>
{</div>
<div>
string $locName = $sentaku[$x];</div>
<div>
spaceLocator -n $locName;</div>
<div>
}//for</div>
<div>
<br /></div>
<div>
--------------------------------------------------------</div>
<div>
■指定した文字を含むオブジェクトをリスト</div>
<div>
--------------------------------------------------------</div>
<div>
ls "locator?"; </div>
<div>
ls "locator?""locator?2";//複数の文字列を指定する版 </div>
<div>
<br /></div>
<div>
↑結構簡単だった、、、。</div>
<div>
「ls」コマンド後、「" "」で囲って文字列を指定するだけ。フラグもいらない。</div>
<div>
<br /></div>
<div>
--------------------------------------------------------</div>
<div>
■文字列を置き換え(又は削除)</div>
<div>
--------------------------------------------------------</div>
<div>
string substituteAllString(string $text, string $searchStr, string $replaceStr)</div>
<div>
<br /></div>
<div>
$replaceStrを空の"" にすると削除と同じになる。</div>
<div>
<br /></div>
<div>
例:</div>
<div>
string $text = "one + two + three + four";</div>
<div>
string $result1 = substituteAllString($text, "+", "plus");</div>
<div>
print $result1;</div>
<div>
<br /></div>
<div>
--------------------------------------------------------</div>
<div>
■シーンのファイル名を調べる</div>
<div>
--------------------------------------------------------</div>
<div>
file -q -shortName -sceneName;</div>
<div>
<br /></div>
<div>
--------------------------------------------------------</div>
<div>
■-typeフラグで使えるタイプを調べるコマンド</div>
<div>
--------------------------------------------------------</div>
<div>
ls -showType</div>
<div>
<br /></div>
<div>
--------------------------------------------------------</div>
<div>
■アニメーションカーブを指定フレーム分ズラす</div>
<div>
--------------------------------------------------------</div>
<div>
string $animCurve[] = `ls -type animCurveTL -type animCurveTU -type animCurveTA -type animCurveTT`;</div>
<div>
keyframe -edit -r -timeChange ( この括弧内にズラしたいフレーム数を記述してください ) $animCurve;</div>
<div>
<br /></div>
<div>
--------------------------------------------------------</div>
<div>
■トランスフォームノードをリストUP</div>
<div>
--------------------------------------------------------</div>
<div>
ls -sl -typ transform;</div>
<div>
<br /></div>
<div>
--------------------------------------------------------</div>
<div>
■ウィンドウ表示位置などをコントロールする</div>
<div>
--------------------------------------------------------</div>
<div>
windowPref -enableAll false;//多分、ウィンドウ作成時に強制されるデフォルト設定的なものを切ってる...。</div>
<div>
<br /></div>
<div>
//このコマンドで挟むようにウィンドウを作成する。</div>
<div>
<br /></div>
<div>
windowPref -enableAll true;//↑で切った設定をONに戻す</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
「-enableAll」フラグが何をしてるかは不明、、、。</div>
<div>
(多分、ウィンドウ作成時に強制されるデフォルト設定的なものを切ってるんだと思う。)</div>
<div>
「-w」や「-h」などのコマンドも機能するようになります。</div>
<div>
<br /></div>
<div>
--------------------------------------------------------</div>
<div>
■ウィンドウにコメントなどのテキストを表示</div>
<div>
--------------------------------------------------------</div>
<div>
string $winName = "test";</div>
<div>
<br /></div>
<div>
windowPref -enableAll false;</div>
<div>
<br /></div>
<div>
if((`window -ex $winName`) == true)</div>
<div>
deleteUI $winName;</div>
<div>
<br /></div>
<div>
window -w 360 -title $winName $winName;</div>
<div>
<br /></div>
<div>
scrollLayout;</div>
<div>
<br /></div>
<div>
text -al left//「left」、「right」、「center」の引数を指定する。</div>
<div>
<br /></div>
<div>
//-------------------------</div>
<div>
"■テストコメント\n\</div>
<div>
test\n\</div>
<div>
test";</div>
<div>
//-------------------------</div>
<div>
<br /></div>
<div>
showWindow;</div>
<div>
<br /></div>
<div>
windowPref -enableAll true;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
--------------------------------------------------------</div>
<div>
■可視性ONのパネルを検索→最後のパネルネームを取得</div>
<div>
--------------------------------------------------------</div>
<div>
string $panel[] = `getPanel -visiblePanels`;</div>
<div>
int $kazu = `size($panel)`;</div>
<div>
print $panel[($kazu - 1)];</div>
<div>
<br /></div>
<div>
※作成したモデルパネルの設定変更する際にパネルネームを取得して使用</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
--------------------------------------------------------</div>
<div>
■論理演算子</div>
<div>
--------------------------------------------------------</div>
<div>
=====================================================</div>
<div>
&&<span class="Apple-tab-span" style="white-space: pre;"> </span>~かつ・・・</div>
<div>
||<span class="Apple-tab-span" style="white-space: pre;"> </span>~または・・・("||"半角でshift+\で書ける。)</div>
<div>
!<span class="Apple-tab-span" style="white-space: pre;"> </span>~じゃない</div>
<div>
=====================================================</div>
<div>
<br /></div>
<div>
もし $num が0より大きくてかつ5以下であるなら…</div>
<div>
という場合は</div>
<div>
<br /></div>
<div>
if(0 < $num && $num <= 5)</div>
<div>
…</div>
<div>
<br /></div>
<div>
もし $num が0以下かまたは5より大きいなら</div>
<div>
という場合は</div>
<div>
<br /></div>
<div>
if($num <= 0 || 5 < $num)</div>
<div>
…</div>
<div>
<br /></div>
<div>
この様に書きます。</div>
<div>
<br /></div>
<div>
また、『~じゃなければ』という否定には、『!』記号を使います。</div>
<div>
<br /></div>
<div>
例えば、</div>
<div>
if(!($num < 5))</div>
<div>
…</div>
<div>
<br /></div>
<div>
この様に書くと、「もし$numが5より小さくなければ」という意味になります。</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
--------------------------------------------</div>
<div>
<br /></div>
<div>
int:整数型(整数のみ代入可能)</div>
<div>
float:浮動小数点型(小数も代入可能)</div>
<div>
string:文字列型(文字列を代入可能)</div>
<div>
<br /></div>
<div>
vector:ベクトルデータ型(3つの浮動小数点の組み合わせ)</div>
<div>
配列型:同じ型の要素のリスト</div>
<div>
matrix:行列型(2次元の表)</div>
<div>
<br /></div>
<div>
【↓例↓】</div>
<div>
int $a = 10; </div>
<div>
float $b = 1.234; </div>
<div>
vector $v = <<1.2, 3.4, 6.5>>; </div>
<div>
※個々の値を参照するには、$v.x、$v.y、$v.zと記述する。</div>
<div>
float $ar[] = {1.2, 3.4, 4.5}; // 浮動小数点の配列</div>
<div>
matrix $mtx[3][2]; // 3*2の浮動小数点の表</div>
<div>
<br /></div>
<div>
■代入演算子</div>
<div>
<br /></div>
<div>
$x++<span class="Apple-tab-span" style="white-space: pre;"> </span>// $x = $x + 1と同じ意味。</div>
<div>
$x--<span class="Apple-tab-span" style="white-space: pre;"> </span>// $x = $x - 1</div>
<div>
$x += 5<span class="Apple-tab-span" style="white-space: pre;"> </span>// $x = $x + 5 </div>
<div>
$x -= 3<span class="Apple-tab-span" style="white-space: pre;"> </span>// $x = $x - 3</div>
<div>
<br /></div>
<div>
■比較演算子</div>
<div>
<br /></div>
<div>
a == b<span class="Apple-tab-span" style="white-space: pre;"> </span>// aはbと等しい</div>
<div>
a != b<span class="Apple-tab-span" style="white-space: pre;"> </span>// aはbと等しくない</div>
<div>
a < b<span class="Apple-tab-span" style="white-space: pre;"> </span>// aはb未満</div>
<div>
a >= b<span class="Apple-tab-span" style="white-space: pre;"> </span>// aはb以上である</div>
<div>
a <= b<span class="Apple-tab-span" style="white-space: pre;"> </span>// aはb以下である</div>
<div>
<br /></div>
<div>
■論理演算子</div>
<div>
<br /></div>
<div>
||<span class="Apple-tab-span" style="white-space: pre;"> </span>// or </div>
<div>
&&<span class="Apple-tab-span" style="white-space: pre;"> </span>// and </div>
<div>
!<span class="Apple-tab-span" style="white-space: pre;"> </span>// not </div>
<div>
<br /></div>
<div>
--------------------------------------------</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
--------------------------------------------------------</div>
<div>
■ウィンドウ作成</div>
<div>
--------------------------------------------------------</div>
<div>
<br /></div>
<div>
{</div>
<div>
/* </div>
<div>
「-exists」フラグは:指定した名前のウィンドウが存在するかどうかによってtrueまたはfalseを返します。</div>
<div>
「if」コマンドでは( )の中の結果がTrueであればそれに続くコマンドを実行する。</div>
<div>
*/</div>
<div>
<br /></div>
<div>
string $window = `window -title test aaa`;<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<br /></div>
<div>
if(`window -exists aaa`)</div>
<div>
deleteUI aaa;</div>
<div>
<br /></div>
<div>
formLayout ;</div>
<div>
<br /></div>
<div>
button -label"ボタンの名前" ;</div>
<div>
<br /></div>
<div>
//window -title test aaa;</div>
<div>
showWindow $window ;</div>
<div>
<br /></div>
<div>
}</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
string $kaz = 123 ;</div>
<div>
<br /></div>
<div>
if(`window -exists aaa`)</div>
<div>
deleteUI aaa;</div>
<div>
<br /></div>
<div>
string $windowA = `window -title test aaa`;</div>
<div>
<br /></div>
<div>
//formLayout ;</div>
<div>
columnLayout;</div>
<div>
button -label "ボタン1" -command "print $kaz";</div>
<div>
<br /></div>
<div>
showWindow $windowA ;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
window -title "レイアウト1";</div>
<div>
columnLayout;</div>
<div>
button -label "A";</div>
<div>
rowLayout -numberOfColumns 2 -columnWidth2 20 20;</div>
<div>
button -label "B";</div>
<div>
button -label "C";</div>
<div>
setParent ..;</div>
<div>
<br /></div>
<div>
/*</div>
<div>
-numberOfColumn 2</div>
<div>
横に何個の部品を並べるかを指定します。</div>
<div>
<br /></div>
<div>
-columnWidth2 20 20</div>
<div>
各部品を並べる間隔の指定です。(2 個の場合) </div>
<div>
この場合、B・C ボタンがそれぞれ 20 ピクセル幅の範囲にレイアウトされます。 </div>
<div>
3 個の部品を並べる場合には代わりに -columnWidth3 を使用します。</div>
<div>
<br /></div>
<div>
setParent ..;</div>
<div>
rowLayout の有効範囲の終りです。 </div>
<div>
これ以後は columnLayout が有効になるので、これ以降は部品が縦に並びます。</div>
<div>
*/</div>
<div>
<br /></div>
<div>
button -label "D";</div>
<div>
rowLayout -numberOfColumns 3 -columnWidth3 20 20 20;</div>
<div>
button -label "E";</div>
<div>
button -label "F";</div>
<div>
button -label "G";</div>
<div>
setParent ..;</div>
<div>
showWindow;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
//ボタンの間隔のパラメーター</div>
<div>
int $cWibth = 20;</div>
<div>
<br /></div>
<div>
if(`window -ex XXX`)</div>
<div>
deleteUI XXX;</div>
<div>
<br /></div>
<div>
string $winX = `window -title "kmoriyama" XXX`;</div>
<div>
columnLayout;</div>
<div>
button -label "A";</div>
<div>
<br /></div>
<div>
rowLayout -numberOfColumns 2 -columnWidth2 $cWibth $cWibth;</div>
<div>
button -label "B";</div>
<div>
button -label "C";</div>
<div>
setParent ..;</div>
<div>
<br /></div>
<div>
rowLayout -numberOfColumns 3 -columnWidth3 $cWibth $cWibth $cWibth;</div>
<div>
button -label "D";</div>
<div>
button -label "E";</div>
<div>
button -label "F";</div>
<div>
setParent ..;</div>
<div>
<br /></div>
<div>
rowLayout -numberOfColumns 4 -columnWidth4 $cWibth $cWibth $cWibth $cWibth;</div>
<div>
button -label "G";</div>
<div>
button -label "H";</div>
<div>
button -label "I" -w 20;</div>
<div>
button -label "J";</div>
<div>
setParent ..;</div>
<div>
<br /></div>
<div>
showWindow $winX;</div>
<div>
<br /></div>
<div>
========================================</div>
<div>
アニムレイヤーを作成して、特定のリグを適用する</div>
<div>
========================================</div>
<div>
<br /></div>
<div>
string $anmName = "Pose";</div>
<div>
<br /></div>
<div>
string $setRo = $anmName + ".rotationAccumulationMode" ;</div>
<div>
string $setSc = $anmName + ".scaleAccumulationMode" ;</div>
<div>
<br /></div>
<div>
animLayer $anmName;</div>
<div>
<br /></div>
<div>
setAttr $setRo 0;</div>
<div>
setAttr $setSc 1;</div>
<div>
<br /></div>
<div>
select -cl ;</div>
<div>
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 ;</div>
<div>
<br /></div>
<div>
animLayer -e -addSelectedObjects -excludeScale -excludeDynamic -excludeBoolean -excludeEnum $anmName;</div>
<div>
<br /></div>
<div>
========================================</div>
<div>
チャンネルボックスの余計なチャンネルの非表示</div>
<div>
========================================</div>
<div>
setAttr ノード名.ini 0;//これで非表示</div>
<div>
setAttr ノード名.ini 2;//これで初期化。1ではないようです。</div>
<div>
<br /></div>
<div>
========================================</div>
<div>
アニムカーブを検索してフレーム移動</div>
<div>
========================================</div>
<div>
int $StarFrame = `getAttr PRM.StartFrame`;</div>
<div>
int $EndFrame = `getAttr PRM.EndFrame`;</div>
<div>
int $LoopStart = `getAttr PRM.LoopStart`;</div>
<div>
int $LoopEnd = `getAttr PRM.LoopEnd`;</div>
<div>
<br /></div>
<div>
string $animCurve[] = `ls -type animCurveTL -type animCurveTU -type animCurveTA -type animCurveTT`;</div>
<div>
keyframe -edit -r -timeChange (-$LoopEnd) $animCurve;</div>
<div>
<br /></div>
<div>
playbackOptions -ast $StarFrame -aet ($EndFrame - $LoopEnd) -min $StarFrame -max ($EndFrame - $LoopEnd)</div>
<div>
<br /></div>
<div>
========================================</div>
<div>
textフィールドウィンドウ</div>
<div>
========================================</div>
<div>
window;</div>
<div>
columnLayout -adj true;</div>
<div>
textField;</div>
<div>
textFieldButtonGrp -label "ラベル" -text "textFieldButtonGrp" -buttonLabel "ボタン";</div>
<div>
showWindow;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
rowLayout -numberOfColumns 2;</div>
<div>
button -label "<-StartOrEnd->"<span class="Apple-tab-span" style="white-space: pre;"> </span>-w 102<span class="Apple-tab-span" style="white-space: pre;"> </span>-command "command7"<span class="Apple-tab-span" style="white-space: pre;"> </span>;</div>
<div>
<br /></div>
<div>
text -label "テストメッセージ";</div>
<div>
separator -height 1 -style "double";</div>
<div>
text -label "テストメッセージ";</div>
<div>
<br /></div>
<div>
========================================</div>
<div>
選択したキーのアトリビュートネームをメモ帳に書き出す</div>
<div>
========================================</div>
<div>
<br /></div>
<div>
//BlShapeのkeyを全て選択してく実行してください。</div>
<div>
{</div>
<div>
string $attName[] = `keyframe -q -name`;</div>
<div>
$size = size($attName);</div>
<div>
<br /></div>
<div>
for($i=0; $i<$size; $i++){</div>
<div>
string $FilePath = "C:/Users/k_moriyama.MEDIAV/Desktop/ぶれんどたーげっとリスト.txt"; //書き込み用テキストの場所指定</div>
<div>
string $blnamea[] = `ls -typ blendShape`;</div>
<div>
string $blnamea2 = $blnamea[0] + "_";</div>
<div>
string $output = substituteAllString($attName[$i], $blnamea2 , "");</div>
<div>
system("echo " + $output + ">> " + $FilePath);</div>
<div>
}</div>
<div>
print ("total = " + $size );</div>
<div>
}</div>
<div>
<br /></div>
<div>
========================================</div>
<div>
改行</div>
<div>
========================================</div>
<div>
<br /></div>
<div>
string\n;// "\n"で改行</div>
<div>
<br /></div>
<div>
string $aaa = $attName[$i] + "\n";</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
例:</div>
<div>
<br /></div>
<div>
//BlShapeのkeyを全て選択してく実行してください。</div>
<div>
{</div>
<div>
string $attName[] = `keyframe -q -name`;</div>
<div>
$size = size($attName);</div>
<div>
<br /></div>
<div>
for($i=0; $i<$size; $i++){</div>
<div>
string $aaa = $attName[$i] + "\n";//MAYA上では"\"はスラッシュを逆のヤツになる。</div>
<div>
print $aaa;</div>
<div>
}</div>
<div>
print ("total = " + $size );</div>
<div>
}</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
========================================</div>
<div>
.txtに書き込むmelSample</div>
<div>
========================================</div>
<div>
<br /></div>
<div>
if(`window -q -exists TsTimeWindow`) deleteUI TsTimeWindow;</div>
<div>
<br /></div>
<div>
window TsTimeWindow;</div>
<div>
columnLayout;</div>
<div>
textFieldButtonGrp -bc "TsTimeCmd" -bl "OK" TsTimeTFG;<span class="Apple-tab-span" style="white-space: pre;"> </span>//文末の"TsTimeTFG"はこのボタンの名称と思われ!</div>
<div>
<br /></div>
<div>
showWindow TsTimeWindow;</div>
<div>
<br /></div>
<div>
global proc TsTimeCmd(){</div>
<div>
string $FilePath = "C:/Users/k_moriyama.MEDIAV/Desktop/test1.txt"; //書き込み用テキストの場所指定</div>
<div>
string $time = `about -ct`;<span class="Apple-tab-span" style="white-space: pre;"> </span>//多分、現在の時刻を取得して、変数に格納してる。</div>
<div>
string $output = `textFieldButtonGrp -q -tx TsTimeTFG`;<span class="Apple-tab-span" style="white-space: pre;"> </span>//"TsTimeTFG"という名前のフィールドの内容を"-q"を使って問い、取得してる。</div>
<div>
<br /></div>
<div>
system("echo " + $time + " " + $output + ">> " + $FilePath);</div>
<div>
//deleteUI TsTimeWindow;</div>
<div>
}</div>
<div>
<br /></div>
<div>
========================================</div>
<div>
ボタン付ウィンドウテンプレ</div>
<div>
========================================</div>
<div>
<br /></div>
<div>
//ウィンドウ、ボタン生成--------------------------------------------</div>
<div>
<br /></div>
<div>
string $windowName = "buttonWin" ;<span class="Apple-tab-span" style="white-space: pre;"> </span>//ウィンドウ名はこの変数で指定してください。</div>
<div>
string $windowTitle = "適当" ;<span class="Apple-tab-span" style="white-space: pre;"> </span>//ウィンドウに表示するタイトルはこの変数で指定してください。</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
if(`window -exists $windowName`)</div>
<div>
deleteUI $windowName;</div>
<div>
<br /></div>
<div>
window -w 100 -h 30 -title $windowTitle $windowName;</div>
<div>
columnLayout;</div>
<div>
button -label "ボタン1"<span class="Apple-tab-span" style="white-space: pre;"> </span>-w 206 -command "command1";</div>
<div>
<br /></div>
<div>
rowLayout -numberOfColumns 4 ;</div>
<div>
button -label "ボタン2"<span class="Apple-tab-span" style="white-space: pre;"> </span>-w 50 -command "command2";</div>
<div>
button -label "ボタン3"<span class="Apple-tab-span" style="white-space: pre;"> </span>-w 50 -command "command3";</div>
<div>
button -label "ボタン4"<span class="Apple-tab-span" style="white-space: pre;"> </span>-w 50 -command "command4";</div>
<div>
button -label "ボタン5"<span class="Apple-tab-span" style="white-space: pre;"> </span>-w 50 -command "command5";</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
setParent ..;</div>
<div>
rowLayout -numberOfColumns 2;</div>
<div>
<br /></div>
<div>
//<span class="Apple-tab-span" style="white-space: pre;"> </span>button -label "ボタン6"<span class="Apple-tab-span" style="white-space: pre;"> </span>-w 102<span class="Apple-tab-span" style="white-space: pre;"> </span>-command "timRangeCTRL" ;</div>
<div>
button -label "ボタン7"<span class="Apple-tab-span" style="white-space: pre;"> </span>-w 102<span class="Apple-tab-span" style="white-space: pre;"> </span>-command "select PRM"<span class="Apple-tab-span" style="white-space: pre;"> </span>;</div>
<div>
button -label "ボタン8"<span class="Apple-tab-span" style="white-space: pre;"> </span>-w 102<span class="Apple-tab-span" style="white-space: pre;"> </span>-command "command6"<span class="Apple-tab-span" style="white-space: pre;"> </span>;</div>
<div>
<br /></div>
<div>
setParent ..;</div>
<div>
<br /></div>
<div>
rowLayout -numberOfColumns 2;</div>
<div>
button -label "ボタン9"<span class="Apple-tab-span" style="white-space: pre;"> </span>-w 206<span class="Apple-tab-span" style="white-space: pre;"> </span>-command "command7"<span class="Apple-tab-span" style="white-space: pre;"> </span>;</div>
<div>
<br /></div>
<div>
setParent ..;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
showWindow $windowName ;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
//ボタンのコマンド生成--------------------------------------------</div>
<div>
<br /></div>
<div>
proc command1()<span class="Apple-tab-span" style="white-space: pre;"> </span>//ボタン1</div>
<div>
{</div>
<div>
playblast -format avi -filename "C:/Users/k_moriyama.MEDIAV/Desktop/test1" -offScreen</div>
<div>
-forceOverwrite -sequenceTime 0 -clearCache 1 -viewer 1 -showOrnaments 0 -fp 0 -percent 100 -compression "none" -quality 100 -widthHeight 1280 720;</div>
<div>
<br /></div>
<div>
}</div>
<div>
<br /></div>
<div>
proc command2()<span class="Apple-tab-span" style="white-space: pre;"> </span>//ボタン2</div>
<div>
{</div>
<div>
print "コマンドを記述してください";</div>
<div>
}</div>
<div>
<br /></div>
<div>
========================================</div>
<div>
選択したオブジェクトのビジビリティをoff</div>
<div>
========================================</div>
<div>
<br /></div>
<div>
string $sentaku[] = ` ls -sl -tr ` ;</div>
<div>
int $kazu = ` size ( $sentaku ) ` ;</div>
<div>
int $x ;</div>
<div>
<br /></div>
<div>
for ( $x = 0 ; $x < $kazu ; $x++ )</div>
<div>
{</div>
<div>
string $listShp[] = `listRelatives -s`;</div>
<div>
string $visib = $listShp[$x] + ".visibility";</div>
<div>
int $joutai = `getAttr $visib`;</div>
<div>
<br /></div>
<div>
if( $joutai == 1 )</div>
<div>
{</div>
<div>
setAttr $visib 0;</div>
<div>
}</div>
<div>
else</div>
<div>
{</div>
<div>
setAttr $visib 1;</div>
<div>
}//elseのブロックエンド</div>
<div>
}//forのブロックエンド</div>
<div>
<br /></div>
<div>
========================================</div>
<div>
エクスプレッションMemo</div>
<div>
========================================</div>
<div>
<br /></div>
<div>
================================================================================</div>
<div>
■「基本的な記述の仕方」のメモ</div>
<div>
================================================================================</div>
<div>
joint1.translateZ = joint2.translateZ * 0.3;//ジョイント1(tz)にジョイント2の"tz*0.3"の値を代入</div>
<div>
<br /></div>
<div>
================================================================================</div>
<div>
■指定フレーム数、遅れて追従するエクスプレッション</div>
<div>
================================================================================</div>
<div>
{</div>
<div>
$ct = `currentTime -q`;<span class="Apple-tab-span" style="white-space: pre;"> </span>//現在のフレーム位置</div>
<div>
int $tm = 15;<span class="Apple-tab-span" style="white-space: pre;"> </span>//遅れるフレーム数</div>
<div>
<br /></div>
<div>
if($ct >= $tm)</div>
<div>
{</div>
<div>
pSphere1.translateX = `getAttr -t ($ct - $tm) pCube1.tx`;</div>
<div>
}</div>
<div>
else</div>
<div>
{</div>
<div>
pSphere1.translateX = `getAttr -t 1 pCube1.tx`;</div>
<div>
}</div>
<div>
}</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
========================================</div>
<div>
シェイプノードをペアレント</div>
<div>
========================================</div>
<div>
parent -shape -r;</div>
<div>
<br /></div>
<div>
※"シェイプノード"→"ペアレント先のトランスフォームノード"を選択して実行しないとエラーになる。</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
========================================</div>
<div>
シェイプノード名取得</div>
<div>
========================================</div>
<div>
listRelatives -s;//選択されたオブジェクトのShapeノード名を取得する</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
========================================</div>
<div>
選択されたオブジェクトのキーフレームの範囲とレンジの範囲を合わせる</div>
<div>
========================================</div>
<div>
selectKey -time ":";</div>
<div>
float $allKeys[] = sort(`keyframe -q -sl`);</div>
<div>
playbackOptions -min $allKeys[0] -max $allKeys[(size($allKeys) -1)];</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
========================================</div>
<div>
シーン全体のアニメーションのキーを一括でオフセットする</div>
<div>
========================================</div>
<div>
<br /></div>
<div>
global proc offsetAllAnimation(int $offsetVal)</div>
<div>
{</div>
<div>
string $animCurve[] = `ls -type animCurveTL -type animCurveTU -type animCurveTA -type animCurveTT`;</div>
<div>
keyframe -edit -r -timeChange $offsetVal $animCurve;</div>
<div>
}</div>
<div>
<br /></div>
<div>
animCurveの種類は、 input がTimeなら animCurveT(L U A T)</div>
<div>
DrivenKeyのように inputがDouble(数値)なら animCurveU(L U A T)</div>
<div>
それぞれ、</div>
<div>
L<span class="Apple-tab-span" style="white-space: pre;"> </span>distance</div>
<div>
A<span class="Apple-tab-span" style="white-space: pre;"> </span>angle</div>
<div>
T<span class="Apple-tab-span" style="white-space: pre;"> </span>time</div>
<div>
U<span class="Apple-tab-span" style="white-space: pre;"> </span>double</div>
<div>
の意味。</div>
<div>
OffsetするのはDrivenKey以外のTimeと接続しているものなので animCurveT系のノードをリストし、</div>
<div>
keyframe に -r(相対移動)のフラグを付ける。</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
========================================</div>
<div>
文字列の置き換えコマンド</div>
<div>
========================================</div>
<div>
substituteっていうコマンドは</div>
<div>
<br /></div>
<div>
substitute A B C;</div>
<div>
<br /></div>
<div>
でBの文字列の中にあるAという文字列をCで置き換えるというコマンドです。</div>
<div>
<br /></div>
<div>
A:"B"内をこの文字列で検索する</div>
<div>
B:置き換え対象の文字列</div>
<div>
C:この文字列に置き換える</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
========================================</div>
<div>
ボタンのサイズをウィンドウにあわせる</div>
<div>
========================================</div>
<div>
例:<span class="Apple-tab-span" style="white-space: pre;"> </span>rowLayout -numberOfColumns 4 -adjustableColumn 1;//横にボタンを並べるレイアウト</div>
<div>
<br /></div>
<div>
レイアウトに「-adjustableColumn 1」フラグをつける。0で多分off。</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
========================================</div>
<div>
実行するたびにon/offを切り替える書き方</div>
<div>
========================================</div>
<div>
setAttr time1.enableTimewarp (!`getAttr time1.enableTimewarp`);</div>
<div>
<br /></div>
<div>
・多分()内で、取得した数値を[!]コマンド?で反転することでon⇔off切り替えを実現している。</div>
<div>
・一行で済むから美しい!</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
========================================</div>
<div>
チェックボックスの状態を取得</div>
<div>
========================================</div>
<div>
string $checkBox1 = `checkBox -label "スケールX"`;//チェックボックスは変数に格納する</div>
<div>
if(`checkBox -q -value $checkBox1`)//チェックボックスの状態[-value]を[-q]で取得してonならif実行</div>
<div>
{</div>
<div>
print "チェックボックスのチェックがonなら実行"</div>
<div>
}</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
========================================</div>
<div>
アトリビュートがノード上に存在を確認(attributeExistsコマンド)</div>
<div>
========================================</div>
<div>
基本:<span class="Apple-tab-span" style="white-space: pre;"> </span>attributeExists("attributeName","nodeName")</div>
<div>
<br /></div>
<div>
例:<span class="Apple-tab-span" style="white-space: pre;"> </span>if (attributeExists("visibility","mySphere")) {</div>
<div>
setAttr mySphere.visibility on;</div>
<div>
}</div>
<div>
<br /></div>
<div>
・指定のノードに指定したアトリビュートが存在するかを確認できます。</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
========================================</div>
<div>
サイズ、位置などを復元しない</div>
<div>
========================================</div>
<div>
windowPref -remove $WindowName<span class="Apple-tab-span" style="white-space: pre;"> </span>このコマンドを実行することで復元をやめさせることができる。</div>
<div>
「showWindow」の前に実行させる。</div>
<div>
<br /></div>
<div>
windowPref -enableAll false ┬このコマンドでウィンドウ生成コマンドを挟む</div>
<div>
windowPref -enableAll true ┘</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
========================================</div>
<div>
ファイルに書き出す</div>
<div>
========================================</div>
<div>
<br /></div>
<div>
$exampleFileName = "C:/Users/k_moriyama.MEDIAV/Desktop/test1.txt";//ファイルパスを変数に格納</div>
<div>
$fileId=`fopen $exampleFileName "w"`;//ファイル識別子を変数に格納</div>
<div>
<br /></div>
<div>
/*</div>
<div>
■識別子の種類↓</div>
<div>
"w" 書き込み用のファイルを開く(ファイルの以前の内容を破棄する)</div>
<div>
"a" 書き込み用にアペンドする(ファイルの最後にアペンドする)</div>
<div>
"r" 読み取り用に開く</div>
<div>
*/</div>
<div>
<br /></div>
<div>
fprint $fileId "書き込みたい文字列(変数指定可)";</div>
<div>
fclose $fileId;//終了する</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-70058109664274645442014-07-01T20:05:00.000+09:002015-01-23T21:50:21.972+09:00メモ_nuke選択したノードの後に指定のノードを作って値も入れる<br />
<br />
sn = nuke.selectedNodes()<br />
for i in sn:<br />
<br />
nuke.nodes.Colorspace(channels = 'all',colorspace_in = 3 ).setInput(0, i)<br />
<br />
print nuke.selectedNode()<br />
スクリプトで指定する項目の文字列が表示される<br />
<br />
sn = nuke.selectedNodes()<br />
for i in sn:<br />
<br />
i.knob('frame_rate').setValue(30)<br />
<br />
<br />
sn = nuke.selectedNodes()<br />
for i in sn:<br />
i.knob('width').setValue(2560)<br />
<br />
i.knob('height').setValue(720)<br />
<br />
sn = nuke.selectedNodes()<br />
for i in sn:<br />
<br />
nuke.nodes.Premult().setInput(0,i)<br />
<br />
snSR = nuke.allNodes('ScanlineRender')<br />
for i in snSR:<br />
<br />
i['samples'].setValue(6)<br />
<br />
<br />
for a in nuke.allNodes():<br />
if a.Class()=='Constant':<br />
a['format'].setValue('2080x1520')<br />
最後の行コロンを付けない...<br />
<br />tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-51096758589626052922014-04-28T18:12:00.000+09:002014-04-28T18:12:24.494+09:00プロジェクト設定<span style="font-size: xx-small;">//プロジェクト設定スクリプト CS6</span><br />
<span style="font-size: xx-small;">//=============================================================================================</span><br />
<span style="font-size: xx-small;">//Pref_SCRIPTING_FILE_NETWORK_SECURITYの値判定</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">function isSecurityPrefSet(){</span><br />
<span style="font-size: xx-small;"> var securitySetting = app.preferences.getPrefAsLong("Main Pref Section", "Pref_SCRIPTING_FILE_NETWORK_SECURITY");</span><br />
<span style="font-size: xx-small;"> return (securitySetting == 1);</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//=============================================================================================</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">if (isSecurityPrefSet() == true){</span><br />
<span style="font-size: xx-small;">/* プロジェクト設定 */</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//=============================================================================================</span><br />
<span style="font-size: xx-small;">/* 時間の表示形式 */</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//タイムコード</span><br />
<span style="font-size: xx-small;">//app.project.timeDisplayType = TimeDisplayType.TIMECODE;</span><br />
<span style="font-size: xx-small;">//alert (app.project.timeDisplayType)</span><br />
<span style="font-size: xx-small;">/* タイムコード指定時フッテージの開始時間</span><br />
<span style="font-size: xx-small;">FTCS_START_0</span><br />
<span style="font-size: xx-small;">FTCS_USE_SOURCE_MEDIA</span><br />
<span style="font-size: xx-small;">*/</span><br />
<span style="font-size: xx-small;">//app.project.footageTimecodeDisplayStartType = FootageTimecodeDisplayStartType.FTCS_USE_SOURCE_MEDIA;</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//フレーム</span><br />
<span style="font-size: xx-small;">app.project.timeDisplayType = TimeDisplayType.FRAMES;</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">/* フレーム指定時にフィート+フレームのオンオフ</span><br />
<span style="font-size: xx-small;">0</span><br />
<span style="font-size: xx-small;">1</span><br />
<span style="font-size: xx-small;">*/</span><br />
<span style="font-size: xx-small;">app.project.framesUseFeetFrames = 0;</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">/* フレーム指定時にフィート+フレームのタイプ指定 </span><br />
<span style="font-size: xx-small;">MM16</span><br />
<span style="font-size: xx-small;">MM35</span><br />
<span style="font-size: xx-small;">*/</span><br />
<span style="font-size: xx-small;">//app.project.feetFramesFilmType = FeetFramesFilmType.MM35;</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">/* プロジェクト設定ダイアログの「フレーム数」の設定</span><br />
<span style="font-size: xx-small;">FC_START_0</span><br />
<span style="font-size: xx-small;">FC_START_1</span><br />
<span style="font-size: xx-small;">FC_TIMECODE_CONVERSION で指定</span><br />
<span style="font-size: xx-small;">*/</span><br />
<span style="font-size: xx-small;">app.project.framesCountType = FramesCountType.FC_START_1;</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//=============================================================================================</span><br />
<span style="font-size: xx-small;">/* カラー設定 */</span><br />
<span style="font-size: xx-small;">/* プロジェクトの色深度</span><br />
<span style="font-size: xx-small;">8</span><br />
<span style="font-size: xx-small;">16</span><br />
<span style="font-size: xx-small;">32</span><br />
<span style="font-size: xx-small;">*/</span><br />
<span style="font-size: xx-small;">app.project.bitsPerChannel = 8;</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">/* ガンマ1.0でカラーをブレンド</span><br />
<span style="font-size: xx-small;">0</span><br />
<span style="font-size: xx-small;">1</span><br />
<span style="font-size: xx-small;">*/</span><br />
<span style="font-size: xx-small;">app.project.linearBlending = 0;</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//=============================================================================================</span><br />
<span style="font-size: xx-small;">/* 環境設定 */</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">/* 読み込み設定_シーケンスフッテージ</span><br />
<span style="font-size: xx-small;">"24.000000"</span><br />
<span style="font-size: xx-small;">"30.000000"</span><br />
<span style="font-size: xx-small;">*/</span><br />
<span style="font-size: xx-small;">app.preferences.savePrefAsString("Import Options Preference Section", "Import Options Default Sequence FPS","24.000000");</span><br />
<span style="font-size: xx-small;">/* 一般設定_ツールヒントを表示</span><br />
<span style="font-size: xx-small;">00</span><br />
<span style="font-size: xx-small;">01</span><br />
<span style="font-size: xx-small;">*/ </span><br />
<span style="font-size: xx-small;">app.preferences.savePrefAsBool("Main Pref Section", "Pref_TOOL_TIPS",01);</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">/* 一般設定_JavaScriptデバッガーを使用</span><br />
<span style="font-size: xx-small;">"0"</span><br />
<span style="font-size: xx-small;">"1"</span><br />
<span style="font-size: xx-small;">*/ </span><br />
<span style="font-size: xx-small;">app.preferences.savePrefAsString("Main Pref Section", "Pref_JAVASCRIPT_DEBUGGER","1");</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">/* ディスプレイ設定_情報パネルとフローチャートにレンダリングの進行状況を表示</span><br />
<span style="font-size: xx-small;">00</span><br />
<span style="font-size: xx-small;">01</span><br />
<span style="font-size: xx-small;">*/ </span><br />
<span style="font-size: xx-small;">app.preferences.savePrefAsBool("Main Pref Section", "Pref_SHOW_INFO_FLOATER_PROGRESS",01);</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//app.preferences.saveToDisk();</span><br />
<span style="font-size: xx-small;">//app.preferences.reload();</span><br />
<span style="font-size: xx-small;">//=============================================================================================</span><br />
<span style="font-size: xx-small;">/* プロジェクト設定 */</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//プロジェクト設定の「時間の表示形式」に相当。タイムコードかフレームかの設定</span><br />
<span style="font-size: xx-small;">var tDisplayType = app.project.timeDisplayType;</span><br />
<span style="font-size: xx-small;">//タイムコード指定時フッテージの開始時間</span><br />
<span style="font-size: xx-small;">var pfTimecodeDsiplayStartType = app.project.footageTimecodeDisplayStartType;</span><br />
<span style="font-size: xx-small;">//-------------------------------------------------------------------------------------------------------------------------------------------------------------------</span><br />
<span style="font-size: xx-small;">//フレーム指定時のフィート+フレームのオン・オフ設定</span><br />
<span style="font-size: xx-small;">var pFramesUseFeetFrames = app.project.framesUseFeetFrames;</span><br />
<span style="font-size: xx-small;">//フレーム指定時のフィート+フレームのタイプの設定</span><br />
<span style="font-size: xx-small;">var pFeetFramesFilmType = app.project.feetFramesFilmType;</span><br />
<span style="font-size: xx-small;">//フレーム指定時の「フレーム数」の設定</span><br />
<span style="font-size: xx-small;">var pFramesCountType = app.project.framesCountType;</span><br />
<span style="font-size: xx-small;">//-------------------------------------------------------------------------------------------------------------------------------------------------------------------</span><br />
<span style="font-size: xx-small;">//プロジェクトの色深度</span><br />
<span style="font-size: xx-small;">var pBitPerChannel = app.project.bitsPerChannel;</span><br />
<span style="font-size: xx-small;">//ガンマ1.0でカラーをブレンド</span><br />
<span style="font-size: xx-small;">var pLinearBlending = app.project.linearBlending;</span><br />
<span style="font-size: xx-small;">//-------------------------------------------------------------------------------------------------------------------------------------------------------------------</span><br />
<span style="font-size: xx-small;">/* 環境設定 */</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//読み込み設定_シーケンスフッテージ</span><br />
<span style="font-size: xx-small;">var pPrefImportFps = app.preferences.getPrefAsString("Import Options Preference Section", "Import Options Default Sequence FPS");</span><br />
<span style="font-size: xx-small;">//一般設定_ツールヒントを表示</span><br />
<span style="font-size: xx-small;">var pPrefToolTips =app.preferences.getPrefAsBool("Main Pref Section", "Pref_TOOL_TIPS");</span><br />
<span style="font-size: xx-small;">//一般設定_JavaScriptデバッガーを使用</span><br />
<span style="font-size: xx-small;">var pPrefJavascriptDebugger = app.preferences.getPrefAsString("Main Pref Section", "Pref_JAVASCRIPT_DEBUGGER");</span><br />
<span style="font-size: xx-small;">//ディスプレイ設定_情報パネルとフローチャートにレンダリングの進行状況を表示</span><br />
<span style="font-size: xx-small;">var pPrefShowInfoProgress = app.preferences.getPrefAsBool("Main Pref Section", "Pref_SHOW_INFO_FLOATER_PROGRESS");</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//-------------------------------------------------------------------------------------------------------------------------------------------------------------------</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">if (tDisplayType == 1812){</span><br />
<span style="font-size: xx-small;"> var tDisplayType = "表示形式>>>タイムコード";</span><br />
<span style="font-size: xx-small;"> if (pfTimecodeDsiplayStartType == 2012){</span><br />
<span style="font-size: xx-small;"> var pfTimecodeDsiplayStartType = "メディアのデータを使用";</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> else if (pfTimecodeDsiplayStartType == 2013){</span><br />
<span style="font-size: xx-small;"> var pfTimecodeDsiplayStartType = "00:00:00:00";</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">else if (tDisplayType == 1813){</span><br />
<span style="font-size: xx-small;"> var tDisplayType = "表示形式>>>フレーム";</span><br />
<span style="font-size: xx-small;"> if (pFramesUseFeetFrames == true){</span><br />
<span style="font-size: xx-small;"> var pFramesUseFeetFrames = "オン";</span><br />
<span style="font-size: xx-small;"> if (pFeetFramesFilmType == 2213){</span><br />
<span style="font-size: xx-small;"> var pFeetFramesFilmType = "35mm";</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> else if (pFeetFramesFilmType == 2212){</span><br />
<span style="font-size: xx-small;"> var pFeetFramesFilmType = "16mm";</span><br />
<span style="font-size: xx-small;"> } </span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> else if (pFramesUseFeetFrames == false){</span><br />
<span style="font-size: xx-small;"> var pFramesUseFeetFrames = "オフ";</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">if (pFramesCountType == 2413){</span><br />
<span style="font-size: xx-small;"> var pFramesCountType = "1から開始"</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">else if (pFramesCountType == 2412){</span><br />
<span style="font-size: xx-small;"> var pFramesCountType = "0から開始"</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">else if (pFramesCountType == 2414){</span><br />
<span style="font-size: xx-small;"> var pFramesCountType = "タイムコード変換"</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">if (tDisplayType == "表示形式>>>タイムコード"){</span><br />
<span style="font-size: xx-small;"> var timeDisplay = tDisplayType +"\n"</span><br />
<span style="font-size: xx-small;"> + "フレーム数"+">>>"+ pfTimecodeDsiplayStartType;</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">else if (tDisplayType = "表示形式>>>フレーム"){</span><br />
<span style="font-size: xx-small;"> if (pFramesUseFeetFrames == "オン"){</span><br />
<span style="font-size: xx-small;"> var timeDisplay = tDisplayType +"\n"</span><br />
<span style="font-size: xx-small;"> + "フィート+フレーム" + ">>>" + pFramesUseFeetFrames +"\n"</span><br />
<span style="font-size: xx-small;"> + "表示形式" + ">>>" + pFeetFramesFilmType + "\n" </span><br />
<span style="font-size: xx-small;"> + "フレーム数"+">>>"+ pFramesCountType;</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> else if (pFramesUseFeetFrames == "オフ"){</span><br />
<span style="font-size: xx-small;"> var timeDisplay = tDisplayType +"\n"</span><br />
<span style="font-size: xx-small;"> + "フィート+フレーム" + ">>>" + pFramesUseFeetFrames +"\n"</span><br />
<span style="font-size: xx-small;"> + "フレーム数"+">>>"+ pFramesCountType;</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> //-------------------------------------------------------------------------------------------------------------------------------------------------------------------</span><br />
<br />
<span style="font-size: xx-small;">if (pBitPerChannel == 8){</span><br />
<span style="font-size: xx-small;"> var pBitPerChannel = "色深度>>>8bit/チャンネル";</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">else if (pBitPerChannel == 16){</span><br />
<span style="font-size: xx-small;"> var pBitPerChannel = "色深度>>>16bit/チャンネル";</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">else if (pBitPerChannel == 32){</span><br />
<span style="font-size: xx-small;"> var pBitPerChannel = "色深度>>>32bit/チャンネル(浮動小数点数)";</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">if (pLinearBlending == true){</span><br />
<span style="font-size: xx-small;"> var pLinearBlending = "ガンマ値1.0でカラーをブレンド>>>オン";</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">else if (pLinearBlending == false){</span><br />
<span style="font-size: xx-small;"> var pLinearBlending = "ガンマ値1.0でカラーをブレンド>>>オフ";</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">var colorSetting = pBitPerChannel + "\n" + pLinearBlending</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//-------------------------------------------------------------------------------------------------------------------------------------------------------------------</span><br />
<span style="font-size: xx-small;">var importFPS = "環境設定>>>読み込み設定>>>"+pPrefImportFps+" FPS";</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">if (pPrefToolTips == true){</span><br />
<span style="font-size: xx-small;"> var toolTips = "環境設定>>>一般設定>>>ツールヒントを表示>>>オン";</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">else if (pPrefToolTips == false){</span><br />
<span style="font-size: xx-small;"> var toolTips = "環境設定>>>一般設定>>>ツールヒントを表示>>>オフ";</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">if (pPrefJavascriptDebugger == "1"){</span><br />
<span style="font-size: xx-small;"> var javascriptDebugger = "環境設定>>>一般設定>>>Javascriptデバッガーを使用>>>オン";</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">else if (pPrefJavascriptDebugger == "0"){</span><br />
<span style="font-size: xx-small;"> var javascriptDebugger = "環境設定>>>一般設定>>>Javascriptデバッガーを使用>>>オフ";</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">if (pPrefShowInfoProgress == true){</span><br />
<span style="font-size: xx-small;"> var showInfoProgress = "環境設定>>>ディスプレイ設定>>>情報パネルに進行状況を表示>>>オン";</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">else if (pPrefShowInfoProgress == false){</span><br />
<span style="font-size: xx-small;"> var showInfoProgress = "環境設定>>>ディスプレイ設定>>>情報パネルに進行状況を表示>>>オフ";</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">alert </span><br />
<span style="font-size: xx-small;">(</span><br />
<span style="font-size: xx-small;">"=============================================================="</span><br />
<span style="font-size: xx-small;">+ "\n" </span><br />
<span style="font-size: xx-small;">+ "プロジェクト設定\n"</span><br />
<span style="font-size: xx-small;">+ "\n"</span><br />
<span style="font-size: xx-small;">+ "++++++時間の表示形式++++++\n"</span><br />
<span style="font-size: xx-small;">+ timeDisplay + "\n"</span><br />
<span style="font-size: xx-small;">+ "\n"</span><br />
<span style="font-size: xx-small;">+ "++++++++カラー設定+++++++++\n"</span><br />
<span style="font-size: xx-small;">+ colorSetting + "\n"</span><br />
<span style="font-size: xx-small;">+ "\n"</span><br />
<span style="font-size: xx-small;">+ "++++++++環境設定++++++++++\n"</span><br />
<span style="font-size: xx-small;">+ "\n" </span><br />
<span style="font-size: xx-small;">+ importFPS</span><br />
<span style="font-size: xx-small;">+ "\n" </span><br />
<span style="font-size: xx-small;">+toolTips</span><br />
<span style="font-size: xx-small;">+ "\n" </span><br />
<span style="font-size: xx-small;">+javascriptDebugger</span><br />
<span style="font-size: xx-small;">+ "\n" </span><br />
<span style="font-size: xx-small;">+showInfoProgress</span><br />
<span style="font-size: xx-small;">+ "\n" </span><br />
<span style="font-size: xx-small;">+"=============================================================="</span><br />
<span style="font-size: xx-small;">)</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">else{</span><br />
<span style="font-size: xx-small;">alert ("環境設定>\n一般設定>\nスクリプトによるファイルへの書き込みとネットワークへのアクセス許可\n↑\nのチェックをオンにしてください、スクリプト実行時に必要な場合があります");</span><br />
<h2>
<span style="font-size: xx-small;">}</span></h2>
tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-63816849293536768062014-04-21T18:49:00.001+09:002014-04-21T18:49:24.085+09:00Launch Pad.jsxを複数起動する方法<div style="color: #333333; font-family: Arial, sans-serif; font-size: 14.666666984558105px; line-height: 26.66666603088379px;">
Launch Pad.jsxを複数起動する方法</div>
<div style="color: #333333; font-family: Arial, sans-serif; font-size: 14.666666984558105px; line-height: 26.66666603088379px; margin-top: 10px;">
<img class="confluence-embedded-image" data-base-url="http://wiki.ilca.local" data-image-src="/download/attachments/7210213/LaunchPad.png?version=2&modificationDate=1398073112174&api=v2" data-linked-resource-container-id="7210213" data-linked-resource-default-alias="LaunchPad.png" data-linked-resource-id="7438666" data-linked-resource-type="attachment" data-location="Launch Pad.jsxを複数起動する > LaunchPad.png" data-mce-src="http://wiki.ilca.local/download/attachments/7210213/LaunchPad.png?version=2&modificationDate=1398073112174&api=v2" src="http://wiki.ilca.local/download/attachments/7210213/LaunchPad.png?version=2&modificationDate=1398073112174&api=v2" style="max-width: 100%;" title="Launch Pad.jsxを複数起動する > LaunchPad.png" /></div>
<div style="color: #333333; font-family: Arial, sans-serif; font-size: 14.666666984558105px; line-height: 26.66666603088379px; margin-top: 10px;">
launchPad_scriptsFoloder<span style="font-size: 14px; line-height: 1.42857142857143;">の部分をすべて置換、</span><span style="font-size: 14px; line-height: 1.42857142857143;">スクリプト本体の名前も同様にリネームします</span></div>
<div style="color: #333333; font-family: Arial, sans-serif; font-size: 14.666666984558105px; line-height: 26.66666603088379px; margin-top: 10px;">
スクリプト本体の置き場所はLaunch Pad.jsxと同じで下記にしておかないとフローティングパネル化しないと思います</div>
<div style="color: #333333; font-family: Arial, sans-serif; font-size: 14.666666984558105px; line-height: 26.66666603088379px; margin-top: 10px;">
<span style="font-size: 14px; line-height: 1.42857142857143;">C:\Program Files\Adobe\Adobe After Effects CS[各バージョン]\Support Files\Scripts\ScriptUI Panels</span></div>
<div style="color: #333333; font-family: Arial, sans-serif; font-size: 14.666666984558105px; line-height: 26.66666603088379px; margin-top: 10px;">
<span style="font-size: 14px; line-height: 1.42857142857143;">初回起動時にLaunch Padに表示するスクリプトの場所を聞かれます</span></div>
tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-335470170378977512014-04-08T16:39:00.002+09:002014-04-08T16:39:48.481+09:00タイムリマップのオンオフcontrol = thisComp.layer("expNull").effect("timeRemapOnOff")("チェックボックス") ;<br />
<br />
if (control == 1){<br />
value;<br />
}else{<br />
time;<br />
}tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-89500557476042392082013-10-11T14:47:00.001+09:002013-10-11T14:47:37.019+09:00$gui handler 改ネットにあったものをローカル環境に合わせた<br />
<br />
set cut_paste_input [stack 0]<br />
version 7.0 v5<br />
push $cut_paste_input<br />
NoOp {<br />
name dollarGuiHandler<br />
selected true<br />
xpos 0<br />
hide_input true<br />
addUserKnob {20 dollarGuiHandler l "\$gui handler"}<br />
addUserKnob {1 list -STARTLINE}<br />
addUserKnob {26 line l "" +STARTLINE}<br />
addUserKnob {22 addAllToList l "add all to list" T "for n in nuke.allNodes():\n n.setSelected(False)\n\nfor n in nuke.allNodes():\n if n.Class() == 'VectorBlur':\n n.setSelected(True)\n elif n.Class() == 'ZDefocus2':\n n.setSelected(True)\n else:\n n.setSelected(False)\n \nlist = nuke.thisNode()\['list'].value()\nprint list\n\nfor i in nuke.selectedNodes():\n if i.name() in list:\n pass\n else:\n list = list + i.name() + '\\n'\nnuke.thisNode()\['list'].setValue(list)\n\nfor n in nuke.allNodes():\n n.setSelected(False)" +STARTLINE}<br />
addUserKnob {22 addToList l "add to list" -STARTLINE T "list = nuke.thisNode()\['list'].value()\nfor i in nuke.selectedNodes():\n if i.name() in list:\n pass\n else:\n list = list + i.name() + '\\n'\nnuke.thisNode()\['list'].setValue(list)"}<br />
addUserKnob {22 clearList l "clear list" -STARTLINE T "nuke.thisNode()\['list'].setValue('')"}<br />
addUserKnob {22 highlightList l "highlight List" -STARTLINE T "for n in nuke.allNodes():\n n.setSelected(False)\nfor n in nuke.allNodes():\n for nn in nuke.thisNode()\['list'].value().split('\\n'):\n if n.name()==nn:\n n.setSelected(True)"}<br />
addUserKnob {22 changeNodeColor l "change node color" -STARTLINE T "for n in nuke.allNodes():\n n.setSelected(False)\nfor n in nuke.allNodes():\n for nn in nuke.thisNode()\['list'].value().split('\\n'):\n if n.name()==nn:\n n.setSelected(True) \nnukescripts.color_nodes()"}<br />
addUserKnob {22 setDollerGui l "set \$gui" T "for n in nuke.allNodes():\n n.setSelected(False)\nfor n in nuke.allNodes():\n for nn in nuke.thisNode()\['list'].value().split('\\n'):\n if n.name()==nn:\n n.setSelected(True)\n nuke.selectedNode()\['disable'].setExpression('\$gui')\n n.setSelected(False)\n else:\n n.setSelected(False)" +STARTLINE}<br />
addUserKnob {22 removeDollerGui l "remove \$gui" -STARTLINE T "for n in nuke.allNodes():\n for nn in nuke.thisNode()\['list'].value().split('\\n'):\n if n.name()==nn:\n n.setSelected(True)\n nuke.selectedNode()\['disable'].clearAnimated() \n nuke.selectedNode()\['disable'].setValue(0)\n n.setSelected(False)\n else:\n n.setSelected(False)"}<br />
}<br />
<div>
<br /></div>
tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-3333399112679834102013-09-11T14:57:00.001+09:002013-09-11T14:57:56.136+09:00メモ_nuke<span style="background-color: white; line-height: 18px;"><span style="color: #333333; font-family: lucida grande, tahoma, verdana, arial, hiragino kaku gothic pro, meiryo, ms pgothic, sans-serif; font-size: x-small;">Guildarts Newsからのコピペ</span></span><br />
<br />
<span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, 'hiragino kaku gothic pro', meiryo, 'ms pgothic', sans-serif; font-size: 13px; line-height: 18px;">[Nuke Tips] 特定のフレーム間でのみノードを無効にしたい場合 ノードのDisableの所にエクスプレッションをこんなかんじinrange(frame, 3, 15)</span><br />
<span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, 'hiragino kaku gothic pro', meiryo, 'ms pgothic', sans-serif; font-size: 13px; line-height: 18px;">にかくとそのフレーム間でのみ無効になり、ノードに黒い線が一本引かれます。</span><br />
<span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, 'hiragino kaku gothic pro', meiryo, 'ms pgothic', sans-serif; font-size: 13px; line-height: 18px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, 'hiragino kaku gothic pro', meiryo, 'ms pgothic', sans-serif; font-size: 13px; line-height: 18px;">[Nuke Tips] よくAEとかPhotoshopと全く同じレイヤーのブレンドモ</span><wbr style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, 'hiragino kaku gothic pro', meiryo, 'ms pgothic', sans-serif; font-size: 13px; line-height: 18px;"></wbr><span class="word_break" style="background-color: white; color: #333333; display: inline-block; font-family: 'lucida grande', tahoma, verdana, arial, 'hiragino kaku gothic pro', meiryo, 'ms pgothic', sans-serif; font-size: 13px; line-height: 18px;"></span><span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, 'hiragino kaku gothic pro', meiryo, 'ms pgothic', sans-serif; font-size: 13px; line-height: 18px;">ードができるかきかれるのですが UpdateからPSDMerge node 使うとできます。</span>tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-28005190459244499222013-07-11T21:15:00.001+09:002013-07-11T21:17:11.824+09:00outRangeHandler<span style="font-size: xx-small;">set cut_paste_input [stack 0]</span><br />
<span style="font-size: xx-small;">version 7.0 v5</span><br />
<span style="font-size: xx-small;">StickyNote {</span><br />
<span style="font-size: xx-small;"> inputs 0</span><br />
<span style="font-size: xx-small;"> name StickyNote1</span><br />
<span style="font-size: xx-small;"> label outRangeHandler</span><br />
<span style="font-size: xx-small;"> note_font "Helvetica Bold Bold Bold Bold Bold Bold Bold Bold Bold"</span><br />
<span style="font-size: xx-small;"> note_font_size 12</span><br />
<span style="font-size: xx-small;"> note_font_color 0xff</span><br />
<span style="font-size: xx-small;"> selected true</span><br />
<span style="font-size: xx-small;"> xpos -29</span><br />
<span style="font-size: xx-small;"> ypos -248</span><br />
<span style="font-size: xx-small;"> addUserKnob {20 User l outRangeHandler}</span><br />
<span style="font-size: xx-small;"> addUserKnob {1 list}</span><br />
<span style="font-size: xx-small;"> addUserKnob {26 line l "" +STARTLINE}</span><br />
<span style="font-size: xx-small;"> addUserKnob {22 addAllToList l "add all to list" T "for n in nuke.allNodes():\n n.setSelected(False)\nfor n in nuke.allNodes('Read'):\n n.setSelected(True)\nlist = nuke.thisNode()\['list'].value()\nfor i in nuke.selectedNodes():\n if i.name() in list:\n pass\n else:\n list = list + i.name() + '\\n'\nnuke.thisNode()\['list'].setValue(list)\nfor n in nuke.allNodes('Read'):\n n.setSelected(False)" +STARTLINE}</span><br />
<span style="font-size: xx-small;"> addUserKnob {22 addToList l "add to list" T "list = nuke.thisNode()\['list'].value()\nfor i in nuke.selectedNodes():\n if i.name() in list:\n pass\n else:\n list = list + i.name() + '\\n'\nnuke.thisNode()\['list'].setValue(list)" +STARTLINE}</span><br />
<span style="font-size: xx-small;"> addUserKnob {22 clearList l "clear list" -STARTLINE T "nuke.thisNode()\['list'].setValue('')"}</span><br />
<span style="font-size: xx-small;"> addUserKnob {22 highlightList l "highlight list" -STARTLINE T "for n in nuke.allNodes():\n if n.name() in nuke.thisNode()\['list'].value():\n n.setSelected(True)\n else:\n n.setSelected(False)"}</span><br />
<span style="font-size: xx-small;"> addUserKnob {22 changeNodeColor l "change node color" -STARTLINE T "for n in nuke.allNodes():\n if n.name() in nuke.thisNode()\['list'].value():\n n.setSelected(True)\n else:\n n.setSelected(False) \nnukescripts.color_nodes()"}</span><br />
<span style="font-size: xx-small;"> addUserKnob {6 beforeIO l before +STARTLINE}</span><br />
<span style="font-size: xx-small;"> addUserKnob {4 choiceBeforeMethod l "" -STARTLINE M {hold loop bounce black "" "" "" ""}}</span><br />
<span style="font-size: xx-small;"> choiceBeforeMethod black</span><br />
<span style="font-size: xx-small;"> addUserKnob {6 afterIO l after -STARTLINE}</span><br />
<span style="font-size: xx-small;"> addUserKnob {4 choiceAfterMethod l "" -STARTLINE M {hold loop bounce black ""}}</span><br />
<span style="font-size: xx-small;"> choiceAfterMethod black</span><br />
<span style="font-size: xx-small;"> addUserKnob {22 setOutRangeType l "set out range type" -STARTLINE T "befIO = nuke.thisNode()\['beforeIO'].value()\nprint befIO\n\nif befIO == True:\n\tbeforeMeth = nuke.thisNode()\['choiceBeforeMethod'].value()\n\tif beforeMeth == \"hold\":\n\t\tbeforeMeth = 0\n\t\tprint beforeMeth\n\t\tfor n in nuke.allNodes():\n \t\t\tif n.name() in nuke.thisNode()\['list'].value():\n \t\t\tn\['before'].setValue(beforeMeth)\n\telif beforeMeth == \"loop\":\n\t\tbeforeMeth = 1\n\t\tprint beforeMeth\n\t\tfor n in nuke.allNodes():\n \t\t\tif n.name() in nuke.thisNode()\['list'].value():\n \t\t\tn\['before'].setValue(beforeMeth)\n\telif beforeMeth == \"bounce\":\n\t\tbeforeMeth = 2\n\t\tprint beforeMeth\n\t\tfor n in nuke.allNodes():\n \t\t\tif n.name() in nuke.thisNode()\['list'].value():\n \t\t\tn\['before'].setValue(beforeMeth)\n\telif beforeMeth == \"black\":\n\t\tbeforeMeth = 3\n\t\tprint beforeMeth\n\t\tfor n in nuke.allNodes():\n \t\t\tif n.name() in nuke.thisNode()\['list'].value():\n \t\t\tn\['before'].setValue(beforeMeth)\n\nafIO = nuke.thisNode()\['afterIO'].value()\nprint afIO\n\nif afIO == True:\n\tafterMeth = nuke.thisNode()\['choiceAfterMethod'].value()\n\tif afterMeth == \"hold\":\n\t\tafterMeth = 0\n\t\tprint afterMeth\n\t\tfor n in nuke.allNodes():\n \t\t\tif n.name() in nuke.thisNode()\['list'].value():\n \t\t\tn\['after'].setValue(afterMeth)\n\telif afterMeth == \"loop\":\n\t\tafterMeth = 1\n\t\tprint afterMeth\n\t\tfor n in nuke.allNodes():\n \t\t\tif n.name() in nuke.thisNode()\['list'].value():\n \t\t\tn\['after'].setValue(afterMeth)\n\telif afterMeth == \"bounce\":\n\t\tafterMeth = 2\n\t\tprint afterMeth\n\t\tfor n in nuke.allNodes():\n \t\t\tif n.name() in nuke.thisNode()\['list'].value():\n \t\t\tn\['after'].setValue(afterMeth)\n\telif afterMeth == \"black\":\n\t\tafterMeth = 3\n\t\tprint afterMeth\n\t\tfor n in nuke.allNodes():\n \t\t\tif n.name() in nuke.thisNode()\['list'].value():\n \t\t\tn\['after'].setValue(afterMeth)"}</span><br />
<span style="font-size: xx-small;"> addUserKnob {41 bookmark_1 l bookmark T StickyNote1.bookmark}</span><br />
<span style="font-size: xx-small;">}</span><br />
<div>
<br /></div>
tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-61842641561546614212013-07-09T12:11:00.001+09:002013-07-09T12:32:01.103+09:00メモ_配列の場合の表記<span style="font-size: xx-small;">for b in nuke.allNodes('Transform'):</span><br />
<span style="font-size: xx-small;"> b.knob('center').setValue((640,512))</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">for b in nuke.allNodes('Crop'):</span><br />
<span style="font-size: xx-small;"> b.knob('box').setValue((((0,-10,1280,1034))))</span><span style="font-size: xx-small;"></span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">sn = nuke.selectedNodes()</span><br />
<span style="font-size: xx-small;">for n in sn:</span><br />
<br />
<span style="font-size: xx-small;"> n.knob('box').setValue((((0,0,1280,1024))))</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">- pass the value argument as a tuple: </span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">nuke.toNode("Transform1").knob("center").setValue((0, 1080)) </span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">- or set the value for each index separately </span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">nuke.toNode("Transform1").knob("center").setValue(0,0) </span><br />
<span style="font-size: xx-small;">nuke.toNode("Transform1").knob("center").setValue(1080,1) </span><br />
<br />
<br />tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-43094663889110986982013-07-04T13:56:00.002+09:002013-07-04T13:56:30.032+09:00開いてるファイル セキュリティの警告の消し方<div style="background-color: white; border: 0px; color: #333333; font-family: Georgia, 'Bitstream Charter', serif; line-height: 24px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
<span style="font-size: xx-small;">[開いてるファイル - セキュリティの警告]<br />[発行元:不明な発行元]<br />[種類:ショートカット]</span></div>
<div style="background-color: white; border: 0px; color: #333333; font-family: Georgia, 'Bitstream Charter', serif; line-height: 24px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
<a href="http://ebiken.me/tech/wp-content/uploads/2012/08/Windows7-Shortcut.png" style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #ff4b33; margin: 0px; padding: 0px; vertical-align: baseline;"><span style="font-size: xx-small;"><img alt="Windows7-Shortcut" class="alignnone size-medium wp-image-31" height="171" src="http://ebiken.me/tech/wp-content/uploads/2012/08/Windows7-Shortcut-300x171.png" style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: none; height: auto; margin: 0px; max-width: 100%; padding: 0px; vertical-align: baseline;" title="Windows7-Shortcut" width="300" /></span></a></div>
<div style="background-color: white; border: 0px; color: #333333; font-family: Georgia, 'Bitstream Charter', serif; line-height: 24px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
<span style="font-size: xx-small;">これを表示させない方法がこちら。</span></div>
<div style="background-color: white; border: 0px; color: #333333; font-family: Georgia, 'Bitstream Charter', serif; line-height: 24px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
<span style="font-size: xx-small;">1. [ローカルグループポリシーエディター]を起動:gpedit.msc<br />2. [ユーザーの構成] [管理用テンプレート] [Windowsコンポーネント] [添付ファイルマネージャー]<br />[危険度の低いファイルの種類の一覧] を開く</span></div>
<div style="background-color: white; border: 0px; color: #333333; font-family: Georgia, 'Bitstream Charter', serif; line-height: 24px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
<a href="http://ebiken.me/tech/wp-content/uploads/2012/08/Dangerfiles-01.png" style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #743399; margin: 0px; padding: 0px; vertical-align: baseline;"><span style="font-size: xx-small;"><img alt="Dangerfiles-01" class="alignnone size-medium wp-image-29" height="139" src="http://ebiken.me/tech/wp-content/uploads/2012/08/Dangerfiles-01-300x139.png" style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: none; height: auto; margin: 0px; max-width: 100%; padding: 0px; vertical-align: baseline;" title="Dangerfiles-01" width="300" /></span></a></div>
<div style="background-color: white; border: 0px; color: #333333; font-family: Georgia, 'Bitstream Charter', serif; line-height: 24px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
<span style="font-size: xx-small;">3. [有効] にして .exe 拡張子を追加</span></div>
<div style="background-color: white; border: 0px; color: #333333; font-family: Georgia, 'Bitstream Charter', serif; line-height: 24px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
<a href="http://ebiken.me/tech/wp-content/uploads/2012/08/Dangerfiles-02.png" style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #743399; margin: 0px; padding: 0px; vertical-align: baseline;"><span style="font-size: xx-small;"><img alt="Dangerfiles-02" class="alignnone size-medium wp-image-30" height="275" src="http://ebiken.me/tech/wp-content/uploads/2012/08/Dangerfiles-02-300x275.png" style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: none; height: auto; margin: 0px; max-width: 100%; padding: 0px; vertical-align: baseline;" title="Dangerfiles-02" width="300" /></span></a></div>
<div style="background-color: white; border: 0px; color: #333333; font-family: Georgia, 'Bitstream Charter', serif; line-height: 24px; margin-bottom: 24px; padding: 0px; vertical-align: baseline;">
<span style="font-size: xx-small;">これでいちいちメッセージに応答することなくアプリを起動できる。</span></div>
tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-67464578610810296322013-07-04T13:52:00.000+09:002013-07-04T13:52:40.322+09:00メモ_番号歯抜けでも連番ファイルを順に読み込む<span style="color: #333333; font-family: MS PGothic, Hiragino Kaku Gothic Pro W3, Osaka, sans-serif; font-size: x-small;"><span style="line-height: 15px;">importFile()を使ってimportOptions.forceAlphabetical を true にすると番号歯抜けでも順に読み込める</span></span>tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-65035302822644852572013-06-27T20:40:00.001+09:002013-06-27T20:40:06.583+09:00フッテージのドライブレター変更var numItems = app.project.numItems;<br />
<br />
for(i = 1; i <= numItems; i++) {<br />
if(app.project.item(i).typeName == "フッテージ") {<br />
if( !app.project.item(i) ) continue;<br />
var cItem = app.project.item(i).file;<br />
if( !cItem ) continue;<br />
var cItemPath = cItem.path;<br />
var cItemName = cItem.name;<br />
//拡張子<br />
var fooPattern = /(.+)(\.[^.]+$)/;<br />
var tExt = cItemName.match(fooPattern)[2];<br />
var cItemExt = tExt;<br />
//alert (cItemExt);<br />
//alert (cItemName);<br />
var psdExt = "psd"<br />
var cItemFullPath = cItemPath + "/" + cItemName;<br />
// 置換処理++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br />
var rFilePath = cItemPath.replace(/y/, "x");<br />
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br />
var rFileFullPath = rFilePath + "/" + cItemName;<br />
//alert (rFileFullPath)<br />
var cItemMainSource = app.project.item(i).mainSource;<br />
var cFrameRate = cItemMainSource.conformFrameRate;<br />
var dFrameRate = cItemMainSource.displayFrameRate;<br />
var nFrameRate = cItemMainSource.nativeFrameRate;<br />
//alert (cFrameRate +"_"+ dFrameRate +"_"+ nFrameRate);<br />
if( cItemMainSource.isStill == true ) {<br />
if ( cItemExt == ".psd" ){<br />
//alert ("psdファイルはスキップします")<br />
}<br />
else if ( cItemExt == ".PSD" ){<br />
//alert ("PSDファイルはスキップします") <br />
}<br />
else{<br />
var cFootageImageName = (rFileFullPath);<br />
var cFootageImageName = decodeURI(cFootageImageName);<br />
//alert (cFrameRate +"_"+ dFrameRate +"_"+ nFrameRate);<br />
//alert (cFootageImageName , "イメージ")<br />
app.project.item(i).replace(new File(cFootageImageName));<br />
}<br />
}<br />
else{<br />
if( cFrameRate == 0 ){<br />
var cFootageMsName = (rFileFullPath);<br />
var cFootageMsName = decodeURI(cFootageMsName);<br />
//alert (cFrameRate +"_"+ dFrameRate +"_"+ nFrameRate);<br />
//alert (cFootageMsName , "ムービかサウンド")<br />
app.project.item(i).replace(new File(cFootageMsName));<br />
}<br />
else{<br />
var cFootageSeqName = (rFileFullPath);<br />
var cFootageSeqName = decodeURI(cFootageSeqName);<br />
//alert (cFrameRate +"_"+ dFrameRate +"_"+ nFrameRate);<br />
//alert (cFootageSeqName , "連番イメージ")<br />
try{<br />
app.project.item(i).replaceWithSequence(new File(cFootageSeqName),false);<br />
} catch(err) {<br />
var msg = cFootageSeqName + "はファイルが無いようです";<br />
alert(msg);<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
<br />
alert ("ドライブレターの変更終了")tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-30136880144132942232013-06-24T17:01:00.002+09:002013-06-24T17:01:36.525+09:00フッテージをローカルにコピー<span style="font-size: xx-small;">//今日の日時示</span><br />
<span style="font-size: xx-small;">var now = new Date();</span><br />
<span style="font-size: xx-small;">var year = now.getYear(); // 年</span><br />
<span style="font-size: xx-small;">var month = now.getMonth() + 1; // 月</span><br />
<span style="font-size: xx-small;">var day = now.getDate(); // 日</span><br />
<span style="font-size: xx-small;">var hour = now.getHours(); // 時</span><br />
<span style="font-size: xx-small;">var min = now.getMinutes(); // 分</span><br />
<span style="font-size: xx-small;">var sec = now.getSeconds(); // 秒</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">if(year < 2000) { year += 1900; }</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">// 数値が1桁の場合、頭に0を付けて2桁で表示する指定</span><br />
<span style="font-size: xx-small;">if(month < 10) { month = "0" + month; }</span><br />
<span style="font-size: xx-small;">if(day < 10) { day = "0" + day; }</span><br />
<span style="font-size: xx-small;">if(hour < 10) { hour = "0" + hour; }</span><br />
<span style="font-size: xx-small;">if(min < 10) { min = "0" + min; }</span><br />
<span style="font-size: xx-small;">if(sec < 10) { sec = "0" + sec; }</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">var batRcopyDir = "c:\\aeBat\\rcopy\\";</span><br />
<span style="font-size: xx-small;">var dateDir = year +"_"+ month + "_" + day;</span><br />
<span style="font-size: xx-small;">var curTime = hour + "_" + min;</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">Folder(batRcopyDir + dateDir).create();</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//rcopyのオプションとbatの変数</span><br />
<span style="font-size: xx-small;">var copyOpt = '/S /TS /TEE /ETA /R:0 /XD old tmp temp *ログ /XF log.txt Thumbs.db /XO /NP /LOG+:C:%homepath%\\roboCopyLog\\%yy%%mm%%dd%\\log"_%tt%_%ff%_%bb%".txt';</span><br />
<span style="font-size: xx-small;">var batTitle = "@title rcopyToX" </span><br />
<span style="font-size: xx-small;">var batPause = "@pause"</span><br />
<span style="font-size: xx-small;">var batYyyy = "@set yyyy=%date:~0,4%"</span><br />
<span style="font-size: xx-small;">var batYy = "@set yy=%date:~2,2%"</span><br />
<span style="font-size: xx-small;">var batMm = "@set mm=%date:~5,2%"</span><br />
<span style="font-size: xx-small;">var batDd = "@set dd=%date:~8,2%"</span><br />
<span style="font-size: xx-small;">var batTt = "@set tt=%time:~0,2%"</span><br />
<span style="font-size: xx-small;">var batFf = "@set ff=%time:~3,2%"</span><br />
<span style="font-size: xx-small;">var batBb = "@set bb=%time:~6,2%"</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">var batRcopyLogDir = '@mkdir C:%homepath%\\roboCopyLog\\%yy%%mm%%dd%'</span><br />
<span style="font-size: xx-small;">//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</span><br />
<span style="font-size: xx-small;">var aepFullFileName = app.project.file.name;</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</span><br />
<span style="font-size: xx-small;">var batRcopyEnv = batTitle +" "+aepFullFileName +"_"+ "Footages" + "\n" + batPause + "\n" + batYyyy + "\n" + batYy + "\n" + batMm + "\n" + batDd + "\n" + batTt + "\n" + batFf + "\n" + batBb + "\n" + batRcopyLogDir;</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">alert (copyOpt);</span><br />
<span style="font-size: xx-small;">alert (batRcopyEnv);</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">var rcopy = "robocopy";</span><br />
<span style="font-size: xx-small;">var randnum = Math.floor( Math.random() * 100000 );</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">var aepFileName = aepFullFileName.replace(aepExtension,"")</span><br />
<span style="font-size: xx-small;">var batRcopyFile = new File( batRcopyDir + dateDir + "\\"+ "rcopy" +"_" + aepFileName +"_" + curTime +"_"+ randnum + ".bat");</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">batRcopyFile.open("w");</span><br />
<span style="font-size: xx-small;">batRcopyFile.writeln(batRcopyEnv)</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">// 置換対象文字列</span><br />
<span style="font-size: xx-small;">var numItems = app.project.numItems;</span><br />
<span style="font-size: xx-small;">//myArray = new Array(numItems);</span><br />
<span style="font-size: xx-small;">for(i = 1; i <= numItems; i++) {</span><br />
<span style="font-size: xx-small;"> if(app.project.item(i).typeName == "フッテージ") {</span><br />
<span style="font-size: xx-small;"> if( !app.project.item(i) ) continue;</span><br />
<span style="font-size: xx-small;"> var cItem = app.project.item(i).file;</span><br />
<span style="font-size: xx-small;"> if( !cItem ) continue;</span><br />
<span style="font-size: xx-small;"> //alert (cItem);</span><br />
<span style="font-size: xx-small;"> var cItemPath = cItem.path;</span><br />
<span style="font-size: xx-small;"> var cItemName = cItem.name;</span><br />
<span style="font-size: xx-small;"> var cItemStr = String (cItem);</span><br />
<span style="font-size: xx-small;"> var cItemPathStr = String (cItemPath);</span><br />
<span style="font-size: xx-small;"> var cItemNameStr = String (cItemName);</span><br />
<span style="font-size: xx-small;"> // 置換処理</span><br />
<span style="font-size: xx-small;"> var cItemPathStr = cItemPathStr.replace(/\/y\//g, "y:\\");</span><br />
<span style="font-size: xx-small;"> var cItemPathStr = cItemPathStr.replace(/\//g, "\\");</span><br />
<span style="font-size: xx-small;"> var dFilePathStr = cItemPathStr.replace(/y:\\/g, "x:\\");</span><br />
<span style="font-size: xx-small;"> //alert (cItemPathStr);</span><br />
<span style="font-size: xx-small;"> //alert (dFilePathStr);</span><br />
<span style="font-size: xx-small;"> var copyFootage = (rcopy +" "+ cItemPathStr +" "+ dFilePathStr +" "+ copyOpt)</span><br />
<span style="font-size: xx-small;"> batRcopyFile.writeln(copyFootage)</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;">batRcopyFile.writeln(batPause)</span><br />
<span style="font-size: xx-small;">batRcopyFile.close();</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">batRcopyFile.execute();</span><br />
<div>
<br /></div>
tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0tag:blogger.com,1999:blog-3124103455984370589.post-48547312326237879452013-06-14T16:22:00.001+09:002013-06-14T16:22:30.862+09:00GUIからaerender<span style="font-size: xx-small;">//今日の日時示</span><br />
<span style="font-size: xx-small;">var now = new Date();</span><br />
<span style="font-size: xx-small;">var year = now.getYear(); // 年</span><br />
<span style="font-size: xx-small;">var month = now.getMonth() + 1; // 月</span><br />
<span style="font-size: xx-small;">var day = now.getDate(); // 日</span><br />
<span style="font-size: xx-small;">var hour = now.getHours(); // 時</span><br />
<span style="font-size: xx-small;">var min = now.getMinutes(); // 分</span><br />
<span style="font-size: xx-small;">var sec = now.getSeconds(); // 秒</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">if(year < 2000) { year += 1900; }</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">// 数値が1桁の場合、頭に0を付けて2桁で表示する指定</span><br />
<span style="font-size: xx-small;">if(month < 10) { month = "0" + month; }</span><br />
<span style="font-size: xx-small;">if(day < 10) { day = "0" + day; }</span><br />
<span style="font-size: xx-small;">if(hour < 10) { hour = "0" + hour; }</span><br />
<span style="font-size: xx-small;">if(min < 10) { min = "0" + min; }</span><br />
<span style="font-size: xx-small;">if(sec < 10) { sec = "0" + sec; }</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</span><br />
<span style="font-size: xx-small;">var curTime = hour + "_" + min;</span><br />
<span style="font-size: xx-small;">var batDir = "c:\\aeRenderBat\\";</span><br />
<span style="font-size: xx-small;">var dateDir = year +"_"+ month + "_" + day;</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">Folder( batDir + dateDir ).create();</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//var aeVersion = app.version;</span><br />
<span style="font-size: xx-small;">//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">str = app.buildName</span><br />
<span style="font-size: xx-small;">nStr = str.substring(0,4)</span><br />
<span style="font-size: xx-small;">//alert (nStr)</span><br />
<span style="font-size: xx-small;">if (nStr == 10.0) {</span><br />
<span style="font-size: xx-small;"> nStr = "CS5"</span><br />
<span style="font-size: xx-small;"> alert(nStr) </span><br />
<span style="font-size: xx-small;"> }else if (nStr == 10.5){</span><br />
<span style="font-size: xx-small;"> nStr = "CS5.5"</span><br />
<span style="font-size: xx-small;"> alert(nStr)</span><br />
<span style="font-size: xx-small;"> }else if (nStr == 11.0){</span><br />
<span style="font-size: xx-small;"> nStr = "CS6"</span><br />
<span style="font-size: xx-small;"> alert(nStr) </span><br />
<span style="font-size: xx-small;"> }else{</span><br />
<span style="font-size: xx-small;"> alert (バージョンを確認してください)</span><br />
<span style="font-size: xx-small;"> }</span><br />
<span style="font-size: xx-small;"> </span><br />
<span style="font-size: xx-small;">var randnum = Math.floor( Math.random() * 100000 );</span><br />
<span style="font-size: xx-small;">var aeRender = '"C:\\Program Files\\Adobe\\Adobe After Effects '+ nStr +'\\Support Files\\aerender.exe"';</span><br />
<span style="font-size: xx-small;">var projectFile = app.project.file.absoluteURI;</span><br />
<span style="font-size: xx-small;">var aepExtension = ".aep"</span><br />
<span style="font-size: xx-small;">var aepFullFileName = app.project.file.name;</span><br />
<span style="font-size: xx-small;">var aepFileName = aepFullFileName.replace(aepExtension,"")</span><br />
<span style="font-size: xx-small;">var proj = "-project";</span><br />
<span style="font-size: xx-small;">var batFile = new File( batDir + dateDir + "\\"+ "aerender" +"_" + aepFileName +"_" + curTime +"_"+ randnum + ".bat");</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">//alert (aeRender+ proj + projectFile);</span><br />
<span style="font-size: xx-small;">//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</span><br />
<span style="font-size: xx-small;">batFile.open("w");</span><br />
<span style="font-size: xx-small;">batFile.writeln('title' + " " + 'AfterEffects' + " " + nStr + " " + 'rendering' + " " + aepFullFileName)</span><br />
<span style="font-size: xx-small;">batFile.writeln( aeRender + " " + '-mem_usage 10 20' + " " + proj + " " + projectFile)</span><br />
<span style="font-size: xx-small;">batFile.close();</span><br />
<span style="font-size: xx-small;"><br /></span>
<span style="font-size: xx-small;">batFile.execute();</span><br />
<span style="font-size: xx-small;">//</span>tmaeda5http://www.blogger.com/profile/08307695744264845666noreply@blogger.com0