Welcome to use RenderbusSDK!¶
RenderBus at a glance¶
Overview¶
We provide a simple Python rendering SDK to make use of our cloud rendering service easily; This official rendering SDK is developed and maintained by RD and TD groups of RENDERBUS; This rendering SDK has been tested on python2.7 and python3.6.
Why to use the rendering SDK?¶
1. Automation. The SDK automates the process of using the cloud rendering service (analysing scens, uploading assets, rendering, downloading, etc). Users can integrate the modules to there own workflow(such as DeadLine, Qube, etc).
2. Open source. Users can customize the codes or submit development suggestions.
3. Cross-version. Python2 and python3 are both supported.
4. Cross-platform. Windows and Linux are both supported.
5. Security. Dynamic signature algorithm authentication (HmacSHA256 + Base64 + UTC timestamp time-limited authentication + random number to prevent replay attacks) adopted, more secure.
6. Provide a variety of invoking ways. Support local and remote analysis.
7. Independence. Isolate the API functions, easily expanding.
8. Complete Documentation.
Supported software¶
- Maya
- Houdini
- Clarisse
Preparation¶
- An account of RENDERBUS
- Apply to use the render SDK from RENDERBUS Developer Center and get the AccessID and AccessKey
Installation¶
Refer to Installation Guide
Get started¶
Refer to SDK Getting Started Tutorial
Parameter setting¶
Refer to Detailed parameters configuration
More¶
Important
Make sure local Python environment and PIP are available before use.
Installation Guide¶
Method One (recommended):
Note
Users who have limited access to the Python official address network can download and install from our custom server。
Download from Python official pypi (recommended)
pip install rayvision_maya
pip install rayvision_clarissa
pip install rayvision_houdini
Install from a custom PIP server
Before using specific rendering modules, such as Houdini rendering, please refer to the following installation method to install the modules in turn rayvision_log, rayvision_api , rayvision_utils , rayvision_sync,
Method Two:
Download source code directly from GitHub:
git clone https://github.com/renderbus/rayvision_log.git
git clone https://github.com/renderbus/rayvision_api.git
git clone https://github.com/renderbus/rayvision_utils.git
git clone https://github.com/renderbus/rayvision_sync.git
other modules are installed similarly to the secondary installation method
Method Three:
- Setup IDE for PIP with address:
https://pip.renderbus.com/simple/
- Take pycharm as an example:


