TCP config classes

libpyRR39._rrTCPconfig Class

class libpyRR39._rrTCPconfig

Give access to the farm configuration. This class allow to query and edit the values set in rrConfig.

Note

Changes must be sent back to the server via _rrTCP.configSaveGlobal() in order to be applied and saved

class _rrTCPconfig properties:

Type

Name

Description

_rrCfgDivisions

renderDivisions

Extra settings for affecting the render order.

_rrCfgExclusive

renderExclusive

Exclusive Priority for Project/User/RenderApp/Divisions.

_rrCfgPreferred

renderPreferred

Preferred Job for Project/User/RenderApp/Divisions.

_rrgCfg_privileged

renderPrivileged

Privileged Job Types for Project/User/RenderApp/Divisions.

class _rrTCPconfig functions:

Return Type

Name

Description

object

getGlobalValue(str parameter name)

Get Global Configuration parameter from name, the name is used in globalconfig.ini

Example, read the settings for AverageAbort and ProjectNameByDirStart, as set in rrConfig:

from rr_python_utils.load_rrlib import rrLib
import rr_python_utils.connection as rr_connect

tcp = rr_connect.server_connect()
if tcp.configGetGlobal():
    print("AverageAbort is set to", tcp.config.getGlobalValue("jAverageAbort"))
    print("ProjectNameByDirStart is set to", tcp.config.getGlobalValue("jGetProjectNameByDirStart"))

object

getRenderOrderValue(str parameter name)

Get Render Order parameter from name, the name is used in config_renderorder.ini Example, read the settings for Exclusive Priority, as set in rrConfig:

from rr_python_utils.load_rrlib import rrLib
import rr_python_utils.connection as rr_connect

tcp = rr_connect.server_connect()
if tcp.configGetGlobal():
    print("Exclusive Priority is set to", tcp.config.getRenderOrderValue('EqualExclusivePrio'))

tuple

globalParameters()

Tuple of parameters for _rrTCPconfig.getGlobalValue(), _rrTCPconfig.setGlobalValue(). These names are used in globalconfig.ini

Note

_rrTCP must be connected, or the returned tuple will be empty

Example:

