top of page

Track

5

Automatically create multiple sets of tracks

RANK

AZSTOKE_TrackSetSameAutoSetter

import sys

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

from AZSTOKE_SILVER_python import *


def Msg(parm):

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

    

trackNameList = ["pl0000","pl1000","pl2000","pl3000","pl4000","pl5000"]

trackColorList = [33554304,33521664,25165824,16777471,21004543,20988032]


masterTrack = AZ_GetTrackItemSelect(0,0,1)

_,_,masterName,_ = AZ_GetTrackItemName(masterTrack,0,1024)

_,_,masterDepth = AZ_GetTrackItemDepth(masterTrack,0)

masterColor = 0


for i, value in enumerate(trackNameList, 0):

    if masterName == trackNameList[i]:

        AZ_SetTrackItemColor(masterTrack,trackColorList[i])

        masterColor = trackColorList[i]

        

_,childList,masterChildCount = AZ_GetTrackItemChildList(masterTrack)

childInfoList = []


for i, value in enumerate(childList, 0):

    childInfoList.insert(i,{})

    _,_,childInfoList[i]["TrackName"],_ = AZ_GetTrackItemName(value,"",1024)

    AZ_SetTrackItemColor(value,masterColor)

    

_,_,_,trCount = AZ_GetTrackCountSelect(0,0,0)

deletIDList = []

idCount = 0


for i in range(trCount):

    _,_,_,name,_ = AZ_GetTrackIdName(0,i,"",1024)

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

        if name == value:

            idCount = idCount + 1

            deletIDList.append(e)

            

            

deletIDList = sorted(deletIDList,reverse = True)


for i in range(idCount):

    trackNameList.pop(deletIDList[i])

    trackColorList.pop(deletIDList[i])

    


for i, value in enumerate(trackNameList, 0):

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

    track = AZ_InsertTrackId(0,count)

    AZ_SetTrackItemName(track,value)

    AZ_SetTrackItemDepth(track,masterDepth)

    AZ_SetTrackItemColor(track,trackColorList[i])

    

    for e in range(masterChildCount):

        childTrack,_ = AZ_InsertChildTrack(track,0)

        AZ_SetTrackItemName(childTrack,childInfoList[e]["TrackName"])

        AZ_SetTrackItemColor(childTrack,trackColorList[i])

import sys

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

from AZSTOKE_SILVER_python import *


・Make SilverAPI available


def Msg(parm):

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


・Console output function for debugging

 

trackNameList = ["pl0000","pl1000","pl2000","pl3000","pl4000","pl5000"]

trackColorList = [33554304,33521664,25165824,16777471,21004543,20988032]


・Set specified name and color


masterTrack = AZ_GetTrackItemSelect(0,0,1)


・Get the beginning of the selected track and assign it to masterTrack


_,_,masterName,_ = AZ_GetTrackItemName(masterTrack,0,1024)


・Get the name of masterTrack and assign it to masterName


_,_,masterDepth = AZ_GetTrackItemDepth(masterTrack,0)


・Get the hierarchy of masterTrack and assign it to masterDepth


masterColor = 0


・Set the initial value of masterColor


for i, value in enumerate(trackNameList, 0):


・For loop for trackNameList


    if masterName == trackNameList[i]:

・If masterName and each trackNameList match, execute the following


        AZ_SetTrackItemColor(masterTrack,trackColorList[i])


・Set color to masterTrack


        masterColor = trackColorList[i]


・Assign the set color to masterColor

 

_,childList,masterChildCount = AZ_GetTrackItemChildList(masterTrack)


・Get masterTrack's child track list and number and assign to childList and masterChildCount


childInfoList = []


・Array initialization of childInfoList


for i, value in enumerate(childList, 0):


・For loop for childList


    childInfoList.insert(i,{})


・Add frame to childInfoList


    _,_,childInfoList[i]["TrackName"],_ = AZ_GetTrackItemName(value,"",1024)


- Assign the name to the TrackName key in childInfoList


    AZ_SetTrackItemColor(value, masterColor)


