top of page

Track

1

Automatically increment names and automatically color children of selected tracks

RANK

AZSTOKE_SelectTrackChildAutoNameAndColor

import sys

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

from AZSTOKE_SILVER_python import *


def Msg(parm):

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


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


for i in range(count):

    _,_,_,masterName,_ = AZ_GetSelectedTrackIdName(0,i,"",1024)

    _,color,_,_,_ = AZ_GetRandomColor(0,0,0,0)

    

    AZ_SetSelectedTrackIdColor(0,i,color)

    retval , trackList = AZ_GetSelectedTrackIdChildList(0,i)

    for e, track in enumerate(trackList, 1):

        _ = AZ_SetTrackItemColor(track,color)

        _,_,_,digitNum,_ = AZ_FormatNumDigit(e,2,"",1024)

        setName = masterName + "_" + digitNum

        AZ_SetTrackItemName(track,setName)

import sys

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

from AZSTOKE_SILVER_python import *


・Import Silver API



def Msg(parm):

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


- Prepare console output for testing



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



- Output the number of selected tracks


for i in range(count):


-Loop the number of selected tracks


_,_,_,masterName,_ = AZ_GetSelectedTrackIdName(0,i,"",1024)


-Get the name of the selected track and assign it to masterName


_,color,_,_,_ = AZ_GetRandomColor(0,0,0,0)


- Outputs random color values

AZ_SetSelectedTrackIdColor(0,i,color)


- Set the color of the selected track


retval , trackList = AZ_GetSelectedTrackIdChildList(0,i)


- Output the child tracks of the selected track as an array and assign it to trackList


for e, track in enumerate(trackList, 1):


- Loop for the number of times in the trackList array


_ = AZ_SetTrackItemColor(track,color)


- Set the color of the selected track to the track output from trackList


_,_,_,digitNum,_ = AZ_FormatNumDigit(e,2,"",1024)


- The ID output in the loop is two digits, in the form 01/02/03/04


setName = masterName + "_" + digitNum


- Create a name by combining "_" and "digitNum" with the selected track name (masterName) and assign it to setName


AZ_SetTrackItemName(track,setName)


- Set setName to the track name

APIの利用にはBRONZEに

加入し専用APIを

ダウンロード

する必要があります。

  • Select all parent tracks of the child tracks you want to edit

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

PYTHON

​ReaScript File Download 👇

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

- Script Image -
bottom of page