TCP classes

_rrTCP Class

class libpyRR39._rrTCP

TCP connection to rrServer. You should NOT create multiple _rrTCP instances, unless you really know what you are doing

class _rrTCP properties:

Type

Name

Description

_rrTCPclientList

clients

list of clients. Requires to call _rrTCP.clientGetList() first

_rrTCPconfig

config

Global configuration. Requires to call _rrTCP.configGetGlobal() and _rrTCP.configGetRenderOrder() first

_infoGlobal

info

Global Information. Requires to call infoGetGlobalInfo() first

_rrTCPjobList

jobs

list of jobs. Requires to call one of the getter functions first. Every function stores a different job class:

_rrTcp query method

class stored in jobs

jobs access method

_rrTCP.jobList_GetMinInfo()

rrJob._JobMinInfo

_rrTCPjobList.getJobMinInfo()

_rrTCP.jobList_GetBasic()

rrJob._JobBasics

_rrTCPjobList.getJobBasic()

_rrTCP.jobList_GetInfo()

rrJob._JobInfo

_rrTCPjobList.getJobInfo()

_rrTCPjobList.getJob* methods require the job unique identifier as argument. The job id can be obtained via rrJob._JobMinInfo.ID, where rrJob._JobMinInfo is accessed using _rrTCPjobList.getJobMinInfo_queue() or _rrTCPjobList.getJobMinInfo_filterQueue().

_rrTCPuser

users

list of users. Requires to call _rrTCP.userGet() first

class _rrTCP functions:

Return Type

Name

Description

bool

connectAndAuthorize()

After having used _rrTCP.setLogin(), call this function to login at the rrServer and verify the user/password. If your rrServer is in DEMO mode: EncodeTraffic must be set to False and you must NOT call setLogin() in your script.

bool

connectAndAuthorizeDemo()

Call this function if your rrServer is running in DEMO mode. You should not call setLogin() in your script.

str

errorMessage()

Return last error. If there were no errors, returns an empty string

bool

freeLicense(_licenseItem self, _rrClientType client_type)

Free license used by RR for artist (Aborts a job) and block it

object

getPassA85()

Can be called after setLogin() to retrieve your PW as a hash. This way you can temporaly save it without the possibility to retrieve your original password

str

getRRServer()

tries to get the rrServer name or IP from the RR folder in your company.Uses the RR_ROOT environment variable installed by rrWorkstationInstaller,therefore it does only work in your company. If you want to connect from outside your company, you have to use a DynDNS service.

str

getRRServer_OnPremise()

bool

loadLogin(str keyName)

Loads a login you have saved with saveLogin(). Returns False if there was an issue loading the Login.

loadLogin( (_rrTCP)self, (str)keyName) -> bool :

Loads a login you have saved with saveLogin(). Returns False if there was an issue loading the Login.

bool

loadLoginFile(str filename, str keyName)

Loads a login you have saved with saveLoginFile(). Returns False if there was an issue loading the Login.

bool

returnLicense(_licenseItem self, _rrClientType client_type)

Return blocked license

bool

saveLogin(str keyName)

Saves the login you have set with setLogin() into the local users settings. KeyName has to be any unique identifier. E.g. ‘myRRLogin’. Returns False if there was an issue saving the Login.

bool

saveLoginFile(str filename, str keyName, bool userTransferable, bool hostTransferable)

Saves the login you have set with setLogin() into the filename specified. KeyName has to be any unique identifier. E.g. ‘myRRLogin’. ‘userTransferable’ means that any user can get the password with loadLoginFile(). ‘hostTransferable’ means that you can get the password on any machine with loadLoginFile(). Returns False if there was an issue loading the Login. e.g. file not writeable, directory does not exist, login not set…

setLogin(str username, str password)

Sets the login to retrieve any data from the rrServer. This is required if one of the following configuration options apply (rrConfig, tab logins): - “Authorization required for all connections” is enabled - “Trusted local intranet IP whitelist” is set and you are outside this IP range

If authentication is not required, you may or may not set a user name, but if a password is given then the user has to exist. Special “Authorization String” user: Pre / Preview / Done / Finished scripts can use the jobs “Authorization String” user (authStr). This user can be used to send commands to that job or retrieve the whole job class with all data.

Note

You can restrict the commands execution in rrConfig, tab logins, User rrScriptAuth

Please see any python script in folder RR/render_apps/_prepost_scripts (and subfolder) for ‘AuthStr’ examples.

bool

setLoginA85(str self, object passwordHash)

Use it the same way as setLogin(), just with the password retrieved from getPassA85(). Returns true if the hash string has the right format (Does not mean the login is right).

setLogin_JobCommandPW(str password)

Applies the Jobs Command Password instead of a user login to allow job commands. Note: connectAndAuthorize() must not be called

setLogin_JobCommandPWHash(object password)