>>> from rr_python_utils.load_rrlib import rrLib
>>> import rr_python_utils.connection as rr_connect
>>> tcp = rr_connect.server_connect()
>>> tcp.config.globalParameters()
('ConfigVersionMajor', 'ConfigVersionMinor', 'Exr20'...

tuple

renderOrderParameters()

Tuple of parameters for _rrTCPconfig.getRenderOrderValue(), _rrTCPconfig.setRenderOrderValue(). These names are used in config_renderorder.ini

Note

a connection of _rrTCP is not required for getting these parameters

Example:

>>> from rr_python_utils.load_rrlib import rrLib
>>> tcp = rrLib._rrTCP("")
>>> tcp.config.renderOrderParameters()
('AbortPrivilegClientsOnReceive', 'AverageAbort', 'AverageAbortAfterFrame2'...

bool

setGlobalValue(str parameter name, object parameter value)

Set Global Configuration parameter from name, the name is used in globalconfig.ini Example, set new values for AverageAbort and ProjectNameByDirStart:

from rr_python_utils.load_rrlib import rrLib
import rr_python_utils.connection as rr_connect

tcp = rr_connect.server_connect()
if tcp.configGetGlobal():
    tcp.config.setGlobalValue("jAverageAbort", False)
    tcp.config.setGlobalValue("jGetProjectNameByDirStart", 1)

    if tcp.configSaveGlobal():
        print("New Config settings sent to rrServer")
    else:
        print("Couldn't send config to rrServer:", tcp.errorMessage())

bool

setRenderOrderValue(str parameter name, object parameter value)

Set Global Configuration parameter from name, the name is used in config_renderorder.ini

libpyRR39._cfgStrList Class

class libpyRR39._cfgStrList

List of Names. Used by _rrCfgExclusiveFor, _rrCfgPrivilegedFor for sorting the priority of Projects, Divisions, Apps, Users.

class _cfgStrList functions:

Return Type

Name

Description

append(str new item)

Add new item to the list

str

asString()

Represent list as single string

tuple

asTuple()

Represent list as tuple

str

at(int index)

Get item at given index

int

count()

Number of projects, users, applications, divisions

bool

hasItem(str name)

Return True if contains given item, case insensitive

bool

hasItemSameCase(str name)

Return True if contains given item, case sensitive

bool

isEmpty()

Return True if list is empty

removeAll(_cfgStrList self)

Remove all items

removeAt(int index)

Remove items at given index

set(int self, str index)

Set item at given index

libpyRR39._rrCfgDivisions Class

class libpyRR39._rrCfgDivisions

Render divisions are an additional category that can be assigned to jobs using the attribute rrJob._JobBasics.division. Divisions can be used like renderApps and Projects, to sort the priority of renders via _rrCfgExclusive, _rrCfgPreferred, and _rrgCfg_privileged

Example, add a priority order for layout and production jobs using divisions, then set a division on some jobs using _rrTCP.jobModify():

from rr_python_utils.load_rrlib import rrLib
import rr_python_utils.connection as rr_connect

# Get the farm configuration
tcp = rr_connect.server_connect()
tcp.configGetRenderOrder()

# Create a division for production jobs, one for layout jobs
tcp.config.renderDivisions.append("production")
tcp.config.renderDivisions.append("layout")

# Add divisions to the preferred order
tcp.config.renderPreferred.append("production")
tcp.config.renderPreferred.append("layout")

# Enable and save the new configuration on RR server
if tcp.configSaveRenderOrder():
    print("New configuration was saved")

# Set division for jobs, we need a job_settings with the `division` flag

job_flags = rrJob.getClass_SettingsOnly()
job_flags.division = "1"

job_settings = rrJob.getClass_SettingsOnly()
job_settings.division = "production"
job_IDs = []

# Add jobs of user 'Mario' to production
tcp.jobList_SetFilter("Mario", "", "", "", rrLib._filterIDs.isAll)
for i in range(tcp.jobs.getMaxJobsFiltered()):
    job_IDs.append(tcp.jobs.getJobMinInfo_filterQueue(i).ID)

tcp.jobModify(job_IDs, job_settings, job_flag)

# Add jobs of user 'Luigi' to layout
job_settings.division = "layout"
job_IDs = []

tcp.jobList_SetFilter("Luigi", "", "", "", rrLib._filterIDs.isAll)
for i in range(tcp.jobs.getMaxJobsFiltered()):
    job_IDs.append(tcp.jobs.getJobMinInfo_filterQueue(i).ID)

tcp.jobModify(job_IDs, job_settings, job_flags)

class _rrCfgDivisions functions:

Return Type

Name

Description

append(str name)

Add a new division of given name

tuple

asTuple()

A tuple of division names

str

at(int index)

Name of the division at given index

clear()

Clear all divisions

bool

contains(str name)

Return True if divisions list contains name (Case Sensitive)

int

count()

Number of current divisions

removeAt(int index)

Remove divisions at fiven index

set(int index, str name)

Set name of division at given index

libpyRR39._rrCfgExclusiveFor Class

class libpyRR39._rrCfgExclusiveFor

Exclusive Priority for Projects, Users, RenderApps, and Divisions. A job belonging to one of the categories stored in list gets exclusive priority on up to maxClients render clients. An expiration date can be set using expire. See the help of _rrCfgExclusive for examples.

class _rrCfgExclusiveFor properties:

Type

Name

Description

datetime

expire

Priority Expiration Date (None if unset)

class _cfgStrList

list

_cfgStrList of Projects, Apps, Users, Divisions

int

maxClients

Max number of clients for this Exlusive Priority

class _rrCfgExclusiveFor functions:

Return Type

Name

Description

clearExpire()

Unset Expiration Date

libpyRR39._rrCfgExclusive Class

class libpyRR39._rrCfgExclusive

Contains _rrCfgExclusiveFor of Exclusive Priority for Projects, Users, RenderApps, and Divisions. This class can contain up to count settings

Example, list Exclusive Priority settings, reserve 10 clients for Maya jobs until the day after tomorrow, at the first available slot:

from rr_python_utils.load_rrlib import rrLib
import rr_python_utils.connection as rr_connect
import datetime

# Get the farm configuration
tcp = rr_connect.server_connect()
tcp.configGetRenderOrder()

for i in range(tcp.config.renderExclusive.count()):
    exclusive = tcp.config.renderExclusive.at(i)
    if exclusive.list.isEmpty():
        exclusive.list.append("Maya")
        exclusive.maxClients = 10
        day_after_tomorrow = datetime.datetime.now() + datetime.timedelta(days=3)
        exclusive.expire = day_after_tomorrow

        print("Added priority for Maya jobs at slot", i, "Following slots might contain more settings")
        break

    if exclusive.expire:
        expiration = "expires on " + exclusive.expire.strftime('%A %d-%m-%Y, %H:%M')
    else:
        expiration = "never expires"
    print(f"        { exclusive.list.asString() }, max clients : {exclusive.maxClients}, ", expiration)

# Enable and save the new configuration on RR server
if tcp.configSaveRenderOrder():
    print("New configuration was saved")

class _rrCfgExclusive functions:

Return Type

Name

Description

_rrCfgExclusiveFor

at(int index)

Exclusive settings at slot of given index

int

count()

Number of available Exclusive Priority Slots. The number of slots is fixed, unset slots have an empty _rrCfgExclusiveFor.list

libpyRR39._rrgCfg_RenderOrder Class

class libpyRR39._rrgCfg_RenderOrder

Ordered preference list of renderApps, Projects, Users or Divisions. Each entry can contain multiple values, separated by semicolons.

Example, add Maya and Compositing jobs to the first available entry. Also, print out the existing settings:

from rr_python_utils.load_rrlib import rrLib
import rr_python_utils.connection as rr_connect

# Get the farm configuration
tcp = rr_connect.server_connect()
tcp.configGetRenderOrder()

# Add Maya and Comp as an entry of preferred jobs")
tcp.config.renderPreferred.append("Maya;Comp")

print("Preferred Render Order")
for i in range(tcp.config.renderPreferred.count()):
    print(" ", tcp.config.renderPreferred.at(i))

# Enable and save the new configuration on RR server
if tcp.configSaveRenderOrder():
    print("New configuration was saved")

class _rrgCfg_RenderOrder functions:

Return Type

Name

Description

append(str name)

str

at(int self)

Comma separated Preferred Job Types

clear()

bool

contains(str name)

Return True if preferred list contains name (Case Sensitive)

int

count()
insert(int index, str name)
move(int from, int to)
removeAt(int index)
set(int self, str name)

Set comma separated Preferred Job Types

swapItemsAt(int index 1, int index 2)

libpyRR39._rrCfgPrivilegedFor Class

class libpyRR39._rrCfgPrivilegedFor

The client set at clientName will privilege the jobs belonging to the renderApps, Users, Projects, Divisions set in list. See the help of _rrgCfg_privileged for examples.

class _rrCfgPrivilegedFor properties:

Type

Name

Description

str

clientName

Name of client privileging jobs

class _cfgStrList

list

_cfgStrList of privileged Apps, Users, Project, Divisions

libpyRR39._rrgCfg_privileged Class

class libpyRR39._rrgCfg_privileged

List of _rrgCfg_privilegedFor. Clients named after the _rrCfgPrivilegedFor.clientName belonging to this class will take the jobs in _rrCfgPrivilegedFor.list first.

Example, make the client ‘Farm20’ render blender and Compositing jobs first:

from rr_python_utils.load_rrlib import rrLib
import rr_python_utils.connection as rr_connect

# Get the farm configuration
tcp = rr_connect.server_connect()
tcp.configGetRenderOrder()

# Adding Job Privilege for client "Farm20"
new_privilege = rrLib._rrCfgPrivilegedFor()
new_privilege.clientName = "Farm20"
new_privilege.list.append("blender")
new_privilege.list.append("Comp")

tcp.config.renderPrivileged.append(new_privilege)

# Enable and save the new configuration on RR server
if tcp.configSaveRenderOrder():
    print("New configuration was saved")

class _rrgCfg_privileged functions:

Return Type

Name

Description

append(_rrCfgPrivilegedFor privilege)

add _rrCfgPrivilegedFor to list

_rrCfgPrivilegedFor

at(int index)

_rrCfgPrivilegedFor at given index

clear()

int

count()
removeAt(int index)

Remove _rrCfgPrivilegedFor at given index