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 = 2 if upload_method == 1: # Step5.1:Json files are uploaded in conjunction with CG resources upload_obj.upload(str(task_id), **CONFIG_PATH) elif upload_method == 2: # Step5.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())) # Step6:Submit Task api.submit(int(task_id)) # Step7: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)])
def rayvision_download(api): """Create an RayvisionDownload object.""" return RayvisionDownload(api)
"domain": render_para['domain'], "platform": render_para['platform'], "local_os": render_para['local_os'], "user_id": api.user_info['user_id'], "local_path": r"C:\workspace", # 下载资源本地保存路径 } resource_config_file = { "task_json_path": task.task_json_path, "tips_json_path": task.tips_json_path, "asset_json_path": task.asset_json_path, "upload_json_path": task.upload_json_path, } # start transfer(传输) trans = RayvisionTransfer(**transfer_info) upload = RayvisionUpload(trans) upload.upload(task_id=task.task_id, **resource_config_file) task_id = int(task.task_id) result = api.submit(task_id) # download(下载) manage_task = RayvisionManageTask(api.query) trans.manage_task = manage_task download = RayvisionDownload(trans) # demo提供2种下载方式用户自行选择 # download.auto_download_after_task_completed([task_id]) # 所有都完成后才自动开始统一下载 download.auto_download([task_id]) # 轮询下载(每完成每一帧自动下载)
# -*- coding: utf-8 -*- """Download demo.""" # Import local modules from rayvision_api import RayvisionAPI from rayvision_sync.download import RayvisionDownload api = RayvisionAPI(access_id="xxx", access_key="xxx", domain="task.renderbus.com", platform="2") download = RayvisionDownload(api) # download.download(download_filename_format="true", server_path="18164087_muti_layer_test/l_ayer2") # download.auto_download([18164087], download_filename_format="false") # download.auto_download_after_task_completed([18164087], download_filename_format="false")