RamDaemonInterface

The low-level Class used to communicate with the Ramses Daemon. This is a simple wrapper for the Daemon API.

One (and only one) instance globally available (RamDaemonInterface is a singleton), by calling RamDaemonInterface.instance() or Ramses.instance().daemonInterface().

Note

You should not need this class as all communications are automatically handled by the other classes.

Static Methods

Method Arguments Description Dev Notes
instance
RamDaemonInterface
Returns the RamDaemonInterface unique instance.
checkReply
boolean
dict: reply Checks if the reply returned by a RamDaemonInterface instance is accepted, successful and has some content.

Methods

Please refer to the Daemon API reference for more information about these methods.

These methods return the reply of the Daemon converted from JSON to an object, dict, structure, or whatever best suits the language in which the add-on is implemented. This returned object can be converted to a RamObject instance using the corresponding RamObject.fromDict() static method.

Method Arguments Description Dev Notes
constructor integer: port=18185
daemonVersion
string
The current version of the Daemon TODO: change the ping method to store the version in a private attribute
getAssets
Object / Dict
Gets the list of the assets for the current project
getAsset
Object / Dict
string:shortName,
string:name=""
Gets a specific asset. The name is optional, as short names should be unique.
getAssetGroups
Object / Dict*
Gets the list of the asset groups for the current project
getCurrentProject
Object / Dict
Gets the current project
getCurrentStatus
Object / Dict
string: itemShortName,
string : itemName,
string: step,
ItemType: itemType=ItemType.SHOT
Gets the status for the specific step for the item. itemType must be one of: ItemType.SHOT or ItemType.ASSET
getCurrentStatuses
Object / Dict
string: itemShortName,
string : itemName,
string: step,
ItemType: itemType=ItemType.SHOT
Gets the list of status (one per step) for the item. itemType must be one of: ItemType.SHOT or ItemType.ASSET
getCurrentUser
Object / Dict
Gets the current user
getProjects
Object / Dict
Gets the list of available projects
getProject
Object / Dict
string:shortName,
string:name=""
Gets a specific project. The name is optional, as short names should be unique.
getRamsesFolderPath
Object / Dict
Gets the main Ramses folder containing projects, config files, user files…
getPipes
Object / Dict
Gets the list of pipes for the current project TODO
getShots
Object / Dict
string: filter="" Gets the list of the shots for the current project. Filter is a way to get a subset of the shots: the daemon will return only shots containing the filter in their name or short name. The filter can contain a wildcard "*"
getShot
Object / Dict
string:shortName,
string:name=""
Gets a specific shot. The name is optional, as short names should be unique.
getStates
Object / Dict
Gets the list of available states
getState
Object / Dict
string:shortName,
string:name=""
Gets a specific state. The name is optional, as short names should be unique.
getSteps
Object / Dict
Gets the list of the steps for the current project
getStep
Object / Dict
string:shortName,
string:name=""
Gets a specific step. The name is optional, as short names should be unique.
online
boolean
True if the Daemon is available
ping
Object / Dict
Gets the version and current user of the Ramses Daemon
raiseWindow Raises the Ramses Client application main window
setCurrentProject
Object / Dict
string: shortName Sets the current project
setPublishSettings string: stepShortName,
string: stepName,
string: settings
Sets new publish settings for the step.
setStatus string: itemShortName,
string: itemName,
string: step,
ItemType: itemType=ItemType.SHOT,
string: state="",
string: comment="",
string: completionRatio=-1,
int: version=0,
boolean: published=false,
string: user=undefined
Sets a new status for the item.

Examples

# Python
daemon = RamDaemonInterface.instance()
reply = daemon.getProjects() # Call from the instance
if RamDaemonInterface.checkReply(reply): # Call from the class, it's a static method
    doSomething(reply['content'])
else:
    print (reply['message'])
// JavaScript
var daemon = RamDaemonInterface.instance();
var reply = daemon.getProjects(); // Call from the instance
if ( RamDaemonInterface.checkReply(reply) ) { // Call from the class, it's a static method
    doSomething(reply['content']);
}
else {
    alert (reply['message']);
}

Implementation

Python

In Python, the methods from this class return a dict as constructed from the JSON reply of the Daemon using the standard json.loads( str ) method.

JavaScript / ExtendScript

In JS, the methods from this class return a standard JS object as constructed from the JSON reply of the Daemon using the standard json2 library.


META