SDK tutorial¶
一. Login authentication¶
render_para = {
"domain": "jop.foxrenderfarm.com",
"platform": "2",
"access_id": "xxxx",
"access_key": "xxxx",
}
api = RayvisionAPI(
access_id=render_para['access_id'],
access_key=render_para['access_key'],
domain=render_para['domain'],
platform=render_para['platform']
)
RayvisionAPI Parameters:
Parameters | Type | Required | Default | Description |
---|---|---|---|---|
domain | string | Y | task.renderbus.com | China user:task.renderbus.com,Foreign user:jop.foxrenderfarm.com |
platform | string | Y | 2 | platform ID,example: W2:"2", W6/qingyun:"6", GPU Region 1:"21" |
access_id | string | Y | user authorization id | |
access_key | string | Y | user authorization key |
二. Analysis of the scene¶
Analysis is independent(Maya / Houdini / Clarisse)
Example for Houdini:
from rayvision_houdini.analyze_houdini import AnalyzeHoudini
analyze_info = {
"cg_file": r"D:\files\CG FILE\flip_test_slice4.hip",
"workspace": "c:/workspace",
"software_version": "17.5.293",
"project_name": "Project1",
"plugin_config": {
'renderman': '22.6'
}
}
analyze_obj = AnalyzeHoudini(**analyze_info)
analyze_obj.analyse()
Instructions:
“workspace” is used to control the location of the generated json file. If workspace is not set, the default location is generated:
windows : os.environ["USERPROFILE"] + "renderfarm_sdk" Linux:os.environ["HOME"] + “renderfarm_sdk”
Analytically generated task.json is no “task_id”、“user_id”、”project_id” parameters,Users can choose to write the three parameters themselves, or to write the three parameters automatically when check.
AnalyzeHoudini Parameters:
Parameters | Type | Required | Default | Description |
---|---|---|---|---|
cg_file | string | Y | Scenario files to analyze | |
software_version | string | Y | The version of the software | |
project_name | string | N | None | The project name |
plugin_config | dict | N | None | The plug-in configuration,example {'renderman': '22.6'} |
workspace | string | N | None | Analyze the location of the generated json file (avoiding duplication automatically adds a timestamp folder) |
三. Add special fields and update the json file interface¶
Only updates and modifications to the parameters of task.json and upload.json files are supported.
1. Modify the task.json¶
update_task_info(update_info, task_path)
task_info
from rayvision_api.utils import update_task_info, append_to_task, append_to_upload
update_task = {
"pre_frames": "100", # Sets the priority to render the first frame
"stop_after_test": "1" # Stop rendering after rendering the priority frame
}
update_task_info(update_task, analyze_obj.task_json)
2. task.json add custom parameters¶
The added custom parameters will be integrated into dictionary for key is “additional_info”. 【Warning】:Custom parameters will not take effect immediately. If you have this requirement, please contact our customer service。
additional_info
custom_info_to_task = {
"env": "houdini_env"
}
append_to_task(custom_info_to_task, analyze_obj.task_json)
3. user custom upload.json¶
Support custom add file path to upload.json, will automatically deduplicateappend_to_upload(files_paths, upload_path)
upload
custom_info_to_upload = [
r"D:\houdini\CG file\Cam003\cam.abc",
]
append_to_upload(custom_info_to_upload, analyze_obj.upload_json)
四. Upload¶
Now there are two ways:
1.Upload the json file first and then upload the resource file according to “upload.json”:¶
Four json files are uploaded, and the transfer engine automatically starts uploading the scene, resource, and other files based on the upload.json file.
upload(self,task_id,task_json_path,tips_json_path,asset_json_path,upload_json_path, max_speed=None)
CONFIG_PATH = [
r"C:\workspace\work\tips.json",
r"C:\workspace\work\task.json",
r"C:\workspace\work\asset.json",
r"C:\workspace\work\upload.json",
]
upload_obj = RayvisionUpload(api)
upload_obj.upload(str(task_id), *CONFIG_PATH)
2.Uploading json files is completely independent of the user resources:¶
Uploading resources:upload_asset(self, upload_json_path, max_speed=None, is_db=True)
Upload json file: upload_config(self, task_id, config_file_list, max_speed=None)
CONFIG_PATH = [
r"C:\workspace\work\tips.json",
r"C:\workspace\work\task.json",
r"C:\workspace\work\asset.json",
]
UPLOAD = RayvisionUpload(api)
UPLOAD.upload_asset(r"C:\workspace\work\upload.json", is_db=False)
UPLOAD.upload_config("5165465", CONFIG_PATH)
【Warning】:You need a task ID to upload a json file, but you don’t need a task ID to upload a resource file;The ‘is_db’ parameter in upload_asset is used to control whether or not a local database is needed. By default, a local database is used;
五. Download¶
Download now provides 3 ways:
1. Supports custom downloads of hierarchical directory structures under each rendering task.¶
download(self, task_id_list=None, max_speed=None, print_log=True, download_filename_format="true",local_path=None, server_path=None)
download = RayvisionDownload(api)
download.download(download_filename_format="true", server_path="18164087_muti_layer_test/l_ayer2")
Warning:This method needs to provide the task ID if the “server_path” is not empty, and the task ID does not take effect if there is a custom “server_path”.
2. Realtime download, that is, the task rendering completed a frame began to download¶
auto_download(self, task_id_list=None, max_speed=None, print_log=False, sleep_time=10, download_filename_format="true", local_path=None)
download = RayvisionDownload(api)
download.auto_download([18164087], download_filename_format="false")
Warning:The method task ID cannot be empty
3. The task is not downloaded until all frames are rendered¶
auto_download_after_task_completed(self, task_id_list=None, max_speed=None, print_log=True, sleep_time=10, download_filename_format="true", local_path=None):
download = RayvisionDownload(api)
download.auto_download_after_task_completed([18164087], download_filename_format="false")
Warning: The method task ID cannot be empty
六. Attachment: transfer configuration file¶
1. Transport configuration Settings include:
Select database type, database file path Settings, transfer log path Settings
2. The transport configuration file used by default: db_config.ini, The following figure
db_config.ini
The user can also modify the configuration for the template based on the default configuration and specify the database configuration file location, specifying a custom configuration file as follows.
from rayvision_sync.upload import RayvisionUpload
UPLOAD = RayvisionUpload(api, db_config_path=r"D:\test\upload\db_config.ini")
3. db_config.ini Parameters:
Parameters | instructions | Default |
---|---|---|
transfer_log_path | Transfer engine log file path | |
on | Whether to use a local database, true / false: Yes / No | true |
type | Select database,currently only supports "redis" and "sqlite" | sqlite |
db_path | The database file saves the path | |
host | redis database host | 127.0.0.1 |
port | redis database port | 6379 |
password | redis database password | |
table_index | Redis Repositories,cannot be empty | |
timeout | Redis client connection timeout,unit ms | 5000 |
temporary | When using sqlite database, if the uploaded record data is deleted after the completion of the upload, the default "false" will not be deleted | false |
4. transfer_log_path and db_path The priority rule for values is as follows:
db_config.ini custom paths are preferred if they are set;
No custom path is as follows:
transfer_log_path
Use environment variables first ‘RAYVISION_LOG’
Second use:
window: The environment variable “USERPROFILE”/<renderfarm_sdk>Linux: The environment variable “HOME” /<renderfarm_sdk>
db_path
Use environment variables first ‘RAYVISION_LOG’
Second use:
window: The environment variable “USERPROFILE”/<renderfarm_sdk>Linux:The environment variable “HOME” /<renderfarm_sdk>
5. rayvision_houdini Analyze the generated db database location
The Houdini script saves some analysis commands and files in a sqlite database file during analysis
Use the custom custom path first, the custom path setting method is as follows:
The ‘custom_db_path’ parameter is set when the “AnalyzeHoudini” analysis class is called
class AnalyzeHoudini(object):
def __init__(self, cg_file, software_version, project_name=None,
plugin_config=None, render_software="Houdini",
local_os=None, workspace=None, custom_exe_path=None,
platform="2", custom_db_path=None):
- The following rules are used if the custom path is not set:
Use environment variables first ‘RAYVISION_HOUDINI’
Second use:
window: The environment variable “USERPROFILE”/<renderfarm_sdk>Linux:The environment variable “HOME” /<renderfarm_sdk>
Rayvision Api¶
Note
API entry function module
Note
task is mainly used to verify the analysis results and to configure some initial task information.
Note
Set option for asset and general configuration of the task.
RayvisionTask¶
Note
operators is mainly used for calling the rendering interface.
Environment setting and calling the rendering platform service interface.
RenderEnv¶
Set the rendering environment configuration.
-
class
rayvision_api.operators.env.
RenderEnvOperator
(connect)¶ Bases:
object
The rendering environment configuration.
-
add_render_env
(data)¶ Adjust user rendering environment configuration.
Parameters: data (dict) – Rendering environment configuration. e.g.:
- {
- ‘cgId’: “2000”, ‘cgName’: ‘Maya’, ‘cgVersion’: ‘2018’, ‘renderLayerType’: 0, ‘editName’: ‘tests’, ‘renderSystem’: 1, ‘pluginIds’: [2703]
}
Returns: - Render env info.
- e.g.:
- {
- ‘editName’: ‘tests’
}
Return type: dict
-
delete_render_env
(edit_name)¶ Delete user rendering environment configuration.
Parameters: edit_name (str) – Rendering environment custom name.
-
get_render_env
(name)¶ Get the user rendering environment configuration.
Parameters: - name (str) – The name of the DCC.
- e.g. – maya, houdini, 3dsmax
Returns: - Software info.
- e.g.:
- [
- {
“cgId”: 2000, “editName”: “testRenderEnv332”, “cgName”: “Maya”, “cgVersion”: “2020”, “osName”: 0, “renderLayerType”: 0, “isDefault”: 0, “respUserPluginInfoVos”: [
- {
“pluginId”: 1166, “pluginName”: “wobble”, “pluginVersion”: “wobble 0.9.5”
}
]
}, {
”cgId”: 2000, “editName”: “testRenderEnv222”, “cgName”: “Maya”, “cgVersion”: “2020”, “osName”: 0, “renderLayerType”: 0, “isDefault”: 0, “respUserPluginInfoVos”: [
- {
“pluginId”: 1166, “pluginName”: “wobble”, “pluginVersion”: “wobble 0.9.5”
}
]
Return type:
-
Query¶
API query operation.
-
class
rayvision_api.operators.query.
QueryOperator
(connect)¶ Bases:
object
API query operation.
-
all_frame_status
()¶ Get the overview of task rendering frame.
Returns: - Frames status info.
- e.g.:
- {
- “executingFramesTotal”: 1, “doneFramesTotal”: 308, “failedFramesTotal”: 2, “waitingFramesTotal”: 153, “totalFrames”: 577
}
Return type: dict
-
error_detail
(code, language='0')¶ Get analysis error code.
Parameters: - code (string) –
Required value, error code. e.g.:
10010. 15000. - language (str, optional) – Not required, language, 0: Chinese (default) 1: English.
Returns: - Detailed list of error messages.
- e.g.:
- [
- {
“id”: 5, “code”: “15000”, “type”: 1, “languageFlag”: 0, “desDescriptionCn”: “启动 3ds max 卡住或者失败”, “desSolutionCn”: “1.检查启用对应版本的 3ds max
是否有特殊弹窗,有的话手动关闭;n2.检查操作系 统是否设置了高级别的权限”,
- ”solutionPath”: “
http://note.youdao.com/noteshare?id=d8f1ea0c46dfb524af798f6b1d31cf6f”,
”isRepair”: 0, “isDelete”: 1, “isOpen”: 1, “lastModifyAdmin”: “”, “updateTime”: 1534387709000
},
]
Return type: - code (string) –
-
get_frame_thumbnall
(frame_id, frame_status=4)¶ Load thumbnail.
Parameters: Returns: - Thumbnail path.
- Example:
- [
“small_pic100000100001138Render_264_renderbus_0008[-]jpg.jpg”
]
Return type:
-
get_raysync_user_key
()¶ Get the user rendering environment configuration.
Returns: - User login raysync information.
- Example:
- {
- ‘raySyncUserKey’: ‘8ccb94d67c1e4c17fd0691c02ab7f753cea64e3d’, ‘userName’: ‘test’, ‘platform’: 2,
}
Return type: dict
-
get_task_list
(page_num=1, page_size=2, status_list=None, search_keyword=None, start_time=None, end_time=None)¶ Get task list.
An old to the new row, the old one.
Parameters: - page_num (int) – Required value, current page.
- page_size (int) – Required value, numbers displayed per page.
- status_list (list<int>) – status code list,query the status of the task in the list.
- search_keyword (string) – Optional, scenario name or job ID.
- start_time (string) – Optional, search limit for start time.
- end_time (string) – Optional, search limit for end time.
Returns: - Task info, please see the documentation for details.
- e.g.:
- {
“pageCount”: 32, “pageNum”: 1, “total”: 32, “size”: 1, “items”: [
- {
“sceneName”: “衣帽间.max”, “id”: 18278, “taskAlias”: “P18278”, “taskStatus”: 0, “statusText”: “render_task_status_0”, “preTaskStatus”: 25, “preStatusText”: “render_task_status_25”, “totalFrames”: 0, “abortFrames”: null, “executingFrames”: null,
},
]
}
Return type:
-
get_task_processing_img
(task_id, frame_type=None)¶ Get the task progress diagram,currently only Max software is supported.
Parameters: - Returns: Task progress diagram information
- dict:
- Example:
- {
“block”:16, “currentTaskType”:”Render”, “grabInfo”:[
- [
- {
- “couponFee”:”0.00”, “frameIndex”:”0”, “renderInfo”:”“, “frameBlock”:”1”, “frameEst”:”0”, “grabUrl”:”/mnt/output/d20/small_pic/10001500/10001834/389406/Render_2018110900083_0_frame_0[_]block_0[_]_STP00000_Renderbus_0000[-]tga.jpg”, “feeAmount”:”0.20”, “frameUsed”:”66”, “frameStatus”:”4”, “framePercent”:”100”, “isMaxPrice”:”0”, “startTime”:”2018-11-09 18:28:26”, “endTime”:”2018-11-09 18:29:32”
}
]
], “height”:1500, “sceneName”:”com_589250.max-Camera007”, “startTime”:”2018-11-09 18:27:40”, “width”:2000
}
-
get_transfer_server_msg
()¶ Get the user rendering environment configuration.
Returns: - Connect raysync information.
- Example:
- {
- ‘raysyncTransfer’: {
- ‘port’: 2542, ‘proxyIp’: ‘render.raysync.cn’, ‘proxyPort’: 32011, ‘serverIp’: ‘127.0.0.1’, ‘serverPort’: 2121, ‘sslPort’: 2543
}
}
Return type: dict
-
opera_user_label
(task_id, status, label_name=None, type=0)¶
-
platforms
()¶ Get platforms.
Returns: - Platforms info.
- e.g.:
- [
- {
- “platform”: 2, “name”: “query_platform_w2”
},
]
Return type: list
-
restart_failed_frames
(task_param_list)¶ Re-submit the failed frame.
Parameters: task_param_list (list of str) – Task ID list.
-
restart_frame
(task_id, select_all, ids_list=None)¶ Re-submit the specified frame.
Parameters:
-
supported_plugin
(name)¶ Get supported rendering software plugins.
Parameters: name (str) – The name of the DCC. e.g.:
maya, houdiniReturns: - Plugin info.
- e.g.:
- {
- “cgPlugin”: [
- {
- “cvId”: 19,
“pluginName”: “zblur”,
“pluginVersions”: [
- {
- “pluginId”: 1652, “pluginName”: “zblur”, “pluginVersion”: “zblur 2.02.019”
}
]
},
], “cgVersion”: [
- {
- “id”: 23, “cgId”: 2005, “cgName”: “CINEMA 4D”, “cgVersion”: “R19”
}
]
}
Return type: dict
-
supported_software
()¶ Get supported rendering software.
Returns: - Software info.
- e.g.:
- {
- “isAutoCommit”: 2,
“renderInfoList”: [
- {
- “cgId”: 2000, “cgName”: “Maya”, “cgType”: “ma;mb”, “iconPath”: “/img/softimage/maya.png”, “isNeedProjectPath”: 3, “isNeedAnalyse”: 1, “isSupportLinux”: 1
}
], “defaultCgId”: 2001
}
Return type: dict
-
task_frames
(task_id, page_num, page_size, search_keyword=None)¶ Get task rendering frame details.
Parameters: - task_id (int) – The task ID number, which is the unique identifier of the task, required field.
- page_num (int) – Current page number.
- page_size (int) – Displayed data size per page.
- search_keyword (str, optional) – Is a string, which is queried according to the name of a multi-frame name of a machine rendering, optional.
Returns: - Frames info list, please see the documentation for details.
- e.g.:
- {
“pageCount”: 9, “pageNum”: 1, “total”: 17, “size”: 2, “items”: [
- {
“id”: 1546598, “userId”: null, “framePrice”: null, “feeType”: null, “platform”: null, “frameIndex”: “0-1”, “frameStatus”: 4, “feeAmount”: 0.44, “startTime”: 1535960273000, “endTime”: 1535960762000,
},
],
}
Return type:
-
task_info
(task_ids_list)¶ Get task details.
Parameters: task_ids_list (list of int) – Shell task ID list. Returns: - Task details.
- e.g.:
- {
- “pageCount”: 1,
“pageNum”: 1,
“total”: 1,
“size”: 100,
“items”: [
- {
- “sceneName”: “3d66.com_593362_2018.max”,
“id”: 19084,
“taskAlias”: “P19084”,
“taskStatus”: 0,
“statusText”: “render_task_status_0”,
“preTaskStatus”: 25,
“preStatusText”: “render_task_status_25”,
“totalFrames”: 0,
“abortFrames”: null,
“executingFrames”: null,
“doneFrames”: null,
“failedFrames”: 0,
“framesRange”: “0”,
“projectName”: “”,
“renderConsume”: null,
“taskArrears”: 0,
“submitDate”: 1535958477000,
“startTime”: null,
“completedDate”: null,
“renderDuration”: null,
“userName”: “xiaoguotu_ljian”,
“producer”: null,
“taskLevel”: 60,
“taskUserLevel”: 0,
“taskLimit”: null,
“taskOverTime”: null,
“userId”: 10001520,
“outputFileName”: null,
“munuTaskId”: “”,
“layerParentId”: 0,
“cgId”: 2001,
“taskKeyValueVo”: {”tiles”: null, “allCamera”: null, “renderableCamera”: null
}
}
”userAccountConsume”: null
}
Return type: dict
-
Tag¶
API operation on tags.
-
class
rayvision_api.operators.tag.
TagOperator
(connect)¶ Bases:
object
Task tag settings.
-
add_label
(new_name, status=1)¶ Add a custom label.
Parameters:
-
add_task_tag
(tag, task_ids)¶ Add a custom task tag. :param tag: Label name. :type tag: str :param task_ids: task id list. :type task_ids: list[int], optional
-
delete_label
(del_name)¶ Delete custom label.
Parameters: del_name (str) – The name of the label to be deleted.
-
delete_task_tag
(tag_ids)¶ del custom task label. :param label_ids: lable id list. :type label_ids: list[int], optional
-
Task¶
Interface to operate on the task.
-
class
rayvision_api.operators.task.
TaskOperator
(connect)¶ Bases:
object
API task related operations.
-
TASK_PARAM
= 'taskIds'¶
-
create_task
(count=1, task_user_level=50, out_user_id=None, labels=None)¶ Create a task ID.
Parameters: - count (int, optional) – The quantity of task ID.
- task_user_level (int) – Set the user’s task level to either 50 or 60, default is 50.
- out_user_id (int, optional) – Non-required, external user ID, used to distinguish users accessing third parties.
- labels (list or tuple, optional) – Custom task labels.
Returns: - The information of the task.
- e.g.:
- {
“taskIdList”: [1658434], “aliasTaskIdList”: [2W1658434], “userId”: 100093088
}
Return type:
-
full_speed
(task_id_list)¶ Full to render.
Parameters: - task_id_list (list of int) – Task list.
- Example –
- {
- “taskIds”:[485],
}
-
set_task_overtime_top
(task_id_list, overtime)¶ Set the task timeout stop time.
Parameters:
-
submit_task
(task_id=None, asset_lsolation_model=None, out_user_id=None, only_id=False)¶ Submit a task to rayvision render farm.
Parameters: - task_id (int) – Submit task ID.
- asset_lsolation_model (str) – Asset isolation type, Optional value, default is null, optional value:’TASK_ID_MODEL’ or ‘OUT_USER_MODEL’.
- out_user_id (str) – The asset isolates the user ID, Optional value, when asset_lsolation_model=’OUT_USER_MODEL’ ,’out_user_id’ cant be empty.
-
User¶
Interface to operate the user.
-
class
rayvision_api.operators.user.
UserOperator
(connect)¶ Bases:
object
API user information operator.
-
get_transfer_bid
()¶ Get user transfer BID.
Returns: - Transfer bid info.
- e.g.:
- {
- “config_bid”: “30201”, “output_bid”: “20201”, “input_bid”: “10201”
}
Return type: dict
-
info
¶
-
query_user_profile
()¶ Get user profile.
Returns: - User profile info.
- e.g.:
- {
- “userId”: 10001136, “userName”: “rayvision”, “platform”: 2, “phone”: “173333333333”, “email”: “”, “company”: “”, “name”: “”, “job”: “”, “communicationNumber”: “”, “softType”: 2000, “softStatus”: 1, “businessType”: 1, “status”: 1, “infoStatus”: 0, “accountType”: 1,
}
Return type: dict
-
query_user_setting
()¶ Get user setting.
Returns: - The information of the user settings.
- e.g.:
- {
- “infoStatus”: null, “accountType”: null, “shareMainCapital”: 0, “subDeleteTask”: 0, “useMainBalance”: 0, “singleNodeRenderFrames”: “1”, “maxIgnoreMapFlag”: “1”, “autoCommit”: “2”, “separateAccountFlag”: 0, “mifileSwitchFlag”: 0, “assfileSwitchFlag”: 0, “manuallyStartAnalysisFlag”: 0, “downloadDisable”: 0, “taskOverTime”: 12
}
Return type: dict
-
update_user_settings
(task_over_time)¶ Update user settings.
Parameters: task_over_time (int) – The task timeout is set in seconds.
-
user_id
¶
-
RayvisionAPI¶
Initialize user, task, query, environment, tag interface.
-
class
rayvision_api.core.
RayvisionAPI
(access_id=None, access_key=None, domain='task.renderbus.com', platform='4', protocol='https', logger=None)¶ Bases:
object
Create the request object.
Including user action, task action, query action, environment operation and tag action.
-
check_and_add_project_name
(project_name)¶ Get the tag id.
Call the API interface to obtain all the label information of the user, determine whether the label name to be added already exists, and obtain the label id if it exists. If the label does not exist, the API interface is repeatedly requested. The request is up to three times. If the third time does not exist, the empty string is returned.
Parameters: project_name (str) – The name of the tag to be added. Returns: Tag id. Return type: int
-
connect
¶ The current connect instance.
Type: rayvision.api.Connect
-
get_user_id
()¶ Get user id.
Example
- user_profile_info = {
- “userId”: 10001136, “userName”: “rayvision”, “platform”: 2, “phone”: “173333333333”, “email”: “”, “company”: “”, “name”: “”, “job”: “”, “communicationNumber”: “”, “softType”: 2000, “softStatus”: 1, “businessType”: 1, “status”: 1, “infoStatus”: 0, “accountType”: 1,
}
Returns: The ID number of the current user. Return type: int
-
submit_by_data
(task_info, file_name=None, upload_info='', asset_info='')¶
-
user_info
¶
-
Connect¶
Request, request header and request result processing.
-
class
rayvision_api.connect.
Connect
(access_id, access_key, protocol, domain, platform, headers=None, session=None)¶ Bases:
object
Connect operation with the server, request.
-
headers
¶ Get request headers dic.
-
post
(api_url, data=None, validator=True)¶ Send an post request and return data object if no error occurred.
Request processing through the decorator, if the request fails more than five times, then the exception is ran out.
Parameters: - api_url (rayvision_api.api.url.URL or str) –
The URL address of the corresponding action network Request.
- e.g.:
- /api/render/common/queryPlatforms /api/render/user/queryUserProfile /api/render/user/queryUserSetting
- data (dict, optional) – Request data.
- validator (bool, optional) – Validator the data.
Returns: Response data.
Return type: dict or List
Raises: RayVisionAPIError
– The request failed, It returns the error ID, the error message, and the request address.- api_url (rayvision_api.api.url.URL or str) –
-
API interfaces use methods¶
The preparatory work¶
All interface calls are made through the rayvision_api module, and an API object must be instantiated before use :
user_info = {
"domain_name": "jop.foxrenderfarm.com",
"platform": "2",
"access_id": "xxxxxxxxxxxxxxxxxxxxxx",
"access_key": "xxxxxxxxxxxxxxxxxxxxx",
}
api = RayvisionAPI(access_id=user_info['access_id'],
access_key=user_info['access_key'],
domain=user_info['domain_name'],
platform=user_info['platform'])
Warning:
- the following interface calls will be made directly using the API of the above instance;
- In the rayvision_api, the interface actually returns the user only the value of the “data” parameter ;
Obtain the platform list¶
Interface path: /api/render/common/queryPlatforms
Request parameters: No
Return parameters:
Parameters | Type | Description | Memo |
---|---|---|---|
platform | Integer | Platform number | |
name | String | Platform number description |
Example of request:
# automatically distinguish domestic and foreign according to the "domain" parameter
platform = api.query.platforms()
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": [
{
"platform": 2,
"name": "query_platform_w2"
}
],
"serverTime": 1535949047370
}
Obtain the user information¶
Interface path:/api/render/user/queryUserProfile
Request parameter:No
Example of request:
user_profile = api.user.query_user_profile()
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": {
"userId": 10001136,
"userName": "rayvision",
"platform": 2,
"phone": "173333333333",
"email": "",
"company": "",
"name": "",
"job": "",
"communicationNumber": "",
"softType": 2000,
"softStatus": 1,
"businessType": 1,
"status": 1,
"infoStatus": 0,
"accountType": 1,
"userType": 1,
"mainUserId": 0,
"level": 49,
"pictureLever": null,
"zone": 1,
"rmbbalance": 0,
"usdbalance": 0,
"rmbCumulative": 0,
"usdCumulative": 0,
"credit": 0,
"coupon": 49.93,
"description": "",
"country": "中国",
"city": "广东 中山",
"address": "",
"cpuPrice": 0.67,
"gpuPrice": 20,
"shareMainCapital": 0,
"subDeleteTask": 0,
"useMainBalance": 0,
"hideBalance": 0,
"hideJobCharge": 0,
"useLevelDirectory": 1,
"downloadDisable": 0,
"displaySubaccount": 1,
"subaccountLimits": 5,
"houdiniFlag": 0,
"c4dFlag": 0,
"blenderFlag": 0,
"keyshotFlag": 0,
"studentEndTime": null
},
"serverTime": 1535953580730
}
Obtain user settings¶
Interface path:/api/render/user/queryUserSetting
Request parameter:No
Return parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
infoStatus | Integer | ||
accountType | Integer | ||
shareMainCapital | |||
subDeleteTask | |||
useMainBalance | |||
singleNodeRenderFrames | String | Multiple frames rendered on one machine | |
maxIgnoreMapFlag | String | Can choose to ignore the max map error or not | 0:Do not ignore,1:Ignore |
autoCommit | String | Can choose start scene parameter rendering | 1:Do not start,2 :Start |
separateAccountFlag | Integer | Separate the primary and secondary account settings | |
mifileSwitchFlag | Integer | Indicate the switch option of mi Document analysis risk | |
assfileSwitchFlag | Integer | Do not analyze the ass file switch identifier | |
manuallyStartAnalysisFlag | Integer | Manually turn on the analysis switch | |
downloadDisable | Integer | Choose to disable downloading or not | 1 Disable,0 Do not disable |
taskOverTime | Integer | Timeout - hour |
Example of request:
user_setting = api.user.query_user_setting()
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": {
"infoStatus": null,
"accountType": null,
"shareMainCapital": 0,
"subDeleteTask": 0,
"useMainBalance": 0,
"singleNodeRenderFrames": "1",
"maxIgnoreMapFlag": "1",
"autoCommit": "2",
"separateAccountFlag": 0,
"mifileSwitchFlag": 0,
"assfileSwitchFlag": 0,
"manuallyStartAnalysisFlag": 0,
"downloadDisable": 0,
"taskOverTime": 12,
"taskOverTimeSec": 3600
},
"serverTime": 1535954828406
}
Update user settings¶
Interface path:/api/render/user/updateUserSetting
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
task_over_time | Integer | Set up of Task timeout situation, unit: second |
Return parameter: default
Example of return:
update_user_setting = api.user.update_user_settings(task_over_time=43200)
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": null,
"serverTime": 1535957894211
}
Obtain user transfer BID¶
Interface path:/api/render/task/getTransferBid
Request parameter:default
Return parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
config_bid | String | Configuration file transfer ID | |
output_bid | String | Download the transfer file ID | |
input_bid | String | Asset upload transfer ID |
Example of request:default
user_transfer_bid = api.user.get_transfer_bid()
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": {
"parent_input_bid": "10206"
"config_bid": "30201",
"output_bid": "20201",
"input_bid": "10206"
},
"serverTime": 1535957964631
}
Create task ID¶
Interface path:/api/render/task/createTask
Request parameter:
parameter | Type | Description | Memo |
---|---|---|---|
count | Integer | create the number of task Numbers | Not required, Default 1 |
out_user_id | Long | external user ID | Not required,used to distinguish third party access users |
task_user_level | Integer | task user level | Not required,optional 50 and 60, default is 50 |
labels | List |
custom tag | Not required |
Return parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
aliasTaskIdList | List\<String> | Task ID alias | |
taskIdList | List\<Integer> | Task ID |
Example of request:
create_task_id = api.task.create_task(count=1,
task_user_level=50,
labels=["label_test1", "label_test2"])
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": {
"aliasTaskIdList": [
"2W19097"
],
"taskIdList": [
19097
],
"userId": 10007893
},
"serverTime": 1535959487092
}
Submit task¶
Interface path:/api/render/task/submitTask
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
task_id | Integer | task id | |
asset_lsolation_model | String | Asset isolation type | Optional value, default is null, optional value:'TASK_ID_MODEL'、'OUT_USER_MODEL'. |
out_user_id | String | The asset isolates the user ID | Optional value, when asset_lsolation_model='OUT_USER_MODEL' ,‘out_user_id’ cant be empty. |
asset_lsolation_model:
Parameter | Description | Applicable scenario | Clean rules |
---|---|---|---|
TASK_ID_MODEL | Divide task_id into three segments, with a minimum of 3 bits for each segment. If the high level is insufficient, add 0. For example, task_id=12345, then ASSET_ISOLATION_PATH="000/012/345". | Renderings API enterprise users, there is no repeatability for the asset file, the platform task number is referenced to do the asset isolation, to avoid the abnormal rendering effect caused by the file name conflict. | Keep for a maximum of 15 days. |
OUT_USER_MODEL | If out_user_id=12345, ASSET_ISOLATION_PATH="000/012/345". If out_user_id is more than 9 bits, such as: 11223344556677, the final isolation path bit is ASSET_ISOLATION_PATH="11223344/556/677". | Animation API enterprise user, refers to the third party user ID left asset isolation, to avoid the third party user's asset file conflict caused by the rendering result exception. | If the directory does not have a new render task reference for 20 consecutive days, it is removed. |
Return parameter:default
Example of request:
submit_task = api.task.submit_task(task_id=create_task_id[0])
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": null,
"serverTime": 1535957894211
}
Warning: Before committing, you need to call the transport interface to upload the relevant analysis configuration file .
Obtain analysis error code¶
Interface path:/api/render/common/queryErrorDetail
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
code | String | Mandatary,error code | |
language | String | Optional,language | 0:Chinese(default) 1:English |
Return parameter:List<CodeInfo>
Parameter | Type | Description | Memo |
---|---|---|---|
id | |||
code | Integer | error code | |
type | Integer | Type | 0 Warning-can be ignored,1 Error-can not be ignored |
languageFlag | Integer | languageType | 0:Chinese,1:English |
desDescriptionCn | String | Chinese description | |
desSolutionCn | String | Solution | |
solutionPath | String | Connect to solution | |
isRepair | Integer | Check if repairable or not | 1:Repairable ,0:Non-repairable |
isOpen | Integer | Check if turn on the intercept of the error or not | 0:Not turn on the intercept,1:Turn on the intercept |
updateTime | Date | The final update time |
Example of request:
error_detail = api.query.error_detail(code="50001")
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": [
{
"id": 5,
"code": "15000",
"type": 1,
"languageFlag": 0,
"desDescriptionCn": "启动3ds max卡住或者失败",
"desSolutionCn": "1.检查启用对应版本的3ds max是否有特殊弹窗,有的话手动关闭;\n2.检查操作系统是否设置了高级别的权限",
"solutionPath": "http://note.youdao.com/noteshare?id=d8f1ea0c46dfb524af798f6b1d31cf6f",
"isRepair": 0,
"isDelete": 1,
"isOpen": 1,
"lastModifyAdmin": "",
"updateTime": 1534387709000
}
],
"serverTime": 1535962451356
}
Obtain the task list¶
Interface path:/api/render/task/getTaskList
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
page_num | Integer | Mandatary,number of current page | Default: 1 |
page_size | Integer | Mandatary,quantities of displaying per page | Default: 1 |
status_list | List\<Integer> | status code list,query the status of the task in the list | Check task status description for details |
search_keyword | String | Optional, scenario name or job ID | Fuzzy search |
start_time | String | Optional, search limit for start time | Example:yyyy-MM-dd HH:mm:ss |
end_time | String | Optional, search limit for end time | Example:yyyy-MM-dd HH:mm:ss |
Task status description:
Status | Status code | Description |
---|---|---|
WAITING | 0 | Waiting |
RENDERING | 5 | Rendering |
PRE_RENDERING | 8 | Prepared to be handled |
STOP | 10 | Stop |
ARREARAGE_STOP | 20 | Stop due to arrearage |
TIME_OUT_STOP | 23 | Stop due to timing out |
FINISHED | 25 | Finished |
FINISHED_HAS_FAILED | 30 | Finished with failed frames contained |
ABANDON | 35 | Give up |
FINISHED_TEST | 40 | Test completed |
FAILED | 45 | Failed |
ANALYSE | 50 | Analyzing |
Return parameter:list<Task Info>
Parameter | Type | Description | Memo |
---|---|---|---|
sceneName | String | Scene Name | |
id | Integer | Task id | |
taskAlias | String | Task Name | |
taskStatus | Byte | Task status | 1/Waiting, 5/Rendering, 10/Stop, 15/User Stop, 20/Stop due to arrearage, 25/Finished, 30/Finished with failed frames contained, 35/Give up, 40/Test completed, 45/Failed |
statusText | String | Status Text | |
preTaskStatus | Byte | Preprocessi-ng Task Status | |
preStatusText | String | Preprocessi-ng Task Status Text | |
totalFrames | Integer | Total frames | |
abortFrames | Integer | Abort frames | |
executingFrames | Integer | Executing frames | |
doneFrames | Integer | Done frames | |
failedFrames | Integer | Failed frames | |
framesRange | String | Frames range | |
projectName | String | Project name | |
renderConsume | BigDecimal | Task render consume | |
taskArrears | BigDecimal | Task arrears | |
submitDate | Date | Submit Date | |
startTime | Date | Start Date | |
completedDate | Date | Completed Date | |
renderDuration | Long | Task render duration | |
userName | String | User name | |
producer | String | producer | |
taskLevel | Byte | Task level | |
taskUserLevel | Integer | Task level of user | |
taskLimit | Integer | Task node limit | |
taskOverTime | Long | Task timeout reminder time | |
outputFileName | String | Output file name | |
munuTaskId | String | Dispatch id | |
layerParentId | String | About maya task,parent id | |
cgId | Integer | Task type | 2001/maya,2000/max |
taskKeyValueVo | Object | Task keyword | |
userAccountConsume | Bigdecimal | User account consume | |
couponConsume | Bigdecimal | Coupon consume | |
isOpen | Byte | Whether the front-end expansion button is expanded or not | |
taskType | String | Task type | Preprocessing, RenderPhoton, Render |
renderCamera | String | Render camera | |
cloneParentId | Integer | Clone parent id | |
cloneOriginalId | Integer | Clone original id | |
shareMainCapital | Byte | Whether to Share Main Account Assets | 0:no , 1:yes |
taskRam | Integer | Task render memory | |
respRenderingTaskList | List\<TaskInfo> | Child tasks of the open task | Structure the same of this object |
layerName | String | Layer name | |
taskTypeText | String | Task type text | photon/picture |
isDelete | Byte | Whether or not to delete | 0: deleted, 1: not deleted |
taskKeyValueVo:
parameter | Type | Description | Memo |
---|---|---|---|
tiles | String | Tile number | |
allCamera | String | All Cameras | |
RenderableCarema | String | Render Cameras |
Example of request:
task_list = api.query.get_task_list(page_num=1, page_size=1)
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": {
"pageCount": 32,
"pageNum": 1,
"total": 32,
"size": 1,
"items": [
{
"sceneName": "衣帽间.max",
"id": 18278,
"taskAlias": "P18278",
"taskStatus": 0,
"statusText": "render_task_status_0",
"preTaskStatus": 25,
"preStatusText": "render_task_status_25",
"totalFrames": 0,
"abortFrames": null,
"executingFrames": null,
"doneFrames": null,
"failedFrames": 0,
"framesRange": "0",
"projectName": "",
"renderConsume": null,
"taskArrears": 0,
"submitDate": 1535602289000,
"startTime": null,
"completedDate": null,
"renderDuration": null,
"userName": "xiaoguotu_ljian",
"producer": null,
"taskLevel": 79,
"taskUserLevel": 0,
"taskLimit": 200,
"taskOverTime": null,
"userId": 10001520,
"outputFileName": null,
"munuTaskId": "",
"layerParentId": 0,
"cgId": 2001,
"taskKeyValueVo": {
"tiles": null,
"allCamera": null,
"renderableCamera": null
},
"userAccountConsume": null,
"couponConsume": null,
"isOpen": 1,
"taskType": "",
"renderCamera": "VRayCam003",
"cloneParentId": null,
"cloneOriginalId": null,
"shareMainCapital": 0,
"taskRam": null,
"respRenderingTaskList": [
{
"sceneName": "衣帽间.max",
"id": 18280,
"taskAlias": "P18280",
"taskStatus": 25,
"statusText": "render_task_status_25",
"preTaskStatus": null,
"preStatusText": null,
"totalFrames": 1,
"abortFrames": 0,
"executingFrames": 0,
"doneFrames": 1,
"failedFrames": 0,
"framesRange": "0",
"projectName": "",
"renderConsume": 1.57,
"taskArrears": 0,
"submitDate": 1535602289000,
"startTime": 1535602601000,
"completedDate": 1535603874000,
"renderDuration": 1176,
"userName": "xiaoguotu_ljian",
"producer": null,
"taskLevel": 79,
"taskUserLevel": 0,
"taskLimit": 200,
"taskOverTime": 86400000,
"userId": 10001520,
"outputFileName": "18280_衣帽间",
"munuTaskId": "2018083000075",
"layerParentId": 18278,
"cgId": 2001,
"taskKeyValueVo": {
"tiles": null,
"allCamera": null,
"renderableCamera": null
},
"userAccountConsume": 0,
"couponConsume": 1.57,
"isOpen": 0,
"taskType": "RenderPhoton",
"renderCamera": "VRayCam003",
"cloneParentId": 0,
"cloneOriginalId": 0,
"shareMainCapital": 0,
"taskRam": null,
"respRenderingTaskList": null,
"layerName": null,
"taskTypeText": "render_photons_task",
"isDelete": 1
},
{
"sceneName": "衣帽间.max",
"id": 18281,
"taskAlias": "P18281",
"taskStatus": 25,
"statusText": "render_task_status_25",
"preTaskStatus": null,
"preStatusText": null,
"totalFrames": 17,
"abortFrames": 0,
"executingFrames": 0,
"doneFrames": 17,
"failedFrames": 0,
"framesRange": "0",
"projectName": "",
"renderConsume": 6.7,
"taskArrears": 0,
"submitDate": 1535602289000,
"startTime": 1535603885000,
"completedDate": 1535604765000,
"renderDuration": 5028,
"userName": "xiaoguotu_ljian",
"producer": null,
"taskLevel": 79,
"taskUserLevel": 0,
"taskLimit": 200,
"taskOverTime": 86400000,
"userId": 10001520,
"outputFileName": "18281_衣帽间",
"munuTaskId": "2018083000079",
"layerParentId": 18278,
"cgId": 2001,
"taskKeyValueVo": {
"tiles": null,
"allCamera": null,
"renderableCamera": null
},
"userAccountConsume": 0,
"couponConsume": 6.7,
"isOpen": 0,
"taskType": "Render",
"renderCamera": "VRayCam003",
"cloneParentId": 0,
"cloneOriginalId": 0,
"shareMainCapital": 0,
"taskRam": null,
"respRenderingTaskList": null,
"layerName": null,
"taskTypeText": "render_major_picture_task",
"isDelete": 1
}
],
"layerName": null,
"taskTypeText": null,
"isDelete": 1
}
]
},
"serverTime": 1535964116655
}
Stop task¶
Interface path: /api/render/task/stopTask
Request parameter:
parameter | Type | Description | Memo |
---|---|---|---|
task_param_list | List\<Integer> | Combination of the task ID |
Return parameter:default
Example of request:
stop_task = api.task.stop_task(task_param_list=[13798105])
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": null,
"serverTime": 1535957894211
}
Start task¶
Interface path:/api/render/task/startTask
Request parameter:
parameter | Type | Description | Memo |
---|---|---|---|
task_param_list | List\<Integer> | Combination of the task ID |
Return parameter:default
Example of request:
start_task = api.task.start_task(task_param_list=[13798105])
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": null,
"serverTime": 1535957894211
}
Abandon task¶
Interface path:/api/render/task/abortTask
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
task_param_list | List\<Integer> | Combination of the task ID |
Return parameter:default
Example of request:
abort_task = api.task.abort_task(task_param_list=[13798105])
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": null,
"serverTime": 1535957894211
}
Delete task¶
Interface path:/api/render/task/deleteTask
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
task_param_list | List\<Integer> | Task ID list |
Return parameter:default
Example of request:
delete_task = api.task.delete_task(task_param_list=[13798105])
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": null,
"serverTime": 1535957894211
}
Obtain the task rendering frame details¶
Interface path: /api/render/task/queryTaskFrames
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
task_id | Integer | Task ID | Task ID,Is the unique identifier of the task, mandatary field |
search_keyword | String | Query based on the name of the multiple frames that rendered on one machine | Is a string that be queried based on name of the multiple frames that rendered on one machine, optional field |
page_num | Integer | Current page number | |
page_size | Integer | Size of the data that displayed per page |
Return parameter:List<FrameInfo>
Parameter | Type | Description | Memo |
---|---|---|---|
id | Integer | frame id | |
userId | Long | userID | |
framePrice | Double | Render pricing | |
feeType | Integer | Fee charge type | 0 Quantity-based,1 Machine-bashed,2 Project-based |
platform | Integer | Platform | |
frameIndex | String | Frame sequence name | |
frameBlock | String | Current frame number | |
frameStatus | Integer | Current frame status | 1/Waiting,2/Processing,3/Stopped,4/Complete,5/Failed,6/Waiting for the pre-handeling,7/Waiting for photonic frame rendering completed,8/Waiting for the priority rendering completed,9/ Wait for the photon job to finish rendering,10/Waiting for the settlement job rendering completed,11/Task timing out |
feeAmount | Double | Balance deduction | |
couponFee | Double | Vouchers deduction | |
startTime | Long | Start time (ms) | |
endTime | Long | End time (ms) | |
frameExecuteTime | Long | Rendering frame time | |
frameStatusText | String | Frame status description | |
arrearsFee | Double | Render frame arrears amount | |
taskId | Long | Task ID | |
frameType | Integer | Frame Type | 1/Pre-rendering (only one frame, even for multi-camera case), 2/photon frame, 3/combine photon frame, 4/priority frame, 5/main render frame, 6 priority /maya/max composite rendering frame, 7/maya/max rendering main picture composite frame, 8/houdini settlement frame, 9/max channel frame |
recommitFlag | Integer | Recount times | Indicate the recount time default is 0,increased as the recount time increase |
taskOverTime | Integer | overtime | Overtime details |
gopName | String | Houdini Settlement node name | |
frameRam | Integer | Memory of the task rendering frame | No memory requirement if description does not specified |
Example of request:
task_frame = api.query.task_frames(task_id=13790691, page_num=1, page_size=1)
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": {
"pageCount": 9,
"pageNum": 1,
"total": 17,
"size": 2,
"items": [
{
"id": 1546598,
"userId": null,
"framePrice": null,
"feeType": null,
"platform": null,
"frameIndex": "0-1",
"frameStatus": 4,
"feeAmount": 0.44,
"startTime": 1535960273000,
"endTime": 1535960762000,
"frameExecuteTime": 489,
"frameStatusText": "task_frame_status_4",
"arrearsFee": null,
"munuJobId": "0",
"taskId": 19088,
"munuTaskId": "2018090300040",
"frameType": 5,
"couponFee": 0,
"recommitFlag": 0,
"isCopy": null,
"frameBlock": "1",
"taskOverTime": 86400000,
"gopName": null,
"frameRam": null
},
{
"id": 1546599,
"userId": null,
"framePrice": null,
"feeType": null,
"platform": null,
"frameIndex": "0-2",
"frameStatus": 4,
"feeAmount": 0.43,
"startTime": 1535960856000,
"endTime": 1535961338000,
"frameExecuteTime": 482,
"frameStatusText": "task_frame_status_4",
"arrearsFee": null,
"munuJobId": "1",
"taskId": 19088,
"munuTaskId": "2018090300040",
"frameType": 5,
"couponFee": 0,
"recommitFlag": 0,
"isCopy": null,
"frameBlock": "2",
"taskOverTime": 86400000,
"gopName": null,
"frameRam": null
}
]
},
"serverTime": 1535966967143
}
Obtain the overview of task rendering frames¶
Interface path:/api/render/task/queryAllFrameStats
Request parameter:No
Return parameter:
parameter | Type | Description | Memo |
---|---|---|---|
executingFramesTotal | Integer | Number of frames in rendering | |
doneFramesTotal | Integer | Number of frames completed | |
failedFramesTotal | Integer | Number of rendered frames failed | |
waitingFramesTotal | Integer | Number of frames in waiting | |
totalFrames | Integer | Number of overall rendered frames |
Example of request:
all_frame_status = api.query.all_frame_status()
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": {
"executingFramesTotal": 1,
"doneFramesTotal": 308,
"failedFramesTotal": 2,
"waitingFramesTotal": 153,
"abandonFramesTotal": 113,
"totalFrames": 577
},
"serverTime": 1535968038725
}
Re-submit the failed frames¶
Interface path: /api/render/task/restartFailedFrames
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
task_param_list | List\<Integer> | Task ID list |
Return parameter:default
Example of request:
restart_failed_frames = api.query.restart_failed_frames(task_param_list=[13788981])
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": null,
"serverTime": 1535957894211
}
Re-submit the specified frames¶
Interface path:/api/render/task/restartFrame
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
task_id | Integer | Task ID | |
ids_list | List\<Integer> | Combine the frame ID | Effective if 0 displayed when select_all |
select_all | Integer | Choose if re-submit all | 1:All,0:Only the specified frame |
Return parameter:default
Example of request:
restart_frame = api.query.restart_frame(task_id=14362099, select_all=1)
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": null,
"serverTime": 1535957894211
}
Obtain the task details¶
Interface path:/api/render/task/queryTaskInfo
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
task_ids_list | List\<Integer> | Combine the shell task ID |
Return parameter:List<TaskInfo>
Parameter | Type | Description | Memo |
---|---|---|---|
sceneName | String | Scene Name | |
id | Integer | Task id | |
taskAlias | String | Task Name | |
taskStatus | Byte | Task status | 1/Waiting, 5/Rendering, 10/Stop, 15/User Stop, 20/Stop due to arrearage, 25/Finished, 30/Finished with failed frames contained, 35/Give up, 40/Test completed, 45/Failed |
statusText | String | Status Text | |
preTaskStatus | Byte | Preprocessi-ng Task Status | |
preStatusText | String | Preprocessi-ng Task Status Text | |
totalFrames | Integer | Total frames | |
abortFrames | Integer | Abort frames | |
executingFrames | Integer | Executing frames | |
doneFrames | Integer | Done frames | |
failedFrames | Integer | Failed frames | |
framesRange | String | Frames range | |
projectName | String | Project name | |
renderConsume | BigDecimal | Task render consume | |
taskArrears | BigDecimal | Task arrears | |
submitDate | Date | Submit Date | |
startTime | Date | Start Date | |
completedDate | Date | Completed Date | |
renderDuration | Long | Task render duration | |
userName | String | User name | |
producer | String | producer | |
taskLevel | Byte | Task level | |
taskUserLevel | Integer | Task level of user | |
taskLimit | Integer | Task node limit | |
taskOverTime | Long | Task timeout reminder time | |
outputFileName | String | Output file name | |
munuTaskId | String | Dispatch id | |
layerParentId | String | About maya task,parent id | |
cgId | Integer | Task type | 2001/maya,2000/max |
taskKeyValueVo | Object | Task keyword | |
userAccountConsume | Bigdecimal | User account consume | |
couponConsume | Bigdecimal | Coupon consume | |
isOpen | Byte | Whether the front-end expansion button is expanded or not | |
taskType | String | Task type | Preprocessing, Render photon, Render picture |
renderCamera | String | Render camera | |
cloneParentId | Integer | Clone parent id | |
cloneOriginalId | Integer | Clone original id | |
shareMainCapital | Byte | Whether to Share Main Account Assets | (0:no 1:yes) |
taskRam | Integer | Task render memory | |
respRenderingTaskList | List\<TaskInfo> | Child tasks of the open task | Structure the same of this object |
layerName | String | Layer name | |
taskTypeText | String | Task type text | photon/picture |
Example of request:
task_info = api.query.task_info(task_ids_list=[14400249])
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": {
"pageCount": 1,
"pageNum": 1,
"total": 1,
"size": 100,
"items": [
{
"sceneName": "test_no_randerman_175.hip",
"id": 14400249,
"taskAlias": "2W14400249",
"taskStatus": 25,
"statusText": "render_task_status_25",
"preTaskStatus": null,
"preStatusText": null,
"totalFrames": 1,
"abortFrames": 0,
"executingFrames": 0,
"doneFrames": 1,
"failedFrames": 0,
"framesRange": "/out/geometry110-200[1]",
"projectName": "analysis_multi_project_empty_placeholder",
"renderConsume": 0.0,
"taskArrears": 0.0,
"submitDate": 1577765849000,
"startTime": 1577765851000,
"completedDate": 1577766104000,
"renderDuration": 13,
"userName": "ding625yutao",
"producer": "丁玉涛",
"taskLevel": 81,
"taskUserLevel": 0,
"taskLimit": 1,
"taskOverTime": 43200,
"overTimeStop": 86400,
"userId": 100150764,
"outputFileName": "14400249_test_no_randerman_175",
"munuTaskId": "2019123100841",
"munuTaskIds": "2019123100841",
"layerParentId": 0,
"cgId": 2004,
"userAccountConsume": 0.0,
"couponConsume": 0.039,
"qyCouponConsume": null,
"isOpen": 0,
"taskType": "GopRender",
"renderCamera": "",
"cloneParentId": 0,
"cloneOriginalId": 0,
"shareMainCapital": 0,
"taskRam": 64,
"respRenderingTaskList": null,
"layerName": "",
"taskTypeText": null,
"locationOutput": "C:/RenderFarm/Download",
"isDelete": 1,
"channel": 1,
"remark": "",
"labels": "{}",
"isOverTime": 0,
"taskKeyValueVo": {
"tiles": null,
"allCamera": null,
"renderableCamera": null
},
"waitingCount": null,
"stopType": 0
}
]
},
"serverTime": 1578046630345,
"requestId": "py6RCN-VGFzay1TZXJ2aWNlMDc-1578046630330"
}
Add a custom label¶
Interface path:/api/render/common/addLabel
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
new_name | String | Label name | |
status | Integer | Lable status | 0: on, 1: off, default is 1 |
Return parameter:default
Example of request:
task_info = api.tag.add_label(new_name="test_tag4", status=0)
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": null,
"serverTime": 1535957894211
}
Delete custom label¶
Interface path:/api/render/common/deleteLabel
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
del_name | String | Label name |
Return parameter:default
Example of request:
delete_label_name = api.tag.delete_label(del_name="test_tag2")
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": null,
"serverTime": 1535957894211
}
Obtain custom label¶
Interface path: /api/render/common/getLabelList
Request parameter:No
Return parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
projectNameList | List | Project name list | |
Object.projectName | String | Project name | |
Object.projectId | Integer | Project id |
Example of request:
label_list = api.tag.get_label_list()
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": {
"projectNameList": [
{
"projectId": 3671,
"projectName": "myLabel"
}
]
},
"serverTime": 1546998557770
}
Obtain the supported rendering software¶
Interface path:/api/render/common/querySupportedSoftware
Request parameter:No
Return parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
isAutoCommit | Integer | Choose if submit automatically or not | |
renderInfoList | List\<Software> | Renderer version list | |
defaultCgId | Integer | Default renderer ID |
Software
Parameter | Type | Description | Memo |
---|---|---|---|
cgId | Integer | Render software ID | |
cgName | String | Render software name | |
cgType | String | Render file suffix support | |
iconPath | String | Rendering software icon address | |
isNeedProjectPath | Integer | ||
isNeedAnalyse | Integer | Need to analyze | |
isSupportLinux | Integer | Indicates if linux is supported or not |
Example of request:
support_software = api.query.supported_software()
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": {
"isAutoCommit": 2,
"renderInfoList": [
{
"cgId": 2000,
"cgName": "Maya",
"cgType": "ma;mb",
"iconPath": "/img/softimage/maya.png",
"isNeedProjectPath": 1,
"isNeedAnalyse": 1,
"isSupportLinux": 1
},
{
"cgId": 2001,
"cgName": "3ds Max",
"cgType": "max",
"iconPath": "/img/softimage/max.png",
"isNeedProjectPath": 1,
"isNeedAnalyse": 1,
"isSupportLinux": 0
},
{
"cgId": 2004,
"cgName": "Houdini",
"cgType": "hip;hipnc;hiplc",
"iconPath": "/img/softimage/houdini.png",
"isNeedProjectPath": 2,
"isNeedAnalyse": 1,
"isSupportLinux": 1
},
{
"cgId": 2005,
"cgName": "Cinema 4D",
"cgType": "c4d",
"iconPath": "/img/softimage/cinema-4D.png",
"isNeedProjectPath": 1,
"isNeedAnalyse": 1,
"isSupportLinux": 0
},
{
"cgId": 2007,
"cgName": "Blender",
"cgType": "blend",
"iconPath": "/img/softimage/blender.png",
"isNeedProjectPath": 1,
"isNeedAnalyse": 1,
"isSupportLinux": 0
},
{
"cgId": 2008,
"cgName": "VR Standalone",
"cgType": "vrscene",
"iconPath": "/img/softimage/VR-standalone.png",
"isNeedProjectPath": 3,
"isNeedAnalyse": 2,
"isSupportLinux": 0
},
{
"cgId": 2012,
"cgName": "KeyShot",
"cgType": "bip",
"iconPath": "/img/softimage/keyshot.png",
"isNeedProjectPath": 2,
"isNeedAnalyse": 1,
"isSupportLinux": 0
},
{
"cgId": 2013,
"cgName": "Clarisse",
"cgType": "project;render",
"iconPath": "/img/softimage/clarisse.png",
"isNeedProjectPath": 3,
"isNeedAnalyse": 1,
"isSupportLinux": 1
}
],
"defaultCgId": 2001
},
"serverTime": 1578048938715,
"requestId": "W12mkM-VGFzay1TZXJ2aWNlMDc-1578048938685"
}
Obtain supported rendering software plugins¶
Interface path:/api/render/common/querySupportedPlugin
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
name | String | Render software ID |
Return parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
cgPlugin | List\<Plugin> | Supported plugin list | |
cgVersion | List\<Soft Version> | Supported software list |
Plugin:
Parameter | Type | Description | Memo |
---|---|---|---|
cvId | Integer | Rendering software version ID (Soft Version.id) | |
pluginName | String | Plugin name | |
pluginVersions | List\<Plugin Version> | Plugin version list |
PluginVersion
Parameter | Type | Description | Memo |
---|---|---|---|
pluginId | Integer | Plugin version ID | |
pluginName | String | Plugin name | |
pluginVersion | String | Plugin version |
SoftVersion:
Parameter | Type | Description | Memo |
---|---|---|---|
id | Integer | Render software version ID | |
cgId | Integer | Render software ID | |
cgName | String | Render software name | |
cgVersion | String | Render software version |
Example of request:
support_software_plugin = api.query.supported_plugin(name='maya')
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": {
"isAutoCommit": 2,
"renderInfoList": [
{
"cgId": 2000,
"cgName": "Maya",
"cgType": "ma;mb",
"iconPath": "/img/softimage/maya.png",
"isNeedProjectPath": 3,
"isNeedAnalyse": 1,
"isSupportLinux": 1
}
],
"defaultCgId": 2001
},
"serverTime": 1535973558961
}
New user rendering environment configuration¶
Interface path:/api/render/common/addRenderEnv
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
render_env | Dict |
render_env:
Parameter | Type | Description | Memo |
---|---|---|---|
cgId | Integer | Render software ID | Soft Version.cgId |
cgName | String | Render software name | Soft Version.cgName |
cgVersion | String | Render software version | Soft Version.cgVersion |
renderLayerType | Integer | Maya render Type | |
editName | String | render environment custom name | |
renderSystem | Integer | Render system | 0 linux, 1 windows |
pluginIds | List\<Integer> | render plugin list | Plugin Version.plugin Id |
Return parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
editName | String | render environment custom name |
Example of request:
env = {
"cgId": 2000,
"cgName": "Maya",
"cgVersion": "2020",
"renderLayerType": 0,
"editName": "testRenderEnv",
"renderSystem": "0",
"pluginIds": [1166]
}
add_user_env = api.env.add_render_env(render_env=env)
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": {
"editName": "testRenderEnv"
},
"serverTime": 1535957894211
}
Adjust user render environment configuration¶
Interface path:/api/render/common/updateRenderEnv
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
render_env | Dict |
render_env:
Parameter | Type | Description | Memo |
---|---|---|---|
cgId | Integer | Render software ID | Soft Version.cgId |
cgName | String | Render software name | Soft Version.cgName |
cgVersion | String | Render software version | Soft Version.cgVersion |
renderLayerType | Integer | Maya render Type | |
editName | String | render environment custom name | Adjust the configuration name that required a passing |
renderSystem | Integer | Render system | 0 linux, 1 windows |
pluginIds | List\<Integer> | render plugin list | Plugin Version plugin Id |
Return parameter:default
Example of request:
update_env = {
"cgId": 2000,
"cgName": "Maya",
"cgVersion": "2020",
"renderLayerType": 0,
"editName": "testRenderEnv",
"renderSystem": "0",
"pluginIds": []
}
update_user_env = api.env.update_render_env(render_env=update_env)
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": null,
"serverTime": 1536027063801
}
Delete user render environment configuration¶
Interface path:/api/render/common/deleteRenderEnv
Request parameter:
parameter | Type | Description | Memo |
---|---|---|---|
edit_name | String | render environment custom name |
Return parameter:default
Example of request:
delete_user_env = api.env.delete_render_env(edit_name="testRenderEnv")
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": null,
"serverTime": 1536027063801
}
Set up default render environment configuration¶
Interface path:/api/render/common/setDefaultRenderEnv
Request parameter:
parameter | Type | Description | Memo |
---|---|---|---|
edit_name | String | render environment custom name |
Return parameter:default
Example of request:
set_default_user_env = api.env.set_default_render_env(edit_name="testRenderEnv")
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": null,
"serverTime": 1536027063801
}
Obtain user render environment configuration¶
Interface path:/api/render/common/getRenderEnv
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
name | String | Rendering software name |
Return parameter: List<RenderEnv>
Parameter | Type | Description | Memo |
---|---|---|---|
cgId | Integer | Render software ID | |
editName | String | render environment custom name | |
cgName | String | Render software name | |
cgVersion | String | Render software version | |
osName | Integer | render environment system | 0:Linux,1:windows |
renderLayerType | Integer | ||
isDefault | Integer | Check if it is the default configuration | 0 Not default configuration 1 Is default configuration |
respUserPluginInfoVos | List\<Plugin Version> | render environment plugin list |
Example of request:
user_render_config = api.env.get_render_env(name='houdini')
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": [
{
"cgId": 2004,
"editName": "175",
"cgName": "Houdini",
"cgVersion": "17.5",
"osName": 1,
"renderLayerType": 0,
"isDefault": 0,
"projectPath": "",
"isMainUserId": 1,
"respUserPluginInfoVos": [
{
"pluginId": 5304,
"pluginName": "renderman",
"pluginVersion": "renderman 22.6"
}
]
},
{
"cgId": 2004,
"editName": "pianwan",
"cgName": "Houdini",
"cgVersion": "17.5",
"osName": 1,
"renderLayerType": 0,
"isDefault": 0,
"projectPath": "",
"isMainUserId": 1,
"respUserPluginInfoVos": []
},
{
"cgId": 2004,
"editName": "houdini_test",
"cgName": "Houdini",
"cgVersion": "17.5",
"osName": 0,
"renderLayerType": 0,
"isDefault": 0,
"projectPath": "",
"isMainUserId": 1,
"respUserPluginInfoVos": []
},
{
"cgId": 2004,
"editName": "16.5",
"cgName": "Houdini",
"cgVersion": "16.5",
"osName": 1,
"renderLayerType": 0,
"isDefault": 0,
"projectPath": "",
"isMainUserId": 1,
"respUserPluginInfoVos": []
}
],
"serverTime": 1578282315348,
"requestId": "23IhQf-VGFzay1TZXJ2aWNlMDQ-1578282315343"
}
Task Progress (Only support Max )¶
Interface path:/api/render/task/loadTaskProcessImg
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
task_id | Integer | Task ID | required |
frame_type | Integer | Frame type | 2:photon,5:picture Without transmission, the background will dynamically return the results according to the stage of the rendering task |
Return parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
width | Integer | Image resolution width | |
height | Integer | Image resolution height | |
block | Integer | Block number | |
isRenderPhoton | Boolean | Is render photon | True:task is render photon |
currentTaskType | String | Task render stage | Render: render picture RenderPhoton: render photon |
sceneName | String | Scene name+camera name | |
startTime | String | Task start time | |
endTime | String | Task end time | |
grabInfo | List\<List\<dict>> | Block frame info |
Block frame info:grabInfo
Parameter | Type | Description | Memo |
---|---|---|---|
startTime | String | Start time | |
endTime | String | End time | |
frameStatus | String | Frame status | |
isMaxPrice | String | Is max picture | |
feeAmount | String | Fee amount | |
couponFee | String | Coupon fee | |
frameIndex | String | Frame number | |
frameBlock | String | Block number | |
framePercent | String | Frame render percent | |
frameUsed | String | Frame render time consumed | |
frameEst | String | Predicted Remaining Time for Frame Rendering | |
renderInfo | String | Frame Rendering Progress Information | |
grabUrl | String | Frame Rendering Schedule Connection Address |
Example of request:
task_processing_img = api.query.get_task_processing_img(task_id=14470635, frame_type=2)
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": {
"isRenderPhoton": true,
"completedTime": "2020-01-03 10:02:55",
"currentTaskType": "RenderPhoton",
"sceneName": "翻新就沙发.max-Camera001",
"grabInfo": [
[
{
"couponFee": "1.04",
"frameIndex": "0",
"renderInfo": "",
"frameBlock": null,
"frameEst": "0",
"grabUrl": "/mnt/output/d2_1/small_pic/100033000/100033433/14470635/RenderPhoton_2020010200306_0_rayvision0000[-]tga.jpg",
"feeAmount": "0.00",
"frameUsed": "174",
"frameStatus": "4",
"framePercent": "100",
"isMaxPrice": "0",
"startTime": "2020-01-03 09:57:18",
"endTime": "2020-01-03 10:00:12"
}
]
],
"width": 700,
"block": 1,
"startTime": "2020-01-02 09:35:51",
"height": 518
},
"serverTime": 1578299393862,
"requestId": "qELLr0-VGFzay1TZXJ2aWNlMDc-1578299393837"
}
Task Setting Of Over Time Stop¶
Interface path:/api/render/task/setOverTimeStop
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
task_id_list | List\<Integer> | Task ID | required |
overtime | Long | Time of Task stop | Required,unit:second |
Example of request:
set_task_overtime = api.task.set_task_overtime_top(task_id_list=[14684405], overtime=60)
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": "SUCCESS",
"serverTime": 1578308287155,
"requestId": "8VNTma-VGFzay1TZXJ2aWNlMDc-1578308286842"
}
Task thumbnail¶
Interface path:/api/render/task/loadingFrameThumbnail
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
frame_id | Integer | Yes | Frame ID |
frame_status | Integer | Yes | A value of 4 means complete, only thumbnails are available when completed |
Example of request:
frame_thumbnall = api.query.get_frame_thumbnall(frame_id=230772361)
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": "SUCCESS",
"serverTime": 1578308287155,
"requestId": "8VNTma-VGFzay1TZXJ2aWNlMDc-1578308286842"
}
Get Raysync transmission message¶
Interface path:api/render/task/getTransferServerMsg
Request parameter:No
Example of request:
transfer_server_msg = api.query.get_transfer_server_msg()
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": {
"clientVersion": "3.2.8.2",
"protocolVersion": "3.2.8.2",
"raysyncTransfer": {
"serverIp": "127.0.0.1",
"serverPort": 2121,
"proxyIp": "42.123.110.38",
"proxyPort": 32001,
"sslPort": 2443,
"port": 2442
}
},
"serverTime": 1565678980735,
"requestId": "YenJW9-1565678980088"
}
Get Raysync authentication key¶
Interface path:/api/render/user/getRaySyncUserKey
Request parameter:No
Example of request:
raysync_user_key = api.query.get_raysync_user_key()
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": {
"channel": 2,
"platform": 2,
"signature": "rayvision2017",
"version": "1.0.0",
"userKey": "5394a44e890557d8d937b92086482dab",
"id": 1868599,
"userName": "wsh_12345",
"zone": 1,
"phone": "183160224171",
"email": "testwangshunhui@rayvision",
"loginTime": 1565682011157,
"infoStatus": 0,
"accountType": 2,
"shareMainCapital": 0,
"subDeleteTask": 0,
"subDeleteCapital": 1,
"useMainBalance": 0,
"downloadDisable": 0,
"raySyncUserKey": "40d59041f72809ffaa16146a36780595666c681e"
},
"serverTime": 1565682019430,
"requestId": "4lkn0I-1565682010026"
}
Full Speed Render¶
Interface path:/api/render/task/fullSpeed
Request parameter:
Parameter | Type | Description | Memo |
---|---|---|---|
task_id_list | List\<Integer> | Yes | Task id |
Example of request:
full_speed_render = api.task.full_speed(task_id_list=[13652193])
Example of return:
{
"version": "1.0.0",
"result": true,
"message": "success",
"code": 200,
"data": "成功",
"serverTime": 1578311448826,
"requestId": "X81MN5-VGFzay1TZXJ2aWNlMDQ-1578311448620"
}
Log Management¶
Warning
Make sure local Python environment and PIP are available before use.
Demo¶
rayvision_log An example is given as follows: demo
import logging
from rayvision_log import init_logger
package_name = 'mylog'
init_logger(package_name)
logging.info('test')
Set the log path¶
- Default path
Mac OS X:
~/Library/Logs/<AppName>/Logs/<username>/<hostname>.log
Unix:
~/.cache/<AppName>/log/Logs/<username>/<hostname>.log
Window:
C:Users<username>AppDataLocal<AppAuthor><AppName>Logs<username><hostname>.log
- Customized path
- Define parameter:
RAYVISION_LOG_ROOT = "xxxx"
- Set RAYVISION_LOG_ROOT as environment variable
- The log files will be saved in RAYVISION_LOG_ROOT
Log interface¶
Basic logging setup.
-
rayvision_log.core.
get_default_log_config
()¶ Get the default logging configuration.
Returns: The default logging configuration. Return type: dict
-
rayvision_log.core.
init_logger
(app_name)¶ Initialize logging with our default configuration.
An easier interface for artists to use to create loggers in their packages and applications. Any application that uses this will use the default logging configuration.
Examples
>>> import logging >>> from rayvision_log import init_logger >>> app_name = "rayvision_api" >>> init_logger(app_name) >>> LOG = logging.getLogger(app_name)
Parameters: app_name (str) – The application or package name for which to create a logger.
-
rayvision_log.core.
set_up_logger
(app_name, log_config)¶ Set up loggers based on given name and configuration.
Example
>>> app_name = "rayvision_api" >>> log_config = { formatters: { file: { format: '%(asctime)s [%(levelname)s] %(name)s: %(message)s' } }, handlers: { file: { class: concurrent_log_handler.ConcurrentRotatingFileHandler } } }
Parameters: References
Note
Mainly to verify the analysis results
Task Information Verification¶
Mainly to check task information (task_info) and uploading (upload) asset information. Whether it is automated analysis using the SDK or user-defined local analysis, the result must be verified in this step.
Check the analysis results.
Check the analysis of the task information and upload asset information.
-
class
rayvision_api.task.check.
RayvisionCheck
(api, analyze=None, workspace=None)¶ Bases:
object
Check the analysis results.
-
check_analyze
(analyze, workspace, is_cover=True)¶ Initializes the configuration file information.
-
check_error_warn_info
(language='0')¶ Check the error in the analysis scenario.
According to the status code of the analyzed error information, the API interface is called to obtain detailed error information and solutions, and the warning information is printed out, and the number of error information is recorded.
Parameters: - language (str) – The language that identifies the details of the
- obtained, 0 (error) – Chinese (default) 1: English.
Returns: List of detailed descriptions of errors.
Return type:
-
static
check_path
(tmp_path)¶ Check if the path exists.
-
check_task_info
(task_info)¶ Check and add the required parameter information.
-
check_workspace
(workspace)¶ Check the working environment.
Parameters: workspace (str) – Workspace path. Returns: Workspace path. Return type: str
-
execute
(task_json, upload_json='', asset_json='', is_cover=True, only_id=True)¶ Check asset configuration information.
Check the scene for problems and filter unwanted configuration information. :param is_cover: Whether the updated json file overwrites the file under the original path,
by default ‘True’.
-
get_json_info
(data)¶
-
is_scene_have_error
()¶ Check the scene.
Determine whether the scene has an error based on the number of serious errors.
Raises: RayvisionError
– There is a problem with the scene.
-
write
(only_id=True)¶ Check and write to a json file.
-
Transfer¶
RayvisionTransfer Class¶
Transfer Module.
Execute the cmd command to make the last asset and download assets.
-
class
rayvision_sync.transfer.
RayvisionTransfer
(config_bid, input_bid, domain, platform, local_os, user_id, output_bid=None, manage_task=None)¶ Bases:
object
Transfer including upload files and download files.
-
create_cmd
(cmd_params, db_ini_path=None)¶ Splice a cmd command.
Parameters: - cmd_params (list) –
Parameters required by the cmd command.
Examples:
[ transmit_type, # Transmission type local_path, # Local file path output_file_name, # File path uploaded to the server max_speed, # Maximum transfer speed of upload 'true', # Whether to save the path 'output_bid', # Transfer id ]
- db_ini_path (str) – Database path.
Returns: Cmd command.
Return type: - cmd_params (list) –
-
static
init_transmitter
(current_dir, local_os)¶ Gets the path of the transfer software.
Parameters: - current_dir – transfer base directory.
- local_os – system name, Only support “window” or “linux”
Returns: transfer software absolute path.
-
parse_transports_json
(transports_json=None, domain=None, platform=None)¶ Analyze transports.json,obtain transfer server info.
Extract the transmission configuration information of the corresponding platform in transports.json.
Parameters: Returns: - Transfer configuration information
- .e.g:
- {
“engine_type”:”aspera”, “server_name”:”HKCT”, “server_ip”:”render-client.raysync.cn”, “server_port”:”10221”
}
Return type:
-
RayvisionManageTask Class¶
Manage operations after generating tasks.
-
class
rayvision_sync.manage.
RayvisionManageTask
(query)¶ Bases:
object
Processing asset information for a task.
-
find_task_status_codes
(task_status_list)¶ Get the task status code from the task information list.
Parameters: task_status_list (list) – Task information list. e.g.:
- [
- {
- “task_id”:”111”, “task_status_code”:”25”, “task_status_text”:”render_task_status_25”, “task_status_description”:”Done”, “is_opener”:”0”, “output_file_name”:”111_test”, “sub_task_status”:[]
}, {
”task_id”:”222”, “task_status_code”:”0”, “task_status_text”:”render_task_status_0”, “task_status_description”:”Waiting”, “is_opener”:”1”, “output_file_name”:None, “sub_task_status”:[]},
]
Returns: - Task status code list.
- e.g.:
- [
- “25”, “10”, “35”
]
Return type: list
-
get_task_status
(task_id_list)¶ Get information about each task in the task id list.
Call the API interface to get the
items
information of each task, and process it.Parameters: task_id_list (list of int) – Task id list. Returns: - Information about each task id.
- e.g.:
- [
- {
- “task_id”:”111”, “task_status_code”:”25”, “task_status_text”:”render_task_status_25”, “task_status_description”:”Done”, “is_opener”:”0”, “output_file_name”:”111_test”, “sub_task_status”:[]
}, {
”task_id”:”222”, “task_status_code”:”0”, “task_status_text”:”render_task_status_0”, “task_status_description”:”Waiting”, “is_opener”:”1”, “output_file_name”:None, “sub_task_status”:[]},
]
Return type: list
-
is_task_end
(task_id)¶ Check if the task rendering ends.
Parameters: task_id (int) – Task id Returns: - True: end of task rendering, False/None: Task rendering is
- not over.
Return type: bool
-
output_file_names
(task_status_list)¶ Get the name of the output scene to download.
Parameters: task_status_list (list) – Task information list. Returns: - Output scene name.
- e.g.:
- [
- “block_scene”, “name_scene”,
]
Return type: list
-
task_info_iterater
(task_info_list)¶ Item information for each task, extracted and organized.
Parameters: task_info_list (list) – Some details about the task. e.g.:
- [
- {
- “sceneName”: “demo_scenc.mb”,
“id’: 6419169,
“taskAlias’: “2W6419169”,
“taskStatus’: 0,
“statusText’: “render_task_status_0”,
“preTaskStatus”: None,
“preStatusText”: None,
“totalFrames”: 10,
“abortFrames”: 0,
“executingFrames”: 0,
“doneFrames”: 0,
“failedFrames”: 0,
“framesRange”: “1-10[1]”,
“projectName”: “Project1”,
“renderConsume”: None,
“taskArrears”: 0.0,
“submitDate”: 1563356906040,
“startTime”: None,
“completedDate”: None,
“renderDuration”: 0,
“userName”: “mxinye12”,
“producer”: “,
“taskLevel”: 80,
“taskUserLevel”: 0,
“taskLimit”: 3,
“taskOverTime”: 12,
“overTimeStop”: 28800,
“userId”: 100093088,
“outputFileName”: “6419169_demo_scenc”,
“munuTaskId”: “2019071702241”,
“layerParentId”: 0,
“cgId”: 2000,
“userAccountConsume”: None,
“couponConsume”: None,
“qyCouponConsume”: None,
“isOpen”: 0,
“taskType”: “Render”,
“renderCamera”: “perspShape”,
“cloneParentId”: 0,
“cloneOriginalId”: 0,
“shareMainCapital”: 0,
“taskRam”: 64,
“respRenderingTaskList”: None,
“layerName”: “,
“taskTypeText”: “render_major_picture_task”,
“locationOutput”: “,
“isDelete”: 1,
“channel”: 4,
“remark”: “gdgsgsg”,
“isOverTime”: 0,
“taskKeyValueVo”: {”tiles”: None, “allCamera”: None, “renderableCamera”: None
}, “waitingCount”: None
}, {}
]
Returns: - Information about each task id.
- e.g.:
- [
- {
- “task_id”:”111”, “task_status_code”:”25”, “task_status_text”:”render_task_status_25”, “task_status_description”:”Done”, “is_opener”:”0”, “output_file_name”:”111_test”, “sub_task_status”:[]
}, {
”task_id”:”222”, “task_status_code”:”0”, “task_status_text”:”render_task_status_0”, “task_status_description”:”Waiting”, “is_opener”:”1”, “output_file_name”:”fasfafe”, “sub_task_status”:[]},
]
Return type: list
-
Upload¶
Upload models.
Upload the scene’s configuration file and asset file.
-
class
rayvision_sync.upload.
RayvisionUpload
(api, db_config_path=None)¶ Bases:
object
Upload files.
Upload configuration files and asset files.
-
check_transfer_log_path
(transfer_log_path)¶ Check the log location of the transport engine.
-
create_db_ini
(upload_json_path)¶ Create the database configuration file.
Parameters: upload_json_path (str) – Upload json path. Returns: Configuration file path. Return type: str
-
load_db_config
(db_config_path=None)¶
-
multi_thread_upload
(upload_pool, thread_num=10)¶ muti thread upload resource.
Parameters:
-
thread_pool_upload
(upload_pool, pool_size=10)¶ Thread pool upload.
Parameters:
-
upload
(task_id, task_json_path, tips_json_path, asset_json_path, upload_json_path, max_speed=None)¶ Run the cmd command to upload the configuration file.
Parameters: - task_id (str, optional) – Task id.
- task_json_path (str, optional) – task.json file absolute path.
- tips_json_path (str, optional) – tips.json file absolute path.
- asset_json_path (str, optional) – asset.json file absolute path.
- upload_json_path (str, optional) – upload.json file absolute path.
- max_speed (str) – Maximum transmission speed, default value is 1048576 KB/S.
Returns: True is success, False is failure.
Return type:
-
upload_asset
(**kwargs)¶ Handle.
-
upload_config
(task_id, config_file_list, max_speed=None)¶ Run the cmd command to upload configuration profiles.
Parameters: Returns: True is success, False is failure.
Return type:
-
Download¶
Download models.
Including download, automatic download (the task is fully rendered, one frame is downloaded after downloading one frame), download so the un-downloaded task is recorded (the task is rendered).
-
class
rayvision_sync.download.
RayvisionDownload
(api)¶ Bases:
object
Downloader.
Download all the passed tasks by calling the cmd command.
-
auto_download
(task_id_list=None, max_speed=None, print_log=False, sleep_time=10, download_filename_format='true', local_path=None)¶ Automatic download (complete one frame download).
Wait for all downloads to update undownloaded records.
Parameters: - task_id_list (list of int) – List of tasks ids that need to be downloaded.
- max_speed (str, optional) – Download speed limit, The unit of ‘max_speed’ is KB/S,default value is 1048576 KB/S, means 1 GB/S.
- print_log (bool, optional) – Print log, True: print, False: not print.
- sleep_time (int, optional) – Sleep time between download, unit is second.
- download_filename_format – File download local save style, “true”: tape task ID and scene name, “false” : download directly without doing processing.
- local_path (str) – Download file locally save path, default Window system is “USERPROFILE” environment variable address splicing “renderfarm_sdk”, Linux system is “HOME” environment variable address splicing “renderfarm_sdk”.
Returns: True is success.
Return type:
-
auto_download_after_task_completed
(task_id_list=None, max_speed=None, print_log=True, sleep_time=10, download_filename_format='true', local_path=None)¶ Auto download after the tasks render completed.
Parameters: - task_id_list (list of int) – List of tasks ids that need to be downloaded.
- max_speed (str, optional) – Download speed limit, The unit of ‘max_speed’ is KB/S,default value is 1048576 KB/S, means 1 GB/S.
- print_log (bool, optional) – Print log, True: print, False: not print.
- sleep_time (int, optional) – Sleep time between download, unit is second.
- download_filename_format – File download local save style, “true”: tape task ID and scene name, “false” : download directly without doing processing.
- local_path (str) – Download file locally save path, default Window system is “USERPROFILE” environment variable address splicing “renderfarm_sdk”, Linux system is “HOME” environment variable address splicing “renderfarm_sdk”.
Returns: True is success.
Return type:
-
static
check_params
(task_id_list, custom_server_output_path)¶ Check the parameters.
Task_id_list and custom_server_output_path must have one.
-
download
(task_id_list=None, max_speed=None, print_log=True, download_filename_format='true', local_path=None, server_path=None)¶ Download and update the undownloaded record.
Parameters: - task_id_list (list of int) – List of tasks ids that need to be downloaded.
- max_speed (str, optional) – Download speed limit,
The unit of
max_speed
is KB/S,default value is 1048576 KB/S, means 1 GB/S. - print_log (bool, optional) – Print log, True: print, False: not print.
- download_filename_format – File download local save style, “true”: tape task ID and scene name, “false” : download directly without doing processing.
- local_path (str) – Download file locally save path, default Window system is “USERPROFILE” environment variable address splicing “renderfarm_sdk”, Linux system is “HOME” environment variable address splicing “renderfarm_sdk”,
- server_path (str or list) – The user customizes the file structure to be downloaded from the output server, and all file structures are downloaded by default, example: “18164087_test/l_layer”.
Returns: True is success.
Return type:
-
Maya¶
Analyse assets, save the result as a local json file. Before analysis, verify initial configuration info.
Clarisse¶
Analyse assets, save the result as a local json file. Before analysis, verify initial configuration info.
A interface for clarisse.
-
class
rayvision_clarisse.analyse_clarisse.
AnalyzeClarisse
(cg_file, software_version, project_name=None, plugin_config=None, render_software='Clarisse', local_os=None, workspace=None, custom_exe_path=None, platform='2')¶ Bases:
object
-
add_tip
(code, info)¶ Add error message.
Parameters:
-
analyse
(no_upload=False)¶ Analytical master method for clarrise.
-
analyse_cg_file
()¶ Start analyse cg file.
- Examples cmd command:
“D:/myproject/internal_news/rayvision_clarisse/rayvision_clarisse /tool/Analyze.exe” -cf “E:/copy/DHGB_sc05_zhuta_610-1570_v0102.project” -tj
“c:/workspace/work/10398483/task.json”
-
static
check_local_os
(local_os)¶ Check the system name.
Parameters: local_os (str) – System name. Returns: str
-
static
check_path
(tmp_path)¶ Check if the path exists.
-
check_result
()¶ Check that the analysis results file exists.
-
check_workspace
(workspace)¶ Check the working environment.
Parameters: workspace (str) – Workspace path. Returns: Workspace path. Return type: str
-
gather_upload_dict
()¶ Gather upload info.
Examples
- {
- “asset”: [
- {
- “local”: “E:/copy/muti_layer_test.ma”, “server”: “/E/copy/muti_layer_test.ma”
}
]
}
-
get_file_md5
(file_path)¶ Generate the md5 values for the scenario.
-
save_tips
()¶ Write the error message to tips.json.
-
write_task_json
()¶ The initialization task.json.
-
write_tips_info
()¶ Write tips info.
-
Houdini¶
Analyse assets, save the result as a local json file. Before analysis, verify initial configuration info.
Exception management¶
Customized exception handling
Error message.
CG errors.
-
exception
rayvision_utils.exception.exception.
AnalyseFailError
¶ Bases:
rayvision_utils.exception.exception.AnalyzeError
Analyse Fail Error.
-
exception
rayvision_utils.exception.exception.
AnalyzeError
¶ Bases:
Exception
Analyze has a damage error.
-
exception
rayvision_utils.exception.exception.
CGExeNotExistError
¶ Bases:
rayvision_utils.exception.exception.AnalyzeError
No errors in CG boot.
-
exception
rayvision_utils.exception.exception.
CGFileNameIllegalError
¶ Bases:
rayvision_utils.exception.exception.AnalyzeError
CG File Name Illegal Error.
-
exception
rayvision_utils.exception.exception.
CGFileNotExistsError
¶ Bases:
rayvision_utils.exception.exception.AnalyzeError
CG file does not exist error.
-
exception
rayvision_utils.exception.exception.
CGFileZipFailError
¶ Bases:
rayvision_utils.exception.exception.AnalyzeError
CG file compression failed error.
-
exception
rayvision_utils.exception.exception.
CompressionFailedError
¶ Bases:
Exception
Compression failed error.
-
exception
rayvision_utils.exception.exception.
DecompressionFailedError
¶ Bases:
Exception
Unzip failed error.
-
exception
rayvision_utils.exception.exception.
FileNameContainsChineseError
¶ Bases:
rayvision_utils.exception.exception.AnalyzeError
File Name Contains Chinese Error.
-
exception
rayvision_utils.exception.exception.
GetCGLocationError
¶ Bases:
rayvision_utils.exception.exception.AnalyzeError
Error getting CG local path.
-
exception
rayvision_utils.exception.exception.
GetCGVersionError
¶ Bases:
rayvision_utils.exception.exception.AnalyzeError
Error getting CG version.
-
exception
rayvision_utils.exception.exception.
GetRendererError
¶ Bases:
rayvision_utils.exception.exception.AnalyzeError
Get renderer error.
-
exception
rayvision_utils.exception.exception.
MaxDamageError
¶ Bases:
rayvision_utils.exception.exception.AnalyzeError
Max has a damage error.
-
exception
rayvision_utils.exception.exception.
MaxExeNotExistError
¶ Bases:
rayvision_utils.exception.exception.AnalyzeError
There are no errors in the Max startup file.
-
exception
rayvision_utils.exception.exception.
MultiScatterAndVrayConfilictError
¶ Bases:
rayvision_utils.exception.exception.AnalyzeError
Multi scatter and vray Confilict error.
-
exception
rayvision_utils.exception.exception.
ProjectMaxVersionError
¶ Bases:
rayvision_utils.exception.exception.AnalyzeError
Project Max version error.
-
exception
rayvision_utils.exception.exception.
RayvisionAPIError
(error_code, error, request)¶ Bases:
rayvision_utils.exception.exception.RayvisionError
Raise RayVisionAPIError.
-
exception
rayvision_utils.exception.exception.
RayvisionError
(error_code, error, *args, **kwargs)¶ Bases:
Exception
Raise RayvisionError if something wrong.
-
class
rayvision_utils.exception.exception.
RayvisionHTTPErrorProcessor
¶ Bases:
urllib.request.HTTPErrorProcessor
Process HTTP error responses.
Inherit HTTPErrorProcessor in urllib2.
-
http_response
(request, response)¶ Override the http_response method of HTTPErrorProcessor.
Process the response,when it is a bad Request,the corresponding exception is reported.
Parameters: - request (urllib2.Request) – Request object.
- response (opener.open) – Response object.
Returns: Abnormal response.
Return type:
-
-
exception
rayvision_utils.exception.exception.
RayvisonTaskIdError
(error)¶ Bases:
rayvision_utils.exception.exception.RayvisionError
Raise RayVisonTaskIdError.
-
exception
rayvision_utils.exception.exception.
VersionNotMatchError
¶ Bases:
rayvision_utils.exception.exception.AnalyzeError
Version not match error.
Handle tips messages and write them to tips.json.
-
class
rayvision_utils.exception.tips.
TipsInfo
(save_path=None)¶ Bases:
object
Handling errors encountered in the analysis.
-
add
(key, *values)¶ Add tips message.
Parameters:
-
save_and_exit
(path, exit_code=-1)¶ Save the prompt to the tips.json file and exit.
Parameters:
-
Detailed parameter configuration¶
Clarisse¶
Analyze clarisse scene and save the output as task.json, asset.json, upload.json and tips.json.
1.task.json¶
File to save the analysis result of the scene, including scene name, cg software version, render settings, etc.
task.json example
{
"scene_info_render": {
"image_node": [
{
"frames": "0-50[1]",
"renderable": "0",
"output": "D:\\temp\\cam02",
"format": "exr16",
"LUT": "linear",
"save_to_disk": "1",
"name": "project://scene/cam02",
"layers": [
{
"frames": "0-50[1]",
"renderable": "1",
"output": "D:\\temp\\cam02_layer02",
"format": "exr16",
"enable_deep_output": "1",
"save_to_disk": "1",
"enable_deep_output_path": "D:\\temp\\cam02_layer02_deep",
"name": "project://scene/cam02.cam02_layer02"
}
]
}
]
},
"software_config":{
"plugins":{},
"cg_version":"clarisse_ifx_4.0_sp3",
"cg_name":"Clarisse"
},
"task_info":{
"task_stop_time":"259200",
"frames_per_task":"1",
"channel":"4",
"task_id":"11022523",
"project_name":"Project1",
"platform":"2",
"tiles":"1",
"is_picture":"0",
"project_id":"200953",
"job_stop_time":"86400",
"distribute_render_node":"3",
"stop_after_test":"2",
"clone_original_id":"",
"ram":"64",
"render_layer_type":"0",
"test_frames":"000",
"graphics_cards_num":"2",
"edit_name":"",
"pre_frames":"000",
"input_project_path":"",
"is_layer_rendering":"1",
"is_distribute_render":"0",
"time_out":"43200",
"tiles_type":"block",
"user_id":"100150764",
"cg_id":"2013",
"input_cg_file":"E:/copy/DHGB_sc05_zhuta_610-1570_v0102.project",
"os_name":"1"
},
"scene_info":{
"image_node": [
{
"frames": "0-50[1]",
"renderable": "0",
"output": "D:\\temp\\cam02",
"format": "exr16",
"LUT": "linear",
"save_to_disk": "1",
"name": "project://scene/cam02",
"layers": [
{
"frames": "0-50[1]",
"renderable": "1",
"output": "D:\\temp\\cam02_layer02",
"format": "exr16",
"enable_deep_output": "1",
"save_to_disk": "1",
"enable_deep_output_path": "D:\\temp\\cam02_layer02_deep",
"name": "project://scene/cam02.cam02_layer02"
}
]
}
]
}
}
task.json parameters:
parameter | type | description | example |
---|---|---|---|
software_config | object | environment(cg software, version and plugins, etc.) | refer to software_config |
task_info | object | render settings(priority frames, render range, etc.) | refer to task_info |
scene_info_render | object | analysis result(render node, output, etc.) | refer to scene_info_render |
software_config
parameter | type | description | example |
---|---|---|---|
cg_name | string | software | “Clarisse” |
cg_version | string | software version | “clarisse_ifx_4.0_sp3” |
plugins | object | plugin{name, version} | {} |
task_info
parameter | type | description | example |
---|---|---|---|
is_layer_rendering | string | render layer mode,”0”:off, “1”:on | “1” |
cg_id | string | software id.”2013”: Clarisse | “2013” |
ram | string | ram,64/128 | “64” |
os_name | string | os, “0”:Linux; “1”: Windows | “0” |
render_layer_type | string | render layer mode,”0”:renderlayer,”1”:rendersetup | “0” |
is_distribute_render | string | distributed render mode,”0”:off, “1”:on | “0” |
input_cg_file | string | input file path | “E:/copy/DHGB_sc05_zhuta_610-1570_v0102.project” |
job_stop_time | string | Set the frame timeout time, will only affect the current frame, unit seconds | “28800” |
user_id | string | user id | |
pre_frames | string | priority frames | “000:1,3-4[1]” |
platform | string | platform id | “2” |
is_picture | string | if it’s architectural rendering | “0” |
project_id | string | project id | “200953” |
channel | string | submit manner。”4”:API/SDK | “4” |
tiles_type | string | “block,strip” | “block” |
tiles | string | tile number, 1 for single node, greater than 1 for tiles rendering(multi-nodes) | “1” |
project_name | string | project name | “test” |
distribute_render_node | string | nodes number for distributed rendering | “3” |
frames_per_task | string | frames per task | “1” |
stop_after_test | string | “1”:pause after priority render, “2”:continue after priority render | |
input_project_path | string | project path, could be empty | |
task_id | string | task id | |
task_stop_time | string | Set the task timeout time. The task timeout stops all frames in unit seconds,unit: sec | “86400” |
time_out | string | Overtime reminder time, unit: sec | “43200” |
scene_info_render
para | type | description | example |
---|---|---|---|
image_node | object | general info | refer to scene_info_render.image_node |
scene_info_render.image_node
parameter | type | description | example |
---|---|---|---|
renderable | string | “0”, do not open rendering, “1” : open rendering (this is not the value in the scene, the platform is not open by default, the platform is not recommended to directly render image) | “0” |
output | string | output path of current image | “D:tempcam02” |
format | string | the output format for the current image | “exr16” |
LUT | string | the output color management of the current image | “linear” |
save_to_disk | string | Whether to open save output for the current image | “1” |
name | string | the name of the current image is also the path in the scene | “project://scene/cam02” |
layers | string | The value of 3dlayer in the current image is list, and the value of list is dict | refer to scene_info_render.image_node.layers |
frames | string | frame range | “0-50[1]” |
scene_info_render.image_node.layers
parameter | type | description | example |
---|---|---|---|
frames | string | frame range | “0-50[1]” |
renderable | string | “1” | |
output | string | output path | “D:\temp\cam02_layer02” |
format | string | image format | “exr16” |
enable_deep_output | string | “1” | |
save_to_disk | string | “3” | |
enable_deep_output_path | string | deep output path | “D:\temp\cam02_layer02_deep” |
name | string | layer name | “project://scene/cam02.cam02_layer02” |
2.upload.json¶
File to save assets info.
upload.json
{
"scene": [
{
"local": "E:\\work\\Trex\\ep\\ani_fly\\clarisse\\trex_fly_env_songshu.project",
"server": "/E/work/Trex/ep/ani_fly/clarisse/trex_fly_env_songshu.project"
}
],
"asset": [
{
"local": "E:\\work\\Trex\\ep\\ani_fly\\clarisse\\assets\\speedtree\\guanmu01\\LeafHD2.png",
"server": "/E/work/Trex/ep/ani_fly/clarisse/assets/speedtree/guanmu01/LeafHD2.png"
},
{
"local": "E:\\work\\Trex\\ep\\ani_fly\\clarisse\\assets\\speedtree\\tree_far\\tree_far08\\HuangshanPineBark_Normal.png",
"server": "/E/work/Trex/ep/ani_fly/clarisse/assets/speedtree/tree_far/tree_far08/HuangshanPineBark_Normal.png"
}
]
}
upload.json
param | type | description | example |
---|---|---|---|
asset | object | assets info | refer to asset对象解析 |
scene | object | scene info | refer to scene对象解析 |
asset
param | type | description | example |
---|---|---|---|
local | string | local path of asset | “E:\work\Trex\ep\ani_fly\clarisse\assets\speedtree\guanmu01\LeafHD2.png” |
server | string | relative path of server | “/E/work/Trex/ep/ani_fly/clarisse/assets/speedtree/guanmu01/LeafHD2.png” |
scene
param | type | description | example |
---|---|---|---|
local | string | local path of project | “E:\work\Trex\ep\ani_fly\clarisse\trex_fly_env_songshu.project” |
server | string | relative path of server | “/E/work/Trex/ep/ani*fly/clarisse/trex_fly_env_songshu.project” |
Houdini¶
Analyze houdini scene and save the output as task.json, asset.json, upload.json and tips.json.
1.task.json¶
File to save the analysis result of the scene, including scene name, cg software version, render settings, etc.
task.json example
{
"scene_info_render": {
"rop_node": [
{
"node": "/out/mantra1",
"frames": "1-10[1]",
"option": "-1",
"render": "1"
}
],
"geo_node": []
},
"task_info": {
"is_layer_rendering": "1",
"cg_id": "2004",
"ram": "64",
"os_name": "1",
"render_layer_type": "0",
"is_distribute_render": "0",
"input_cg_file": "D:/gitlab/renderSDK/scenes/houdini_test/sphere.hip",
"job_stop_time": "28800",
"user_id": "10000031",
"pre_frames": "000",
"platform": "2",
"is_picture": "0",
"project_id": "3316",
"channel": "4",
"tiles_type": "block",
"tiles": "1",
"project_name": "dasdd",
"distribute_render_node": "3",
"frames_per_task": "1",
"stop_after_test": "2",
"input_project_path": "",
"task_id": "440149",
"task_stop_time": "86400",
"time_out": "12"
},
"software_config": {
"cg_version": "16.5.268",
"cg_name": "Houdini",
"plugins": {}
}
}
task.json parameters
parameter | type | description | example |
---|---|---|---|
software_config | object | environment(cg software, version and plugins, etc.) | refer to software_config |
task_info | object | render settings(priority frames, render range, etc.) | refer to task_info |
scene_info_render | object | analysis result(render node, output, etc.) | refer to scene_info_render |
software_config
parameter | type | description | example |
---|---|---|---|
cg_name | string | software | “Houdini” |
cg_version | string | software version | “16.5.268” |
plugins | dict | plugin{name, version} | {} |
task_info
parameter | type | description | example |
---|---|---|---|
is_layer_rendering | string | render layer mode,”0”:off, “1”:on | “1” |
cg_id | string | software id.”2004”: Houdini | “2004” |
ram | string | ram,64/128 | “64” |
os_name | string | os, “0”:Linux; “1”: Windows | “0” |
render_layer_type | string | render layer mode,”0”:renderlayer,”1”:rendersetup | “0” |
is_distribute_render | string | distributed render mode,”0”:off, “1”:on | “0” |
input_cg_file | string | input file path | |
job_stop_time | string | Set the frame timeout time, will only affect the current frame, unit seconds | “28800” |
user_id | string | user id | |
pre_frames | string | priority frames | “000:1,3-4[1]” |
platform | string | platform id | “2” |
is_picture | string | if it’s architectural rendering | “0” |
project_id | string | project id | |
channel | string | submit manner。”4”:API/SDK | “4” |
tiles_type | string | “block,strip” | “block” |
tiles | string | tile number, 1 for single node, greater than 1 for tiles rendering(multi-nodes) | “1” |
project_name | string | project name | “test” |
distribute_render_node | string | nodes number for distributed rendering | “3” |
frames_per_task | string | frames per task | “1” |
stop_after_test | string | “1”:pause after priority render, “2”:continue after priority render | |
input_project_path | string | project path, could be empty | |
task_id | string | task id | |
task_stop_time | string | Set the task timeout time. The task timeout stops all frames in unit seconds,unit: sec | “86400” |
time_out | string | Overtime reminder time, unit: sec | “43200” |
scene_info_render
parameter | type | description |
---|---|---|
rop_node | object | render node |
geo_node | object | simulation node |
scene_info_render.rop_node and geo_node
parameter | type | description | example |
---|---|---|---|
node | string | rop / geo full path | “/out/mantra1” |
frames | string | rop / frame range | “1-10[1]” |
option | string | rop / render/simulation id, -1:render, other:number of nodes for simulation | “-1” |
render | string | rop / whether to activate rendering, 1:active(render/simulation),0:inactive | “1” |
2.upload.json¶
File to save assets info
upload.json
{
"asset": [
{
"local": "D:/gitlab/renderSDK/scenes/houdini_test/sphere.hip",
"server": "/D/gitlab/renderSDK/scenes/houdini_test/sphere.hip"
}
]
}
upload.json
parameter | type | description | example |
---|---|---|---|
asset | object | Asset path information that needs to be uploaded | refer to asset 配置文件文档之Houdini.html#header-n338 |
asset
parameter | type | description | example |
---|---|---|---|
local | string | local path of asset | “D:/gitlab/renderSDK/scenes/houdini_test/sphere.hip” |
server | string | relative path of server | “/D/gitlab/renderSDK/scenes/houdini_test/sphere.hip” |
Maya¶
Analysis:analyze maya scene and save the output as task.json, asset.json, upload.json and tips.json.
1.task.json¶
File to save the analysis result of the scene, including scene name, cg software version, render settings, etc.
task.json example
{
"scene_info_render": {
"defaultRenderLayer": {
"renderable": "1",
"env": {},
"is_default_camera": "1",
"option": "",
"common": {
"image_format": "exr",
"end": "10",
"width": "960",
"image_file_prefix": "",
"all_camera": [
"stereoCameraRightShape",
"stereoCameraLeftShape",
"stereoCameraCenterCamShape",
"perspShape",
"cameraShape2",
"cameraShape1"
],
"render_camera": [
"cameraShape1"
],
"start": "1",
"animation": "False",
"renderer": "mentalRay",
"frames": "1-10[1]",
"height": "540",
"renumber_frames": "False",
"by_frame": "1"
}
},
"mut": {
"renderable": "1",
"is_default_camera": "1",
"option": "",
"common": {
"image_format": "exr",
"end": "10",
"width": "960",
"image_file_prefix": "",
"all_camera": [
"stereoCameraRightShape",
"stereoCameraLeftShape",
"stereoCameraCenterCamShape",
"perspShape",
"cameraShape2",
"cameraShape1"
],
"render_camera": [
"cameraShape1",
"stereoCameraLeftShape"
],
"start": "1",
"animation": "False",
"renderer": "mentalRay",
"frames": "1-10[1]",
"height": "540",
"renumber_frames": "False",
"by_frame": "1"
}
}
},
"task_info": {
"is_layer_rendering": "1",
"cg_id": "2000",
"ram": "64",
"os_name": "1",
"render_layer_type": "0",
"is_distribute_render": "0",
"input_cg_file": "D:/chensr/scene/maya2016_multi_layers_cameras.ma",
"job_stop_time": "28800",
"user_id": "10000031",
"pre_frames": "000",
"platform": "2",
"is_picture": "0",
"project_id": "3316",
"channel": "4",
"tiles_type": "block",
"tiles": "1",
"project_name": "dasdd",
"distribute_render_node": "3",
"frames_per_task": "1",
"stop_after_test": "2",
"input_project_path": "",
"task_id": "439800",
"task_stop_time": "86400",
"time_out": "12"
},
"software_config": {
"cg_version": "2016",
"cg_name": "Maya",
"plugins": {}
}
}
task.json parameters
parameter | type | description | example |
---|---|---|---|
software_config | object | environment(cg software, version and plugins, etc.) | refer to software_config |
task_info | object | render settings(priority frames, render range, etc.) | refer to task_info |
scene_info_render | object | analysis result(render node, output, etc.) | refer to scene_info_render |
software_config
parameter | type | description | example |
---|---|---|---|
cg_name | string | software | “Maya” |
cg_version | string | software version | “2016” |
plugins | dict | plugin{name, version} | {} |
task_info
parameter | type | description | example |
---|---|---|---|
is_layer_rendering | string | render layer mode,”0”:off, “1”:on | “1” |
enable_layered | string | whether to open layer commit, ‘0’ close, ‘1’ open | |
cg_id | string | software id.”2000”: Maya | “2000” |
ram | string | ram,64/128 | “64” |
os_name | string | os, “0”:Linux; “1”: Windows | “0” |
render_layer_type | string | render layer mode,”0”:renderlayer,”1”:rendersetup | “0” |
is_distribute_render | string | distributed render mode,”0”:off, “1”:on | “0” |
input_cg_file | string | input file path | |
job_stop_time | string | Set the frame timeout time, will only affect the current frame, unit seconds | “28800” |
user_id | string | user id | |
pre_frames | string | priority frames | “000:1,3-4[1]” |
platform | string | platform id | “2” |
is_picture | string | if it’s architectural rendering | “0” |
project_id | string | project id | |
channel | string | submit manner。”4”:API/SDK | “4” |
tiles_type | string | “block,strip” | “block” |
tiles | string | tile number, 1 for single node, greater than 1 for tiles rendering(multi-nodes) | “1” |
project_name | string | project name | “test” |
distribute_render_node | string | nodes number for distributed rendering | “3” |
frames_per_task | string | frames per task | “1” |
stop_after_test | string | “1”:pause after priority render, “2”:continue after priority render | |
input_project_path | string | project path, could be empty | |
task_id | string | task id | |
task_stop_time | string | Set the task timeout time. The task timeout stops all frames in unit seconds,unit: sec | “86400” |
time_out | string | Overtime reminder time, unit: sec | “43200” |
scene_info_render
para | type | description | example |
---|---|---|---|
layer | object | layer info | refer to scene_info_render.layer 配置文件文档之Maya.html#header-n336 |
scene_info_render.layer
parameter | type | description | example |
---|---|---|---|
renderable | string | Render layer switch | “1” |
env | object | {} | |
is_default_camera | string | use default camera?,default “1” | “1” |
option | string | info of renderer | “” |
common | object | scene general info | refer to scene_info_render.layer.common |
scene_info_render.layer.common
parameter | type | description | example |
---|---|---|---|
image_format | string | output format | “jpg” |
end | string | end frame | “100” |
width | string | image resolution of the wide | “1920” |
image_file_prefix | string | output image prefix setting | “” |
all_camera | list | all camera | [“stereoCameraRightShape”, “cameraShape1”] |
render_camera | list | list of cameras to render | [“stereoCameraRightShape”] |
start | string | start frame | “1” |
animation | string | on/off | “1” |
renderer | string | Renderer name | “arnold” |
frames | string | render frame | “1-10[1]” |
height | string | image resolution of the height | “1080” |
renumber_frames | string | “1” | |
by_frame | string | frame interval | “1” |
2.upload.json¶
File to save assets info.
upload.json example
{
"asset": [
{
"local": "D:/chensr/scene/maya2016_multi_layers_cameras.ma",
"server": "/D/chensr/scene/maya2016_multi_layers_cameras.ma"
}
]
}
upload.json
param | type | description | example |
---|---|---|---|
asset | object | assets info | refer to asset |
asset
param | type | description | example |
---|---|---|---|
local | string | local path of asset | “D:/chensr/scene/maya2016*multi*_layers_cameras.ma” |
server | string | relative path of server | “/D/chensr/scene/maya2016*multi*_layers_cameras.ma” |
Architecture overview¶
This document gives a brief introduction to the RenderBusSDK components.
Component¶
- rayvision_log and rayvision_api are root modules, to be invoked by other modules;
- rayvision_utils is a general module integrating functions to preprocessing CG configuration information calling rayvision_api when used;
- rayvision_sync provides transport-related functions, relys on rayvision_log and rayvision_api;
- rayvision_maya, rayvision_houdini, and rayvision_clarisse rely on rayvision_utils;
- rayvison_api
Core module, provides a lot of interfaces to be called.
- rayvison_utils
Provides some common functions required by other modules, integrating necessary rendering data preprocessing and customized exception management functions.
- rayvison_sync
Provides transporting functions, like uploading of CG configuration files and resource files, downloading of rendering result.
- rayvison_maya
Provides analysis functionality for Maya resource files
- rayvison_houdini
Provides analysis functionality for houdini resource files
- rayvison_clarisse
Provides analysis functionality for clarisse resource files
flow chart¶

General Parameter¶
PACKAGE_NAME¶
Set the log name and package name to deploy automatically with gitlab.
For example:
PACKAGE_NAME = "rayvision_clarisse"
ID mapping of DCC software¶
DCC_ID_MAPPINGS = { 'maya': 2000, '3ds Max': 2001, 'lightwave': 2002, 'arnold': 2003, 'houdini': 2004, 'cinema4d': 2005, 'softimage': 2006, 'blender': 2007, 'vr_standalone': 2008, 'mr_standalone': 2009, 'sketchup': 2010, 'vue': 2011, 'keyshot': 2012, 'clarisse': 2013, 'octane_render': 2014, 'katana': 2016, }
HEADERS¶
HEADERS = { 'accessId': '', 'channel': '4', 'platform': '', 'UTCTimestamp': '', 'nonce': '', 'signature': '', 'version': '1.0.0', 'Content-Type': 'application/json' }
CG Settings¶
CG_SETTING The first letter of the software name is capitalized
CG_SETTING = { 'Maya': '2000', 'Houdini': '2004', 'Katana': '2016', 'Clarisse': '2013', 'Blender': '2007', '3ds Max': '2001', '2000': 'Maya', '2004': 'Houdini', '2016': 'Katana', '2013': 'Clarisse', '2007': 'Blender', '2001': '3ds Max' }
task_info default parameters¶
TASK_INFO = { 'task_info': { 'input_cg_file': '', 'is_picture': '0', 'task_id': '', 'frames_per_task': '1', 'pre_frames': '000', 'job_stop_time': '86400', 'task_stop_time': '259200', 'time_out': '43200', 'stop_after_test': '2', 'project_name': '', 'project_id': '', 'channel': '4', 'cg_id': '', 'platform': '', 'tiles_type': 'block', 'tiles': '1', 'is_layer_rendering': '1', 'is_distribute_render': '0', 'distribute_render_node': '3', 'input_project_path': '', 'render_layer_type': '0', 'user_id': '', 'os_name': '1', 'ram': '64' }, 'software_config': {}, 'scene_info': {}, 'scene_info_render': {} }
MODIFIABLE_PARAM¶
optional parameters
MODIFIABLE_PARAM = [ 'pre_frames', 'input_cg_file', 'frames_per_task', 'test_frames', 'job_stop_time', 'task_stop_time', 'time_out', 'stop_after_test', 'tiles_type', 'tiles', 'is_layer_rendering', 'is_distribute_render', 'distribute_render_node', 'input_project_path', 'render_layer_type', 'os_name', 'ram' ]
TASK_STATUS_DESCRIPTION¶
Set the execution status code of the task and the corresponding Chinese and English description
TASK_STATUS_DESCRIPTION = { "0": { "0": "等待中", "1": "Waiting" }, "5": { "0": "渲染中", "1": "Rendering" }, "8": { "0": "预处理中", "1": "Preprocessing" }, "10": { "0": "停止", "1": "Stop" }, "20": { "0": "欠费停止", "1": "Arrearage-stop" }, "23": { "0": "超时停止", "1": "Timeout stop" }, "25": { "0": "已完成", "1": "Done" }, "30": { "0": "已完成(有失败帧)", "1": "Done(with failed frame)" }, "35": { "0": "放弃", "1": "Abort" }, "40": { "0": "等待全速渲染", "1": "Test done" }, "45": { "0": "失败", "1": "Failed" } }
TASK_END_STATUS_CODE_LIST¶
The status code at the end of the task.
TASK_END_STATUS_CODE_LIST = ['10', '20', '23', '25', '30', '35', '45']
Demo¶
Demo for maya, houdini and clarisse
### houdini, clarisse, maya Demo
Maya demo¶
from rayvision_api.core import RayvisionAPI from rayvision_maya.analyze_maya import AnalyzeMaya from rayvision_sync.upload import RayvisionUpload from rayvision_sync.download import RayvisionDownload from rayvision_api.task.check import RayvisionCheck from rayvision_api.utils import update_task_info, append_to_task, append_to_upload # API Parameter render_para = { "domain": "jop.foxrenderfarm.com", "platform": "2", "access_id": "xxxx", "access_key": "xxxx", } api = RayvisionAPI(access_id=render_para['access_id'], access_key=render_para['access_key'], domain=render_para['domain'], platform=render_para['platform']) # Step1:Analyze CG File analyze_info = { "cg_file": r"D:\files\CG FILE\muti_layer_test.ma", "workspace": "c:/workspace", "software_version": "2019", "project_name": "Project1", "plugin_config": { "mtoa": "3.2.1.1" } } analyze_obj = AnalyzeMaya(**analyze_info) analyze_obj.analyse() # step2: Add some custom parameters, or update the original parameter value update_task = { "pre_frames": "100", "stop_after_test": "1" } update_task_info(update_task, analyze_obj.task_json) custom_info_to_task = {} append_to_task(custom_info_to_task, analyze_obj.task_json) custom_info_to_upload = [] append_to_upload(custom_info_to_upload, analyze_obj.upload_json) # step3:Check json files check_obj = RayvisionCheck(api, analyze_obj) task_id = check_obj.execute(analyze_obj.task_json, analyze_obj.upload_json) # Step4: Transmission """ There are two ways to upload the transmission: Upload_method: 1: upload four json files and upload the resource file according to upload.json; 2: json files and resources are uploaded separately; """ CONFIG_PATH = { "tips_json_path": analyze_obj.tips_json, "task_json_path": analyze_obj.task_json, "asset_json_path": analyze_obj.asset_json, "upload_json_path": analyze_obj.upload_json, } upload_obj = RayvisionUpload(api) """ The default of the test demo is to upload json and resource files at the same time, and users can choose their own upload method according to the actual situation. """ upload_method = 1 if upload_method == 1: # step4.1:Json files are uploaded in conjunction with CG resources upload_obj.upload(str(task_id), **CONFIG_PATH) elif upload_method == 2: # step4.2:CG resource files and json are uploaded separately upload_obj.upload_asset(upload_json_path=CONFIG_PATH["upload_json_path"]) upload_obj.upload_config(str(task_id), list(CONFIG_PATH.values())) # Step5:Submit Task api.submit(int(task_id)) # Step6:Download download = RayvisionDownload(api) # All complete before the automatic start of uniform download. # download.auto_download_after_task_completed([task_id]) # Poll download (automatic download for each completed frame) download.auto_download([int(task_id)])
Houdini demo¶
from rayvision_api.core import RayvisionAPI from rayvision_houdini.analyze_houdini import AnalyzeHoudini from rayvision_sync.upload import RayvisionUpload from rayvision_sync.download import RayvisionDownload from rayvision_api.task.check import RayvisionCheck from rayvision_api.utils import update_task_info, append_to_task, append_to_upload # API Parameter render_para = { "domain": "jop.foxrenderfarm.com", "platform": "2", "access_id": "xxxx", "access_key": "xxxx", } api = RayvisionAPI(access_id=render_para['access_id'], access_key=render_para['access_key'], domain=render_para['domain'], platform=render_para['platform']) # Step1:Analyze CG File analyze_info = { "cg_file": r"D:\houdini\CG file\flip_test_slice4.hip", "workspace": "c:/workspace", "software_version": "17.5.293", "project_name": "Project1", "plugin_config": { 'renderman': '22.6' } } analyze_obj = AnalyzeHoudini(**analyze_info) analyze_obj.analyse() # step2: Add some custom parameters, or update the original parameter value update_task = { "pre_frames": "100", "stop_after_test": "1" } update_task_info(update_task, analyze_obj.task_json) custom_info_to_task = {} append_to_task(custom_info_to_task, analyze_obj.task_json) custom_info_to_upload = [] append_to_upload(custom_info_to_upload, analyze_obj.upload_json) # step3:Check json files check_obj = RayvisionCheck(api, analyze_obj) task_id = check_obj.execute(analyze_obj.task_json, analyze_obj.upload_json) # Step4: Transmission """ There are two ways to upload the transmission: Upload_method: 1: upload four json files and upload the resource file according to upload.json; 2: json files and resources are uploaded separately; """ CONFIG_PATH = { "tips_json_path": analyze_obj.tips_json, "task_json_path": analyze_obj.task_json, "asset_json_path": analyze_obj.asset_json, "upload_json_path": analyze_obj.upload_json, } upload_obj = RayvisionUpload(api) """ The default of the test demo is to upload json and resource files at the same time, and users can choose their own upload method according to the actual situation. """ upload_method = 1 if upload_method == 1: # step3.1:Json files are uploaded in conjunction with CG resources upload_obj.upload(str(task_id), **CONFIG_PATH) elif upload_method == 2: # step3.2:CG resource files and json are uploaded separately upload_obj.upload_asset(upload_json_path=CONFIG_PATH["upload_json_path"]) upload_obj.upload_config(str(task_id), list(CONFIG_PATH.values())) # Step5:Submit Task api.submit(int(task_id)) # Step6:Download download = RayvisionDownload(api) # All complete before the automatic start of uniform download. # download.auto_download_after_task_completed([task_id]) # Poll download (automatic download for each completed frame) download.auto_download([int(task_id)])
Clarisse demo¶
from rayvision_api.core import RayvisionAPI from rayvision_clarisse.analyse_clarisse import AnalyzeClarisse from rayvision_sync.upload import RayvisionUpload from rayvision_sync.download import RayvisionDownload from rayvision_api.task.check import RayvisionCheck from rayvision_api.utils import update_task_info, append_to_task, append_to_upload # API Parameter render_para = { "domain": "jop.foxrenderfarm.com", "platform": "2", "access_id": "xxxx", "access_key": "xxxx", } api = RayvisionAPI(access_id=render_para['access_id'], access_key=render_para['access_key'], domain=render_para['domain'], platform=render_para['platform']) # Step1:Analyze CG File analyze_info = { "cg_file": r"D:\files\CG FILE\clarisse_test1.project", "workspace": "c:/workspace", "software_version": "clarisse_ifx_4.0_sp3", "project_name": "Project1", "plugin_config": {} } analyze_obj = AnalyzeClarisse(**analyze_info) analyze_obj.analyse() # step2:Add some custom parameters, or update the original parameter value update_task = { "pre_frames": "100", "stop_after_test": "1" } update_task_info(update_task, analyze_obj.task_json) custom_info_to_task = {} append_to_task(custom_info_to_task, analyze_obj.task_json) custom_info_to_upload = [] append_to_upload(custom_info_to_upload, analyze_obj.upload_json) # step3:Check json files check_obj = RayvisionCheck(api, analyze_obj) task_id = check_obj.execute(analyze_obj.task_json, analyze_obj.upload_json) # Step4:Transmission """ There are two ways to upload the transmission: Upload_method: 1:upload four json files and upload the resource file according to upload.json; 2:json files and resources are uploaded separately; """ CONFIG_PATH = { "tips_json_path": analyze_obj.tips_json, "task_json_path": analyze_obj.task_json, "asset_json_path": analyze_obj.asset_json, "upload_json_path": analyze_obj.upload_json, } upload_obj = RayvisionUpload(api) """ The default of the test demo is to upload json and resource files at the same time, and users can choose their own upload method according to the actual situation. """ upload_method = 1 if upload_method == 1: # step4.1:Json files are uploaded in conjunction with CG resources upload_obj.upload(str(task_id), **CONFIG_PATH) elif upload_method == 2: # step4.2:CG resource files and json are uploaded separately upload_obj.upload_asset(upload_json_path=CONFIG_PATH["upload_json_path"]) upload_obj.upload_config(str(task_id), list(CONFIG_PATH.values())) # Step5:Submit Task api.submit(int(task_id)) # Step6:Download download = RayvisionDownload(api) # All complete before the automatic start of uniform download. # download.auto_download_after_task_completed([task_id]) # Poll download (automatic download for each completed frame) download.auto_download([int(task_id)])
FAQ¶
1. What versions of Python does the RenderBus SDK support?¶
RenderBus SDK currently supports Python 2.7 and Python 3.6
2. How to download the SDK package with pycharm?¶
Please refer to Installation Guide
3. To download only the first frame, how to set?¶
from rayvision_api.utils import update_task_info update_task = { "pre_frames": "100", } update_task_info(update_task, task_path=r"C:\workspace\1586932339\task.json")
4. After the priority frame rendered, how to set to automatically render at full speed?¶
from rayvision_api.utils import update_task_info update_task = { "stop_after_test": "1" } update_task_info(update_task, task_path=r"C:\workspace\1586932339\task.json")
For details, please refer to Detailed Parameter Configuration
5. How to set to download the rendering result immediately after current rendered frame rendered?¶
We provide 2 downloading methods:
- Download after all frames finish rendering
- Download after current frame finishes rendering
For details, please refer to SDK Usage
6. What is the easiest way to use?¶
If you want to use it directly without customization, you can download the corresponding rendering package directly, then select the corresponding [common full process sample] to experience the full process rendering. For details, please refer to the SDK Getting Started Tutorial
Exception code¶
code | symbol | description |
---|---|---|
100 | FAIL | failed |
200 | SUCCESS | returns successfully |
301 | NEED_REDIRECT | need to redirect to other addresses |
400 | APIError | error request |
403 | FORBIDDEN | no permission |
404 | RESOURCE_NOT_FOUND | resource does not exist |
500 | INTERNAL_ERROR | server processing failed |
600 | PARAMETER_INVALID | illegal parameter |
601 | PARAMETER_CANT_BE_EMPTY | missing required parameters |
602 | NEED_USER_LOGIN | requires user login |
603 | ILLEGAL_PROTOCOL | illegal request |
604 | VALIDATE_CODE_ERROR | mobile verification code error |
605 | VINSUFFICIENT_PERMISSIONS | insufficient permissions |
606 | VALIDATE_COMMOM_CODE_ERROR | verification code error |
607 | VALIDATE_SEND_CODE_ERROR | verification code failed to send |
608 | USER_AREA_ERROR | customer’s domestic and foreign regions do not match |
610 | SIGNATURE_EXPIRED | signature expired |
611 | SIGNATURE_INVALID | invalid signature |
700 | DO_NOT_HAVE_ANY_MORE_RECORD | no more records |
800 | ACCOUNT_BINDING_USER_NULL | account does not exist |
801 | ACCOUNT_NOT_BINDING | device not bound |
802 | ACCOUNT_BINDING_FAIL | device binding failed |
804 | ACCOUNT_LOCKED | account disabled |
805 | ACCOUNT_USERNAME_PASSWORD_FAIL | username/password invalid |
806 | ACCOUNT_UNIONID_FAIL | account is not bound to a third-party user |
807 | ACCOUNT_PHONE_FAIL | phone number is not bound to a third-party user |
808 | ACCOUNT_UNIONID_PHONE | phone number is already bound to other user |
809 | ACCOUNT_WEIXIN_FAIL | Wechat login failed |
810 | ACCOUNT_WEIBO_FAIL | Weibo login failed |
811 | ACCOUNT_LOGOUT_FAIL | logout failed |
812 | ACCOUNT_LOGIN_IPLIMITFAIL IP | address is prohibited |
813 | ACCOUNT_QQ_FAIL QQ | login failed |
814 | NOREPEAT_SELECT_SOFTWARE | unable to select common software repeatedly |
815 | ACCOUNT_UNIONID_EXISTS UNIONID | already exists |
900 | VALIDATE_PHONE_FAIL | phone number already exists |
901 | VALIDATE_EMAIL_FAIL | mailbox already exists |
902 | VALIDATE_USERNAME_FAIL | username already exists |
903 | ACCOUNT_EMAIL_FAIL | mailbox is not bound to an account |
904 | CURRENCY_NOT_SUPPORT | unsupported currency |
905 | AGENT_NOT_SUPPORT | unsupport agent |
906 | AMOUNT_NOT_SUPPORT | please enter a reasonable recharge value |
908 | COUPONNO_NOT_SUPPORT | coupon code is not supported |
909 | PAYMETHOD_NOT_SUPPORT | unsupported payment method |
910 | NO_INVOICE_ORDER | invoice order unavailable |
911 | NO_INVOICE_ADDRESS | invoice order address unavailable |
912 | SUBUSER_EXISTS_TASKS | unable to delete a sub-user with executing tasks |
913 | SUBUSER_ARREARAGE | sub-user is overdue |
914 | DELSUBUSER_EXISTS_BALANCE | there is balance for the sub-user to be deleting |
915 | NO_INVOICE_TEMPLATE | invoice information unavailable |
916 | RECEIPT_TYPE_ERROR | invoice type not match |
920 | NO_LATEST_VERSION | no latest client version |
1000 | REDIS_CACHE_FAIL | redis cache exception |
20004 | JSON_FILE_UPLOAD_FAILED | Uploading json file has failed many times, please check the network environment |
200024 | ARGUMENT_FORMAT_INVALID | The transfer parameter name is set incorrectly. Please check the transfer CMD command |
200025 | NON-UPLOADABLE FILES | Unable to upload the file, check if the file exists or if the file is damaged |
1000000 | RayvisionError | python exception |
Release notes¶
0.1.0 (2019-11-10):¶
- First edition
1.1.0 (2020-04-06):¶
- Major update:
- rayvision_api: Partially passed parameters were updated to check for functional refactoring
- rayvision_clarisse: Added independent native analysis. Clarissa analysis supports python2
- rayvision_maya: Added independent local analysis capability
- rayvision_houdini: Added independent local analysis capability
- rayvision_sync: Support to upload json configuration and resource files, download support to customize the server file path, support whether to use local comparison function
Contribute to the RenderBusSDK¶
Important
Please check carefully, you are https://renderbus.readthedocs.io/en/latest/index.html
on reading the latest version of this document.
There are many ways to contribute to the RenderBusSDK, and here are some of them:
- Report errors and requests in the problem tracker, and try to follow the guidelines detailed in reporting errors below.
Report error¶
- Please check the FAQ first in case that your issue is resolved already.
- Check unresolved issues to see if the problem’s been reported. If yes, review comments to get more info.
- Submit complete reports including platform, software_version, error log, etc. Try to provide a small test scene with which our engineers could position your problem.