fix 2D position for AE from linux
1.0.1 - fix: `Export Camera 2D Position To AE` file format not working on windows when export from linux (add CRLF terminator to generated text file)main
parent
2f7834ac94
commit
b6e695eef3
|
@ -14,6 +14,10 @@ Activate / deactivate layer opacity according to prefix
|
|||
Activate / deactivate all masks using MA layers
|
||||
-->
|
||||
|
||||
1.0.1
|
||||
|
||||
- fix: `Export Camera 2D Position To AE` file format not working on windows when export from linux (add CRLF terminator to generated text file)
|
||||
|
||||
1.0.0
|
||||
|
||||
- fix: activate Z pass on newly created viewlayers
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
from encodings import utf_8
|
||||
import bpy
|
||||
# import bpy_extras
|
||||
from bpy_extras.object_utils import world_to_camera_view # as cam_space
|
||||
|
@ -46,12 +47,13 @@ def export_AE_objects_position_keys():
|
|||
|
||||
scn = bpy.context.scene
|
||||
result = {}
|
||||
|
||||
print(f'Exporting 2d position (scene range: {scn.frame_start} - {scn.frame_end})')
|
||||
for fr in range(scn.frame_start,scn.frame_end + 1):
|
||||
|
||||
print(f'frame: {fr}')
|
||||
scn.frame_set(fr)
|
||||
|
||||
for o in C.selected_objects:
|
||||
for o in bpy.context.selected_objects:
|
||||
if not result.get(o.name):
|
||||
result[o.name] = []
|
||||
proj2d = world_to_camera_view(scn, scn.camera, o.matrix_world.to_translation()) # + Vector((.5,.5,0))
|
||||
|
@ -67,7 +69,7 @@ def export_AE_objects_position_keys():
|
|||
txt = fn.get_ae_keyframe_clipboard_header(scn)
|
||||
|
||||
for v in value:
|
||||
txt += '\t%s\t%s\t%s\t\n'%(v[0],v[1],v[2])
|
||||
txt += '\t%s\t%s\t%s\t0\t\n'%(v[0],v[1],v[2]) # add 0 for Z (probably not needed)
|
||||
|
||||
txt += '\n\nEnd of Keyframe Data\n' # keyframe txt footer
|
||||
|
||||
|
@ -75,8 +77,11 @@ def export_AE_objects_position_keys():
|
|||
keyfile = blend.parent / 'render' / f'pos_{name}.txt'
|
||||
keyfile.parent.mkdir(parents=False, exist_ok=True)
|
||||
|
||||
print(f'exporting keys for {name}')
|
||||
with open(keyfile, 'w') as fd:
|
||||
print(f'exporting keys for {name} at {keyfile}')
|
||||
|
||||
## save forcing CRLF terminator (DOS style, damn windows)
|
||||
## in case it's exported from linux
|
||||
with open(keyfile, 'w', newline='\r\n') as fd:
|
||||
fd.write(txt)
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ bl_info = {
|
|||
"name": "GP Render",
|
||||
"description": "Organise export of gp layers through compositor output",
|
||||
"author": "Samuel Bernou",
|
||||
"version": (1, 0, 0),
|
||||
"version": (1, 0, 1),
|
||||
"blender": (2, 93, 0),
|
||||
"location": "View3D",
|
||||
"warning": "",
|
||||
|
|
Loading…
Reference in New Issue