back to tabs for ae keys export

0.9.9

- fix: `Export Camera 2D Position To AE` use tab again instead of space in key clipboard format. otherwise paste doesn't work in After-Effect
This commit is contained in:
Pullusb
2022-02-09 16:35:07 +01:00
parent c5ea98b4d0
commit 4b59adf138
4 changed files with 35 additions and 15 deletions
+29 -12
View File
@@ -1217,20 +1217,37 @@ def get_coord_in_cam_space(scene, cam_ob, co, ae=False):
## -- After effects exports
def get_ae_keyframe_clipboard_header(scn):
import textwrap
t = f'''\
Adobe After Effects 8.0 Keyframe Data
'''Need to use tabs for AE'''
Units Per Second {scn.render.fps}
Source Width {scn.render.resolution_x}
Source Height {scn.render.resolution_y}
Source Pixel Aspect Ratio 1
Comp Pixel Aspect Ratio 1
## multiline version, but space instead of tabs break syntax for AE
# import textwrap
# t = f'''\
# Adobe After Effects 8.0 Keyframe Data
Transform Position
Frame X pixels Y pixels Z pixels
'''
return textwrap.dedent(t)
# Units Per Second {scn.render.fps}
# Source Width {scn.render.resolution_x}
# Source Height {scn.render.resolution_y}
# Source Pixel Aspect Ratio 1
# Comp Pixel Aspect Ratio 1
# Transform Position
# Frame X pixels Y pixels Z pixels
# '''
# t = textwrap.dedent(t)
# ## spaces to tab
# t = re.sub(r'\s{3-4}', u'\t', t) # ! Still spaces
## Direct use of tabs is safer
t = 'Adobe After Effects 8.0 Keyframe Data\n\n'
t += '\tUnits Per Second\t%s\n'%scn.render.fps
t += '\tSource Width\t%s\n'%scn.render.resolution_x
t += '\tSource Height\t%s\n'%scn.render.resolution_y
t += '\tSource Pixel Aspect Ratio\t1\n'
t += '\tComp Pixel Aspect Ratio\t1\n\n'
t += 'Transform\tPosition\n'
t += '\tFrame\tX pixels\tY pixels\tyZ pixels\t\n'
return t
## -- Collection handle