forked from lookbothways/vfxTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setRange.py
34 lines (28 loc) · 861 Bytes
/
setRange.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# setRange
# fTrack tool
# Add this to your shelf:
"""
import setRange
reload(setRange)
setRange.setTimeline()
"""
#gets the frame range
import ftrack
import os
import maya.cmds as cmds
import re
import string
def setTimeline():
taskId = os.getenv('FTRACK_TASKID')
task = ftrack.Task(taskId)
shot = task.getParent()
seq =shot.getParent()
show = seq.getParent()
print "Current shot: " +show.get("name")+"_"+seq.get("name")+"_"+shot.get("name")
print "Frame range : %s-%s"%(shot.get("fstart"),shot.get("fend"))
fStart = shot.get("fstart")
fEnd = shot.get("fend")
cmds.playbackOptions(min=int(fStart),max=int(fEnd))
cmds.setAttr('defaultRenderGlobals.startFrame',int(fStart))
cmds.setAttr('defaultRenderGlobals.endFrame',int(fEnd))
print "Set timeline and frame range to {}-{}".format(fStart,fEnd)