Applies the Jobs Command Password instead of a user login to allow job commands. Note: connectAndAuthorize() must not be called

setRemoteLocation()

Tell this module that we are executing from a remote location. All file checks should be disabled. rrServer uses rrLogin rights ‘Remote’

bool

setServer(str server name or IP, int server port)

Sets the server IP or name for all TCP connections

setVerbose(bool isVerbose)

Enable or disable verbose print messages to console

Client functions:

_ClientGroupList

clientGetGroups()

Get the list of all rrClient groups with their members. RR version 9 required

bool

clientGetList()

Gets all Clients. The result is put into the clients attribute

bool

clientSendCommand(list clientArray, int commandID, str commandParam)

Sends a command to rrClients whose ID is contained in given clientArray If the clientArray list is [-1], the command is applied to all clients.*commandID* _ClientCommand.cCommandLine

Config functions:

bool

configGetGlobal()

Retrieves global configuration from server and stores it into config. Returns True on success, False otherwise. Errors can be accessed via errorMessage()

bool

configGetRenderOrder()

Receive Render Order configuration from server and stores it into config. Returns True on success, False otherwise. Errors can be accessed via errorMessage()

bool

configSaveGlobal()

Sends global configuration to the server config and apply changes.

bool

configSaveRenderOrder()

Send Render Order configuration to the server and apply changes

Statistics functions:

str

connectionStats()

Returns information about the last connections.

str

connectionStatsJSON()

Returns information about the last connections.

int

getMemUsage()

Returns the current memory usage of _rrTCP

bool

infoGetGlobalInfo()

Retrieves global info from server. Returns True on success, False otherwise. Errors can be accessed via errorMessage()

Info functions:

str

infoGlobal()

Overal information about the render farm, as string. Requires to call infoGetGlobalInfo() first

bool

infoSaveLicense()

Send License configuration to the server and apply changes

Job functions:

bool

jobAddBinaryFrameSet(int jobID, _binaryFrameSet BinFrameList)

Adds frames to the frameSet as binary List. Requires job to have been send as Binary FrameSet job

bool

