From 4b59adf138eeae3d01e51895bfad603bcfa337d7 Mon Sep 17 00:00:00 2001 From: Pullusb Date: Wed, 9 Feb 2022 16:35:07 +0100 Subject: [PATCH] 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 --- CHANGELOG.md | 4 ++++ OP_export_to_ae.py | 3 +-- __init__.py | 2 +- fn.py | 41 +++++++++++++++++++++++++++++------------ 4 files changed, 35 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c76aa62..f001cd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/OP_export_to_ae.py b/OP_export_to_ae.py index 97da4d8..dfcaf9b 100644 --- a/OP_export_to_ae.py +++ b/OP_export_to_ae.py @@ -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 diff --git a/__init__.py b/__init__.py index d8d3195..cc96466 100644 --- a/__init__.py +++ b/__init__.py @@ -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": "", diff --git a/fn.py b/fn.py index b45a2be..fc2c6e9 100644 --- a/fn.py +++ b/fn.py @@ -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