Skip to content

Commit

Permalink
first public edition
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Danischevsky committed Nov 3, 2022
1 parent 339960d commit 77e7df9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 122 deletions.
2 changes: 1 addition & 1 deletion menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@

# Add screengrab snapshot command to the Viewer Menu
viewer_menu.addCommand('Screengrab Viewer',
"import screengrab_viewer; screengrab_viewer.capture_viewer()")
"import screengrab_viewer_sd; screengrab_viewer_sd.capture_viewer()")

del(viewer_menu)

Expand Down
126 changes: 5 additions & 121 deletions python/render_range_sd.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,69 +30,13 @@ def copy_to_clipboard(clipboard_text):

def split_range_tens():
# Gets the frame range and creates a string of first frame, last frame and every 10th frame in between
'''
import ftrack
import os
import re
import string

'''
fStart = int(nuke.root().knob('first_frame').value())
fEnd = int(nuke.root().knob('last_frame').value())
'''
# fTrack range
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"))
fTStart = shot.get("fstart")
fTEnd = shot.get("fend")
matchStart = ""
matchEnd = ""
alert = ""
if fTStart == fStart:
matchStart = "matches"
print "Start frame matches fTrack"
else:
matchStart = "does not match"
alert = "WARNING!"
if fTEnd == fEnd:
matchEnd = "matches"
print "End frame matches fTrack"
else:
matchEnd = "does not match"
alert = "WARNING!"
'''
p= nuke.ask('Copy range\n{}-{}\nto clipboard, as first, last, x10s?'.format(fStart, fEnd))
#p.addEnumerationPulldown('Sort by', sortKeys)
#sortReverse=False
#p.addBooleanCheckBox('reverse',sortReverse)
#add arrangement possibilities:
#arrangeFormatNice=['horizontally','vertically','in a square','in a circle','scatter']
#arrangeFormat=[]
#for i in arrangeFormatNice:
#arrangeFormat.append('\\ '.join(i.split()))
#arrangement= (' ').join(arrangeFormat)
#p.addEnumerationPulldown('Arrange', arrangement)
#separateDiscrete=False
# p.addBooleanCheckBox('separate discrete values',separateDiscrete)
#snapToGrid=True
#p.addBooleanCheckBox('snap to grid',snapToGrid)
#show the panel
if p:
#title='frameSteps to copyBuffer',
#message="Copy stepped frame range: {} - {} ?\n\nFirst frame, last frame, every tenth frame, remaining frames. \n\n{}\n\nStart frame {} ftrack. \nEnd frame {} ftrack".format(fStart, fEnd, alert, matchStart, matchEnd),

#show the panel
if p:
# Create stepped string
renderOrder= [fStart, fEnd]
renderme= set(range(fStart, fEnd+ 1))
Expand All @@ -103,8 +47,8 @@ def split_range_tens():
frameSplit = ",".join([str(i) for i in renderOrder])

# puts frameSplit in the clipboard

copy_to_clipboard(frameSplit) # set clipboard
print(("Range copied: {}".format(clipboard_text())))
else:
print("Range not copied.")

Expand All @@ -115,73 +59,14 @@ def split_range_tens():

def split_range_gaps():
# Gets the frame range and creates a string of first frame, last frame and every 10th frame in between
'''
import ftrack
import os
import re
import string
'''
fStart = int(nuke.root().knob('first_frame').value())
fEnd = int(nuke.root().knob('last_frame').value())
'''
# fTrack range
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"))
fTStart = shot.get("fstart")
fTEnd = shot.get("fend")
matchStart = ""
matchEnd = ""
alert = ""
if fTStart == fStart:
matchStart = "matches"
print "Start frame matches fTrack"
else:
matchStart = "does not match"
alert = "WARNING!"
if fTEnd == fEnd:
matchEnd = "matches"
print "End frame matches fTrack"
else:
matchEnd = "does not match"
alert = "WARNING!"
'''
p= nuke.ask('Copy range\n{}-{}\nto clipboard, as first, last, biggest gaps?'.format(fStart, fEnd))
#p.addEnumerationPulldown('Sort by', sortKeys)
#sortReverse=False
#p.addBooleanCheckBox('reverse',sortReverse)
#add arrangement possibilities:
#arrangeFormatNice=['horizontally','vertically','in a square','in a circle','scatter']
#arrangeFormat=[]
#for i in arrangeFormatNice:
#arrangeFormat.append('\\ '.join(i.split()))
#arrangement= (' ').join(arrangeFormat)
#p.addEnumerationPulldown('Arrange', arrangement)
#separateDiscrete=False
# p.addBooleanCheckBox('separate discrete values',separateDiscrete)
#snapToGrid=True
#p.addBooleanCheckBox('snap to grid',snapToGrid)
#show the panel
if p:
#title='frameSteps to copyBuffer',
#message="Copy stepped frame range: {} - {} ?\n\nFirst frame, last frame, every tenth frame, remaining frames. \n\n{}\n\nStart frame {} ftrack. \nEnd frame {} ftrack".format(fStart, fEnd, alert, matchStart, matchEnd),

#show the panel
if p:
# Create stepped string
renderOrder= [fStart, fEnd]


gaps= True #go into loop
while gaps:
A= list(sorted(renderOrder))
Expand All @@ -195,7 +80,6 @@ def split_range_gaps():

# puts frameSplit in the clipboard
copy_to_clipboard(frameSplit) # set clipboard
print(("Range copied: {}".format(clipboard.text())))
else:
print("Range not copied.")

Expand Down

0 comments on commit 77e7df9

Please sign in to comment.