[Bf-extensions-cvs] [14365d7] master: After Effects export: cleanup
Damien Picard
noreply at git.blender.org
Wed May 25 12:43:15 CEST 2022
Commit: 14365d76b06367e615b504807890f40e0d8e2ab4
Author: Damien Picard
Date: Thu May 19 18:19:22 2022 +0200
Branches: master
https://developer.blender.org/rBAC14365d76b06367e615b504807890f40e0d8e2ab4
After Effects export: cleanup
- Remove unused import, variable and f-strings
- Replace "if not len(sequence)" by "if len(sequence) == 0"
- Remove useless else block after continue
===================================================================
M io_export_after_effects.py
===================================================================
diff --git a/io_export_after_effects.py b/io_export_after_effects.py
index dccb56c..5578eaf 100644
--- a/io_export_after_effects.py
+++ b/io_export_after_effects.py
@@ -36,7 +36,7 @@ bl_info = {
import bpy
import os
import datetime
-from math import degrees, floor
+from math import degrees
from mathutils import Matrix, Vector, Color
@@ -350,11 +350,10 @@ def get_selected(context, include_active_cam, include_selected_cams,
and obj is context.scene.camera):
# Ignore active camera if already selected
continue
- else:
- if include_selected_cams:
- cameras.append(CameraExport(obj))
- if include_cam_bundles:
- cam_bundles.extend(get_camera_bundles(context.scene, obj))
+ if include_selected_cams:
+ cameras.append(CameraExport(obj))
+ if include_cam_bundles:
+ cam_bundles.extend(get_camera_bundles(context.scene, obj))
elif include_image_planes and is_image_plane(obj):
images.append(ImageExport(obj))
@@ -444,7 +443,7 @@ def is_image_plane(obj):
if not is_plane(obj):
return False
- if not len(obj.material_slots):
+ if len(obj.material_slots) == 0:
return False
mat = get_first_material(obj)
@@ -535,8 +534,6 @@ def convert_transform_matrix(matrix, width, height, aspect,
This function will be called for every object for every frame
"""
- scale_mat = Matrix.Scale(width, 4)
-
# Get blender transform data for object
b_loc = matrix.to_translation()
b_rot = matrix.to_euler('ZYX') # ZYX euler matches AE's orientation and allows to use x_rot_correction
@@ -695,8 +692,8 @@ def write_jsx_file(context, file, selection, include_animation, ae_size):
jsx_file.write(f'Duration : {duration}\n')
jsx_file.write(f'FPS : {fps}\n')
jsx_file.write(f'Date : {datetime.datetime.now()}\n')
- jsx_file.write(f'Exported with io_export_after_effects.py\n')
- jsx_file.write(f'**************************************/\n\n\n\n')
+ jsx_file.write('Exported with io_export_after_effects.py\n')
+ jsx_file.write('**************************************/\n\n\n\n')
# Wrap in function
jsx_file.write("function compFromBlender(){\n")
More information about the Bf-extensions-cvs
mailing list