top of page

AZSTOKE/ALGAZODIK

GameAudio & Art

Track

2

Delete Mute and Unused Tracks Starting with Selected Tracks

RANK

SNS SHARE

AZSTOKE_AllDeleteTopSelectTrackSearchNotUseMediaAndTrack

import sys

sys.path.append(RPR_GetResourcePath() + r"\UserPlugins")

from AZSTOKE_BRONZE_python import *


import sys

sys.path.append(RPR_GetResourcePath() + r"\UserPlugins")

from AZSTOKE_SILVER_python import *


def Msg(parm):

    RPR_ShowConsoleMsg(str(parm) + "\n")



retval,_,_,allCount,_ = AZ_GetMediaTypeCount(0,"",0,0)


for i in reversed(range(allCount)):

    _,_,_,mute = AZ_GetMediaMute(0,i,0)

   

    if mute:

        AZ_DeleteMedia(0,i)          



_,depthList = AZ_GetTrackDepthList(0)

_,_,_,count = AZ_GetTrackCountSelect(0,0,0)

_,_,trackID = AZ_GetSelectedTrackFirstInfo(0,0)


for a in range(2):

    for i in reversed(range(count)):

        _,_,_,_,allCount,_ = AZ_GetTrackMediaTypeCount(0,i,"",0,0)

        retval,trackList,trackCount = AZ_GetTrackIdChildList(0,i)

        if allCount == 0 and trackCount == 0 :

            AZ_DeleteTrackIdSelect(0,i,0)

            

    _,_,_,count = AZ_GetTrackCountSelect(0,0,0)

    for i in range(count):

        track = AZ_GetTrackItemSelect(0,i,0)

        for e, value in enumerate(depthList, 0):

            if track == depthList[e]["Track"]:

                AZ_SetTrackItemDepth(track,depthList[e]["Depth"])

import sys

sys.path.append(RPR_GetResourcePath() + r"\UserPlugins")

from AZSTOKE_BRONZE_python import *


・Enable BronzeAPI


import sys

sys.path.append(RPR_GetResourcePath() + r"\UserPlugins")

from AZSTOKE_SILVER_python import *


・Enable use of SilverAPI


def Msg(parm):

RPR_ShowConsoleMsg(str(parm) + "\n")


・Msg function is provided to enable console output


retval,_,_,allCount,_ = AZ_GetMediaTypeCount(0,"",0,0)


-Get the total number of media and assign it to allCount


for i in reversed(range(allCount)):


・Reverse allCount For loop


_,_,_,mute = AZ_GetMediaMute(0,i,0)


- Check the mute status for each media

if mute:


- Check if you are muted


AZ_DeleteMedia(0,i)


- Delete muted media



_,depthList = AZ_GetTrackDepthList(0)


-Get the track hierarchy and assign it to the array depthList


_,_,_,count = AZ_GetTrackCountSelect(0,0,0)


-Get the total number of tracks and assign it to count


_,_,trackID = AZ_GetSelectedTrackFirstInfo(0,0)


- Get the track ID of the first track of the selected tracks and assign it to trackID


for a in range(2):


・Execute the following process twice


for i in reversed(range(count)):

・Loop the count in reverse


_,_,_,_,allCount,_ = AZ_GetTrackMediaTypeCount(0,i,"",0,0)


- Output the number of media in the specified track and assign it to allCount


retval,trackList,trackCount = AZ_GetTrackIdChildList(0,i)


- Get the child tracks of the specified track ID, output the array to trackList, and assign the number to trackCount.


if allCount == 0 and trackCount == 0 :


- Tracks with no media and no child tracks are detected


AZ_DeleteTrackIdSelect(0,i,0)


- Delete track

_,_,_,count = AZ_GetTrackCountSelect(0,0,0)


After deleting, output the number of tracks again and assign it to count


for i in range(count):


・Loop count


track = AZ_GetTrackItemSelect(0,i,0)


- Get the track with the specified ID and assign it to track


for e, value in enumerate(depthList, 0):


・Loop For for depthList


if track == depthList[e]["Track"]:


・Detects when the track in depthList is the same as the track


AZ_SetTrackItemDepth(track,depthList[e]["Depth"])


- Same items are returned to the previous level

APIの利用にはBRONZEに

加入し専用APIを

ダウンロード

する必要があります。

  • Select the first track

  • There is a track with no media in it

  • Muted media

- Script Code -
- Script Image -
- Warm Up -
- Script Detail -
- API -

PYTHON

​ReaScript File Download 👇

​※実行するには専用APIが必要です

- Script Image -
bottom of page