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
main
Pullusb 2022-02-09 16:35:07 +01:00
parent c5ea98b4d0
commit 4b59adf138
4 changed files with 35 additions and 15 deletions

View File

@ -14,6 +14,10 @@ Activate / deactivate layer opaticty according to prefix
Activate / deactivate all masks using MA layers
-->
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
0.9.8
- feat: `Export Camera 2D Position To AE` to export 'anim cam' (or selected cam) frame center pixel coordinate within scene camera.

View File

@ -108,8 +108,7 @@ def export_anim_cam_position(camera=None, context=None):
scn.frame_set(i)
center = fn.get_cam_frame_center_world(camera)
coord = fn.get_coord_in_cam_space(scn, scn.camera, center, ae=True)
# text += f'\t{i}\t{coord[0]}\t{coord[1]}\t\n'
text += f' {i} {coord[0]} {coord[1]}\n'
text += f'\t{i}\t{coord[0]}\t{coord[1]}\t\n'
text += '\n\nEnd of Keyframe Data\n' # Ae Frame ending

View File

@ -2,7 +2,7 @@ bl_info = {
"name": "GP Render",
"description": "Organise export of gp layers through compositor output",
"author": "Samuel Bernou",
"version": (0, 9, 8),
"version": (0, 9, 9),
"blender": (2, 93, 0),
"location": "View3D",
"warning": "",

41
fn.py
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