jobList_GetBasic([(int jobID=0])

Retrieves the scene information (rrJob._JobBasics) of job with given jobID and stores them in jobs. Calling jobList_SetFilter() first is reccomended to reduce network traffic. If jobID is 0, then it updates all jobs that match the filter.

bool

jobList_GetInfo([(int jobID=0])

Retrieves detailed info (rrJob._JobSend) of job with given jobID and stores them in jobs. Calling jobList_SetFilter() first is reccomended to reduce network traffic. If jobID is 0, then it updates all jobs that match the filter.

bool

jobList_GetMinInfo([(_rrTCP jobID=0])

Retrieves the minimal rrJob._JobMinInfo (id, user, software, project) of a job with given jobID and stores them in jobs. Calling jobList_SetFilter() first is reccomended to reduce network traffic. If jobID is 0, then it updates all jobs that match the filter.

bool

jobList_GetSend([(int jobID=0])

Deprecated since version 9.0: Use jobList_GetInfo() instead

bool

jobList_GetSettings([(int jobID=0])

Not available yet Retrieves jobs with settings with given jobID and stores them in jobs. Calling jobList_SetFilter() first is reccomended to reduce network traffic. If jobID is 0, then it updates all jobs that match the filter.

jobList_SetFilter(str user, str project, str renderApp, str contains, int filter)

Same as jobList_SetFilter() with less options

jobList_SetFilter2(str user, str project, str renderApp, int ageDays, str contains, bool invert, int filter)

Same as jobList_SetFilter3() with less options

jobList_SetFilter3(str user, str project, str renderApp, int ageHours, str contains, bool invert, int filter)

Same as jobList_SetFilter4() with less options

jobList_SetFilter4(str user, str project, str renderApp, int rendertype, int ageHours, str contains, bool invert, int filter)

Controls which jobs information are received from the rrServer. Just like in rrControlReccomended if you have a lot of jobs in the queue to reduce network traffic, rrServer workload and python memory usage. ‘renderType’: please see enum rrJob._renderType for values, otherwise set 0 for all jobs. ‘invert’ inverts ‘contains’. ‘filter’ is a bitmask. Use rrLib._filterIDs.isAll to get all jobs. Otherwise combine values of rrLib._filterIDs. ‘contains’ can be any string with multiple include and exclude words like ‘shot34 beauty -background’. Please see rrControl help for details.

bool

jobModify(list jobID, _SettingsOnly settings, _SettingsOnly changeFlags)

Change attributes of job with given jobID to the value of given settings. The values of changeFlags estabilish which attributes are affected.

The parameter settings (rrJob._SettingsOnly) contains the new settings of the job. The parameter changeFlags (rrJob._SettingsOnly) has the properties that are going to be changed flagged as True:

  • bool attributes set to True, integers set to 1, strings set to “1” in changeFlags will be set to their new values.

  • bool attributes set to False, integers set to 0, strings set to “0” in changeFlags will be left unchanged.

Please use rrJob.getClass_SettingsOnly() to get an instance of rrJob._SettingsOnly

For examples, see rr.jobModify() and libpyRR39._rrCfgDivisions.

bool

jobRestartFrames(int jobID, str FrameSet)

Restarts the frames of this new string frameSet. The job must NOT have a single output and must have option ‘Do not check for frames’ enabled.

bool

jobRestartFramesB(int jobID, str FrameSet)

Restarts the frames of this new binary frameSet. The job must NOT have a single output and must have option ‘Do not check for frames’ enabled.

bool

jobSendCommand(list jobIDs, int commandID, int parameter)

Send command of given rrJob._LogMessage commandID to jobs whose ID is in the jobIDs list. Please check errorMessage() if the function returns false.

bool

jobSetCustomVariables(list jobIDs, str CustomVarValue)

Set custom variables for the job in format ‘var=value; var2=value2’ . Max CustomVarValue string length per call is 500 unicode characters.

datetime.datetime

lastUpdateJobs_OurTime()

Returns the time this machine had had when jobList_GetBasic() or jobList_GetInfo() was called.

datetime.datetime

lastUpdateJobs_ServerTime()

Returns the time the rrServer had when jobList_GetBasic() or jobList_GetInfo() was called. If it was copied before the job list was retrieved, then it can be used to check which was was changed

User functions:

bool

userGet([(str userName=''])

Gets all or only a specified user. The result of this request is goes into the user attribute.

bool

userModify(_rrgUserSettings user)

Sends userSettings to the server to apply your changes. If the password was not set, it will not be changed.

Returns False in case of errors. userWasPartialFail() can be used to know if all settings have been applied. rrServer sends the user class back with its current values.

bool

userNew(_rrgUserSettings user)

Sends settings of new user to rrServer to apply the new user creation. An instance of userNew can be obtained via getNewUserPreset()

Returns False in case of errors. userWasPartialFail() can be used to know if all settings have been applied. rrServer sends the user class back with the current values.

bool

userWasPartialFail()

Returns True in case userNew or userModify have not been able to set all setting.E.g. a user can change its own PW, but he is not able to change his rights if he is not an admin

_rrTCPuser Class

class libpyRR39._rrTCPuser

Give access to user settings.

Note

The rrServer will NOT send any passwords. There is no need for any external app to handle existing passwords.

class _rrTCPuser functions:

Return Type

Name

Description

_rrgUserSettings

at(int userID)

int

count()

Number of users in this class.

_rrgUserSettings

getAnonymous()

_rrgUserSettings

getNewUserPreset()

_rrgUserSettings

getOurUser()

Requires to call _rrTCP.setLogin() and any _rrTCP.userGet() call before

_rrgUserSettings Class

class libpyRR39._rrgUserSettings

class _rrgUserSettings properties:

Type

Name

Description

str

emailAddress

bool

emailError

bool

emailStatus

datetime.datetime

lastUsed

str

loginUser

str

mapLocal

str

mapUNC

str

name

int

uniqueID

datetime.datetime

userAdded

str

userGroup

class _rrgUserSettings functions:

Return Type

Name

Description

setPassword(str self, password)

Modify user password. Note: Sending new user data to the rrServer requires you to login at the rrServer with your user and your old PW.

_rrTCPjobList Class

class libpyRR39._rrTCPjobList

holds an array of jobs that has been requested via _rrTCP.jobList_Get*() There are 4 possible data classes for jobs. You can check it via getJobDataType().

Example:

>>> print(tcp.jobs.getJobDataType(xxxxxxx))  # returns jlNone for all jobs
libpyRR39._dataIDs.jlNone
>>> tcp.jobList_SetFilter("UserX", "", "", "",rrLib._filterIDs.isAll)
>>> tcp.jobList_GetBasic():
>>> print(tcp.jobs.getJobDataType(tcp.jobs.getJobMinInfo_filterQueue(0).ID))  # returns jlBasic for all jobs of UserX. jlMinInfo for all other jobs
libpyRR39._dataIDs.jlBasic
>>> tcp.jobList_SetFilter("UserAAA", "", "", "", rrLib._filterIDs.isAll);
>>> tcp.jobList_GetInfo()
>>> print(tcp.jobs.getJobDataType(tcp.jobs.getJobMinInfo_filterQueue(0).ID))   # returns jlInfo for all jobs of UserAAA. jlBasic for all jobs of UserX, but the data is old.  jlMinInfo for all other
libpyRR39._dataIDs.jlInfo

class _rrTCPjobList properties:

Type

Name

Description

_dataIDs

_dataIDs

which data class is currently available for a job. Notes: jlSend was replaced with jlInfo and is deprecated. jlSettings is not supported yet.

_sortIDs

_sortIDs

codes for sorting jobs in a list

class _rrTCPjobList functions:

Return Type

Name

Description

enableDebugPrints()

rrJob._JobBasics

getJobBasic(int jobID)

Return rrJob._JobBasics for job of given jobID if available, otherwise None.

Changed in version 9.0: When not available, an empty rrJob._JobBasics was returned in version 8.0

Availability can be checked via getJobDataType()

_dataIDs

getJobDataType(int jobID)

Returns which data class is currently available for job with given jobID

_JobInfo

getJobInfo(int jobID)

Return :class :rrJob._JobSend for job of given jobID if available, otherwise None.

Changed in version 9.0: When not available, an empty rrJob._JobInfo was returned in version 8.0

Availability can be checked via getJobDataType()

rrJob._JobMinInfo

getJobMinInfo(int jobID)

Return rrJob._JobMinInfo for job of given jobID, return None if no jobs are stored in the list

rrJob._JobMinInfo

getJobMinInfo_filterQueue(int filteredIndex)

Return rrJob._JobMinInfo for job of given filteredIndex. To be used in for loops with getMaxJobsFiltered(). Returns None if filteredIndex is invalid

rrJob._JobMinInfo

getJobMinInfo_queue(int queueIndex)

Return rrJob._JobMinInfo for job of given queuedIndex. To be used in for loops with getMaxJobs() as max index. Returns None if queuedIndex is invalid

_JobInfo

getJobNoClients(int jobID)

Not supported yet

_JobInfo

getJobSend(int jobID)

Deprecated. Same as getJobInfo()

datetime.datetime

getJobUpdatedTime(int jobID)

Returns the time this job object was updated by jobList_GetBasic() or jobList_GetInfo(). The time is the rrServer time.

Note

This is not the last time the job was changed. Use job.lastSettingsChanged or job.lastInfoChanged to get that information.

str

getListAllProjects()

str

getListAllRenderApps()

str

getListAllUser()

int

getMaxJobs()

Total number of jobs in RR

int

getMaxJobsFiltered()

Total number of jobs in your filtered list

setPathTargetOS(int OS_ID)

Set the target OS to converts paths into when receiving new jobs. Target OS IDs are: Windows=1, Linux=2, Mac=3. Requires to call _rrTCP.configGetGlobal() as well.

sort(_sortIDs sortID)

Sorts all jobs in your filtered list.

_dataIDs Class

class libpyRR39._rrTCPjobList._dataIDs

which data class is currently available for a job. Notes: jlSend was replaced with jlInfo and is deprecated. jlSettings is not supported yet.

0

jlNone

1

jlMinInfo

2

jlBasic

3

jlSettings

4

jlSend

_filterIDs Class

class libpyRR39._filterIDs

enumeration values to filter job queries

name

bit value

hex value

isIdle

00000001

0x1

isRendering

00000010

0x2

isDisabled

00000100

0x4

isWaitFor

00001000

0x8

isFinished

00010000

0x10

isAll

00011111

0x1f

isApprovedPreview

00100000

0x20

isApprovedCloud

01000000

0x40

isApprovedMain

10000000

0x80

isApprovedCustom

100000000

0x100

notApprovedPreview

1000000000

0x200

notApprovedCloud

10000000000

0x400

notApprovedMain

100000000000

0x800

notApprovedCustom

1000000000000

0x1000

_sortIDs Class

class libpyRR39._rrTCPjobList._sortIDs

codes for sorting jobs in a list

0

sQueue

1

sUser

2

sDateSend

3

sPriority

4

sProject

5

sCustomName

6

sRenderApp

7

sApproved

8

sFramesLeft

9

sFramesDone

10

sTimeRemaining

11

sStatus

12

sScene

13

sLayer

14

sCamera

15

sFrameTime

_rrTCPclientList Class

class libpyRR39._rrTCPclientList

class _rrTCPclientList functions:

Return Type

Name

Description

_Client_ALL

at(int clientID)

_Client_ALL

clientAt(int clientID)

str

clientStatus(int clientID)

int

count()

Total number of clients

filter(int Memory, bool MemoryLesser, int Cores, bool CoresLesser, int Status, str Contains)

Filter Clients. Memory: RAM in MiB. If MemLesser is TRUE, then the rrClient has to have less RAM than your Memory value. Cores: Number of Cores. If CoresLesser is TRUE, then the rrClient has to have less Cores than your Cores value. Status: Filter by status. See enum _clientColumns for values. Contains: The name of the rrClient must contain this string.

filter_OS(bool Windows, bool Linux, bool Mac)

Filter rrClients by OS.

sortBy(int sortID)

Sort Clients. See enum _clientColumns for values.