Last active
February 2, 2023 08:51
-
-
Save taikomatsu/0d437959619034a943a17f2646d3712f to your computer and use it in GitHub Desktop.
Export Maya Camera Warp to .clip file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pymel.core import * | |
start = int(playbackOptions(q=True, min=True)) | |
end = int(playbackOptions(q=True, max=True)) | |
fps = 24 | |
tracklength = end-start+1 | |
clipfile = 'path/to/your_clip/scenewarp.clip' | |
time = PyNode('time1') | |
vals = [] | |
rawvals = [] | |
for f in range(start, end+1): | |
vals.append(time.outTime.get(t=f)) | |
rawvals.append(f) | |
with open(clipfile, 'w') as f: | |
f.write('{\n') | |
f.write(f' rate = {fps}\n') | |
f.write(f' start = {start-1}\n') | |
f.write(f' tracklength = {tracklength}\n') | |
f.write(' tracks = 2\n') | |
f.write(' {\n') | |
f.write(' name = outTime\n') | |
f.write(' data = ') | |
for o in vals: | |
f.write(f' {o}') | |
f.write('\n') | |
f.write(' }\n\n') | |
f.write(' {\n') | |
f.write(' name = unwarpedTime\n') | |
f.write(' data = ') | |
for o in rawvals: | |
f.write(f' {o}') | |
f.write('\n') | |
f.write(' }\n') | |
f.write('}') | |
print('# Done') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment