trailing whitespaces cleanup

This commit is contained in:
pullusb
2023-01-18 14:28:27 +01:00
parent f3646e37df
commit 12cce98e41
23 changed files with 361 additions and 362 deletions
+12 -13
View File
@@ -14,7 +14,7 @@ def Export_AE_2d_position_json_data():
if not cam:
print('Active camera not "anim_cam"')
cam = scn.camera
rx = scn.render
rx, ry = rd.resolution_x, rd.resolution_y
@@ -49,7 +49,7 @@ def export_AE_objects_position_keys():
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)
@@ -57,17 +57,17 @@ def export_AE_objects_position_keys():
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))
# proj2d = correct_shift(proj2d, scn.camera) # needed ?
x = (proj2d[0]) * scn.render.resolution_x
y = -(proj2d[1]) * scn.render.resolution_y + scn.render.resolution_y
result[o.name].append((fr,x,y))
for name,value in result.items():
txt = fn.get_ae_keyframe_clipboard_header(scn)
for v in value:
txt += '\t%s\t%s\t%s\t0\t\n'%(v[0],v[1],v[2]) # add 0 for Z (probably not needed)
@@ -76,12 +76,12 @@ def export_AE_objects_position_keys():
blend = Path(bpy.data.filepath)
keyfile = blend.parent / 'render' / f'pos_{name}.txt'
keyfile.parent.mkdir(parents=False, exist_ok=True)
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:
with open(keyfile, 'w', newline='\r\n') as fd:
fd.write(txt)
@@ -178,7 +178,7 @@ class GPEXP_OT_fix_overscan_shift(bpy.types.Operator):
def draw(self, context):
layout = self.layout
if self.use_selection:
col = layout.column()
col.label(text=f'Camera "{self.cam_ob.name}" selected', icon='INFO')
@@ -196,7 +196,7 @@ class GPEXP_OT_fix_overscan_shift(bpy.types.Operator):
def execute(self, context):
cam = self.cam_ob.data
ratio_x = self.init_rx / context.scene.render.resolution_x
ratio_y = self.init_ry / context.scene.render.resolution_y
@@ -212,7 +212,7 @@ class GPEXP_OT_fix_overscan_shift(bpy.types.Operator):
else:
if cam.shift_x != 1:
cam.shift_x = cam.shift_x * ratio_x
if ratio_y != 1:
if fn.has_keyframe(cam, 'shift_y'):
fcu = cam.animation_data.action.fcurves.find('shift_y')
@@ -260,7 +260,7 @@ GPEXP_OT_fix_overscan_shift,
GPEXP_PT_extra_gprender_func
)
def register():
def register():
for cls in classes:
bpy.utils.register_class(cls)
@@ -274,4 +274,3 @@ def unregister():
for cls in reversed(classes):
bpy.utils.unregister_class(cls)