[Bf-extensions-cvs] [97ff124] master: After Effects export: group images and solids into a folder

Damien Picard noreply at git.blender.org
Wed May 25 12:43:15 CEST 2022


Commit: 97ff1244c52d61846ca449abb8232221f764ab3d
Author: Damien Picard
Date:   Wed Apr 28 15:02:34 2021 +0200
Branches: master
https://developer.blender.org/rBAC97ff1244c52d61846ca449abb8232221f764ab3d

After Effects export: group images and solids into a folder

===================================================================

M	io_export_after_effects.py

===================================================================

diff --git a/io_export_after_effects.py b/io_export_after_effects.py
index f13a706..582e518 100644
--- a/io_export_after_effects.py
+++ b/io_export_after_effects.py
@@ -920,9 +920,11 @@ def write_jsx_file(file, data, selection, include_animation,
         '\nvar newComp = app.project.items.addComp(compName, %i, %i, %f, %f, %f);'
         % (data['width'], data['height'], data['aspect'],
            data['duration'], data['fps']))
-    jsx_file.write('\nnewComp.displayStartTime = %f;\n\n\n'
+    jsx_file.write('\nnewComp.displayStartTime = %f;\n\n'
                    % ((data['start'] + 1.0) / data['fps']))
 
+    jsx_file.write('var footageFolder = app.project.items.addFolder(compName + "_layers")\n\n\n')
+
     # Create camera bundles (nulls)
     jsx_file.write('// **************  CAMERA 3D MARKERS  **************\n\n')
     for name_ae, obj in js_data['bundles_cam'].items():
@@ -965,10 +967,9 @@ def write_jsx_file(file, data, selection, include_animation,
                 obj['width'],
                 obj['height'],
                 1.0))
-        jsx_file.write(
-            '%s.threeDLayer = true;\n' % name_ae)
-        jsx_file.write(
-            '%s.source.name = "%s";\n' % (name_ae, name_ae))
+        jsx_file.write('%s.source.name = "%s";\n' % (name_ae, name_ae))
+        jsx_file.write('%s.source.parentFolder = footageFolder;\n' % (name_ae))
+        jsx_file.write('%s.threeDLayer = true;\n' % name_ae)
         # Set values of properties, add keyframes only where needed
         for prop in ("position", "orientation", "scale", "opacity"):
             if include_animation and obj[prop + '_anim']:
@@ -986,8 +987,9 @@ def write_jsx_file(file, data, selection, include_animation,
     jsx_file.write('// **************  IMAGES  **************\n\n')
     for name_ae, obj in js_data['images'].items():
         jsx_file.write(
-            'var newFootage = app.project.importFile(new ImportOptions(File("%s")))\n'
+            'var newFootage = app.project.importFile(new ImportOptions(File("%s")));\n'
             % (obj['filepath']))
+        jsx_file.write('newFootage.parentFolder = footageFolder;\n')
         jsx_file.write(
             'var %s = newComp.layers.add(newFootage);\n' % (name_ae))
         jsx_file.write(



More information about the Bf-extensions-cvs mailing list