top of page
- Script Code -

dofile(reaper.AZ_GetLuaInitPath())

require("reaper_AZSTOKE_SILVER")

require("reaper_AZSTOKE_GOLD") 


p4URL = "********"

p4UserName = "********"

p4Password = "********"

p4Workspace = "********"


function GetP4Files(depotPath, excelPath, sheetName)

    

    filePathList = {}


    if reaper.AZ_P4_Connect(p4URL, p4UserName, p4Password)then

         

         filePathList = reaper.AZ_P4_SyncFiles(p4Workspace, depotPath, -1, "wav")

         

         reaper.AZ_P4_Disconnect()

    end

        

    excelDoc = reaper.AZ_Excel_OpenFile(excelPath)

    

    worksheet = reaper.AZ_Excel_AddWorksheet(excelDoc, sheetName)

 

    row = 1


    reaper.AZ_Excel_SetCellValue_ByNumber(worksheet, row, 1, "Name")

        

    reaper.AZ_Excel_SetCellValue_ByNumber(worksheet, row, 2, "Local Path") 


        

    for i, filePath in pairs(filePathList) do


         row = row + 1


         fileName = reaper.AZ_GetPathInfo(filePath)["FileNameWithoutExtension"]

        

         reaper.AZ_Excel_SetCellValue_ByNumber(worksheet, row, 1, fileName)

        

         reaper.AZ_Excel_SetCellValue_ByNumber(worksheet, row, 2, filePath) 

                

    end


    reaper.AZ_Excel_SaveDocument(excelDoc)

    

    reaper.AZ_Excel_CloseFile(excelDoc)


end


function main()


    retval, inputList = reaper.AZ_GetUserInputList("", 2, "DeptPath,ExcelPath", "")

    

    if retval == false then return end

    

    deptPath = inputList[1]

    excelPath = inputList[2]

    

    sheetName = "voices_" ..os.date("%Y%m%d_%H%M%S", ts)

    

    GetP4Files(deptPath, excelPath, sheetName)

    

end


main()

- Warm Up -

  • Excelファイルを用意する

  • 音声ファイルを用意する

- Script Detail -

dofile(reaper.AZ_GetLuaInitPath())

require("reaper_AZSTOKE_SILVER")

require("reaper_AZSTOKE_GOLD") 


・RIGDOCKSをインポート


p4URL = "ssl:localhost:1666"

p4UserName = "super"

p4Password = "perforce-perforce"

p4Workspace = "SooundWork"


・Perforce接続情報を設定


function GetP4Files(depotPath, excelPath, sheetName)

    

・P4からファイルを取得してExcelに書き出す関数を定義


    filePathList = {}


・ファイルパスリストの初期化


    if reaper.AZ_P4_Connect(p4URL, p4UserName, p4Password)then


・Perforceに接続

         

         filePathList = reaper.AZ_P4_SyncFiles(p4Workspace, depotPath, -1, "wav")

         

・WAVファイルを同期


         reaper.AZ_P4_Disconnect()


・Perforceから切断

    end

        

    excelDoc = reaper.AZ_Excel_OpenFile(excelPath)


・Excelファイルを開く   


    worksheet = reaper.AZ_Excel_AddWorksheet(excelDoc, sheetName)

 

 ・新しいワークシートを追加


    row = 1


    reaper.AZ_Excel_SetCellValue_ByNumber(worksheet, row, 1, "Name")

        

    reaper.AZ_Excel_SetCellValue_ByNumber(worksheet, row, 2, "Local Path") 


・ヘッダー行を設定

        

    for i, filePath in pairs(filePathList) do


・ファイルパスリストをループ


         row = row + 1


         fileName = reaper.AZ_GetPathInfo(filePath)["FileNameWithoutExtension"]

        

・拡張子なしのファイル名を取得


         reaper.AZ_Excel_SetCellValue_ByNumber(worksheet, row, 1, fileName)

 

 

 ・ファイル名をExcelに記載


         reaper.AZ_Excel_SetCellValue_ByNumber(worksheet, row, 2, filePath) 


・ローカルパスをExcelに記載

                

    end


    reaper.AZ_Excel_SaveDocument(excelDoc)


・Excelファイルを保存

    

    reaper.AZ_Excel_CloseFile(excelDoc)


・Excelファイルを閉じる


end


function main()


・メイン関数を定義


    retval, inputList = reaper.AZ_GetUserInputList("", 2, "DeptPath,ExcelPath", "")

    

    if retval == false then return end

    

    deptPath = inputList[1]

    excelPath = inputList[2]

    

・ユーザー入力を取得


    sheetName = "voices_" ..os.date("%Y%m%d_%H%M%S", ts)


・シート名を生成

    

    GetP4Files(deptPath, excelPath, sheetName)


・P4からファイルを取得してExcelに書き出す関数を実行

    

end


main()


・メイン関数を実行

- API LINK -

Excel

AZSTOKE_Excel_GetP4Files

Perforceで管理された音声ファイルをExcelに記録し、Wwise上に実装されているか確認①

01_BRONZE_ss_edited.png
01_SILVER_edited_edited.png
03_GOLD_edited_edited.png
bottom of page