deadline获取渲染时间


# -*- coding: utf-8 -*-
import sys
import os

# rc_tool_set_path = os.getenv("RC_TOOL_SET") or r'W:\ple_wts_tools\tool\ple_toolset'
# sys.path.insert(0, rc_tool_set_path + r'\tool\ani\auto_ani_cache\util_deadline')
sys.path.insert(0, r'\\192.168.2.23\Deadline\DeadlineRepository10\api\python')

import Deadline
import Deadline.DeadlineConnect as Connect

# 关联deadlin
connectionObject = Connect.DeadlineCon('192.168.2.23', 8082)
jobId = '5e0031e384eb7e24ec763c25'


# 获取任务
connectionObject.Jobs.GetJobs()
job = connectionObject.Jobs.GetJob(jobId)


def str_to_time(time_str):
    import time
    return time.strptime(time_str, '%Y-%m-%dT%X')


starttime = str_to_time(job['DateStart'].split('.')[0])
print starttime
endtime = str_to_time(job['DateComp'].split('.')[0])
print endtime
second = (time.mktime(endtime)-time.mktime(starttime))/60

print second

评论
  目录