・Set masterColor color to child track

 

_,_,_,trCount = AZ_GetTrackCountSelect(0,0,0)


・Get the current number of tracks


deleteIDList = []


・Initialize deleteIDList


idCount = 0


・Initialize idCount


for i in range(trCount):

import sys

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

from AZSTOKE_SILVER_python import *


・Make SilverAPI available


def Msg(parm):

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


・Console output function for debugging

 

trackNameList = ["pl0000","pl1000","pl2000","pl3000","pl4000","pl5000"]

trackColorList = [33554304,33521664,25165824,16777471,21004543,20988032]


・Set specified name and color


masterTrack = AZ_GetTrackItemSelect(0,0,1)


・Get the beginning of the selected track and assign it to masterTrack


_,_,masterName,_ = AZ_GetTrackItemName(masterTrack,0,1024)


・Get the name of masterTrack and assign it to masterName


_,_,masterDepth = AZ_GetTrackItemDepth(masterTrack,0)


・Get the hierarchy of masterTrack and assign it to masterDepth


masterColor = 0


・Set the initial value of masterColor


for i, value in enumerate(trackNameList, 0):


・For loop for trackNameList


    if masterName == trackNameList[i]:


・If masterName and each trackNameList match, execute the following


        AZ_SetTrackItemColor(masterTrack,trackColorList[i])


・Set color to masterTrack


        masterColor = trackColorList[i]


・Assign the set color to masterColor

 

_,childList,masterChildCount = AZ_GetTrackItemChildList(masterTrack)


・Get masterTrack's child track list and number and assign to childList and masterChildCount


childInfoList = []


・Array initialization of childInfoList


for i, value in enumerate(childList, 0):


・For loop for childList


    childInfoList.insert(i,{})


・Add frame to childInfoList


    _,_,childInfoList[i]["TrackName"],_ = AZ_GetTrackItemName(value,"",1024)


- Assign the name to the TrackName key in childInfoList


    AZ_SetTrackItemColor(value, masterColor)


・Set masterColor color to child track

・Get the current number of tracks


deleteIDList = []


・Initialize deleteIDList


idCount = 0


・Initialize idCount


for i in range(trCount):


・For loop for trCount minutes


    _,_,_,name,_ = AZ_GetTrackIdName(0,i,"",1024)


・Get the name of each track and assign it to name


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


・For loop for trackNameList


        if name == value:


・Check trackNameList for name and if it matches, execute the following


            idCount = idCount + 1


・If there is a match, add 1 to idCount


            deleteIDList.append(e)


・Add index to deleteIDList

 

deletIDList = sorted(deletIDList,reverse = True)

for i in range(idCount):


・For loop for idCount


    trackNameList.pop(deletIDList[i])

    trackColorList.pop(deletIDList[i])


・Delete from the back according to the index of deleteIDList


for i, value in enumerate(trackNameList, 0):


・For loop for trackNameList


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


・Get the number of tracks and assign it to count


    track = AZ_InsertTrackId(0,count)


・Insert a track at the end of the track by setting the number of tracks


    AZ_SetTrackItemName(track,value)


・Set name to track


    AZ_SetTrackItemDepth(track, masterDepth)


・Set track hierarchy


    AZ_SetTrackItemColor(track,trackColorList[i])


・Set color to track

    for e in range(masterChildCount):


・Several minutes For loop of child track


        childTrack,_ = AZ_InsertChildTrack(track,0)


・Add child track


        AZ_SetTrackItemName(childTrack,childInfoList[e]["TrackName"])


・Set name to child track


        AZ_SetTrackItemColor(childTrack,trackColorList[i])


・Set color to child track


・Set deleteIDList in descending order

 

_,_,_,trCount = AZ_GetTrackCountSelect(0,0,0)

APIの利用にはBRONZEに

加入し専用APIを

ダウンロード

する必要があります。

Create a base track/child track

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

PYTHON

​ReaScript File Download 👇

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

- Script Image -
bottom of page