johnt53984649
Engaged
johnt53984649
Engaged
Activity
‎Dec 08, 2024
10:45 AM
I have hundreds of .aep files that I need to obtain the project bit depth of (8, 16, or 32 bit). I can't really find a good way to do this other than open up the file, use a .jsx script to write the bit depth to a file, then close after effects, and repeat for each project file. This is terribly slow, and is very error prone because it won't work properly if for whatever reason a dialog box appears (such as missing media) when attempting to open the project file. Is there any way to parse the binary format of the .aep file to get the project bit depth instead? This is what I'm currently using, if you're interested, but it's really janky and subject to the possible errors I mentioned above. Not to mention it's way slower than simply parsing the .aep file would be: Python script: import subprocess
import os
import time
afterfx_exe = r"C:\Program Files\Adobe\Adobe After Effects 2024\Support Files\AfterFX.exe"
script_path = r'C:\Users\username\Downloads\16bpc_test\write_bit_depth.jsx'
tdir = r'\\netshare\D\rerender\projects'
aeps_to_check = []
for root, dirs, files in os.walk(tdir):
for file in files:
fp = os.path.join(root, file)
if fp.endswith('.aep') and len(file) > 40:
print(file)
aeps_to_check.append(fp)
for aep_to_check in aeps_to_check:
subprocess.Popen(f'"{afterfx_exe}" "{aep_to_check}"')
print("Sleeping now")
time.sleep(15)
s_cmd = f'"{afterfx_exe}" -r {script_path}' # no quotes around the script path!
subprocess.call(s_cmd)
with open('bitsPerChannel.txt', 'r') as f:
data = f.read()
print(data)
os.remove('bitsPerChannel.txt')
time.sleep(10) JSX script: var filePath = "C:/Users/username/Downloads/16bpc_test/bitsPerChannel.txt";
var file = new File(filePath);
if (file.open("w"))
{
if (app.project)
{
try
{
var bitsPerChannel = app.project.bitsPerChannel;
file.writeln(bitsPerChannel);
}
catch (e)
{
file.writeln("Error: Unable to retrieve bitsPerChannel.\n" + e.toString());
}
}
else
{
file.writeln("Error: No project is currently open.");
}
file.close();
}
else
{
alert("Failed to open file for writing:\n" + filePath);
}
app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES);
app.quit(); Any advice for a better way to do this?
... View more
‎Aug 10, 2022
07:47 PM
In both older and newer versions of Adobe After effects, I have noticed that I am frequently getting an error stating "After Effects error. file is damaged ( 33 : 7 )" when I save to a mapped network drive on Windows 10. Here's an example showcasing this. I'm just repeatedly saving iterations of a file (Ctrl + Alt + Shift + S) and you can see some versions save successfully while the versions named "test4" and "test5" don't. When I attempt to import them, After Effects fails and cannot (they are damaged). https://youtu.be/JkdswzV6hzQ To confirm this, I looked at a binary difference between test3 (which was saved successfully) and test4 (which was corrupted). Sure enough, lots of the data in test4 is zeros (test3 on top, test4 on bottom): So the file really is corrupted and data is missing. I have never had this issue when saving to a local drive. It has something to do with saving an After Effects file to a network drive. Specfiically, the network drive I used in this example is an SMB share from a Windows 10 server. The network drive is an M.2 NVMe drive and the server's CPU is an Intel Celeron G4900. I've had this issue with both one gigabit connections using the built-in LAN ports on both machines as well as when using 10-gigabit connections using Mellanox Connect X 2 cards. I have never had issues saving any other types of files (Photoshop, text, microsoft office, png files, etc.) to this network drive. This issue is exclusive to After Effects. Any ideas why this happens? It is because of some latency between the workstation and the server?
... View more
‎Dec 19, 2020
04:03 PM
@Dan Ebberts , this worked wonderfully! I didn't realize just doing basic vector math like that would work so well. The only thing I don't understand is the division by 6. Do you know where that 6 comes from? As I decrease 6 to 5,4,3,2,1, etc. I noticed that it becomes more jagged, and as I increase 6 to 7,8,9,etc. it also becomes more jagged. What makes 6 the magic number for this?
... View more
‎Dec 19, 2020
12:08 PM
I'm using the "createPath()" function in an expression to generate a parametric curve in after effects and it is quite detailed. I'm not placing very many points to keep it running fast, but unfortunately that means that it looks pretty jagged: I can solve this by increasing the number of points I use, but this seriously slows down the whole project and is less than ideal. I know that this could be done with fewer points by setting tangents, but naturally those would be very difficult to calculate and highly depend on the particular curve that I"m using (I think I would have to use calculus to differentiate it to calculate the tangents). I'm hoping there's a more general technique to smooth the curve so that it looks something like this: without taking the performance hit from increasing the number of points too much. Is there a faster way to smooth the curve, or must I increase the number of points / calculate the tangents with calculus? This is my expression, if you're curious. The layer is a 4K solid in a 28 second 60fps composition: P=[];
var height = 2160
var width = 3840
var R = 320
var pi = Math.PI;
for (i=0;i<R;i++)
{
var z = pi*(2*i/(R-1) - 1);
var tt = 2*time*Math.PI/56;
var xp = 1500*Math.sin(7*pi*z + tt)*Math.cos(4*pi*z - tt) + width/2;
var yp = 1500*Math.sin(5*pi*z - tt)*Math.cos(4*pi*z + tt) + height/2;
P.push([xp,yp]);
}
createPath(P,[],[], false)
... View more
‎Jul 24, 2020
11:59 AM
How would I change the number of times that a footage item loops using extendscript? To be specific, I'm referring to this number from the interpret footage dialog:
... View more
‎Jun 21, 2020
11:54 PM
I managed to get around it by passing the directory from Extendscript as an argument to the Python script and then changing the directory directly in Python. Not ideal, but it works.
... View more
‎Jun 21, 2020
10:38 AM
Here's an example of what I mean. If I have a Python script that is located in a different directory than the .jsx script and I call it from the .jsx script with something like: system.callSystem("cmd.exe /c pathToMyPythonScript.py"") and the Python script tries to access files using paths that are located in directories specified relative to itself (such as "../template.txt", or "out/template.txt"), then the Python script is unable to find that txt file because when it is run, it's being run with the current working directory set to the .jsx script, not the Python script. I was wondering if there is any native way in ExtendScript to set the current working directory so that when I call the Python script, it is being run from whatever I set the CWD to in ExtendScript. An example of how to do this in Python would be os.chdir(newdirectory). I was simply wondering if there was any way to do it in ExtendScript directly.
... View more
‎Jun 20, 2020
06:42 PM
Whenever I run a script file, it seems that the working directory is the same directory that the script is located at. However, suppose I want to change the current working directory at run time, including directories which may be located on different drives which may include spaces in their name. How would I do this in ExtendScript?
The reason that I ask is because I have ExtendScript running other files that expect to be run from specific directories, and I need to change the current working directory before I run them.
... View more
‎Jun 17, 2020
01:49 PM
Is it possible to create presets for Effects in AE? For example, when I apply Gaussian Blur to a layer, it initially has a "Blurrines" value of 0. Is there some way I could change it so that it always has a value of 10 when I apply it to a layer? I'm just wanting to control the default variable values for each effect so that way I don't have to waste time adjusting parameters that I commonly change. I can always do this with scripting, but that doesn't really seem like the best way to do it. I would essentially be creating my own Effects panel that runs the script when I choose a given effect. That will work, but it's not ideal. I'm hoping After Effects has a native way to do this. Please let me know.
... View more
‎Jun 16, 2020
10:25 AM
This was extremely helpful. Thanks for sharing!
... View more
‎Jun 15, 2020
02:03 PM
I am using ExtendScript with VideoCopilot's "Saber" plug-in, but I'm having some problems. The way the plug-in is set up is that there are multiple effect properties with the exact same name but under different drop down arrows. For example: As you can see, there are multiple properties with the name "Distortion Amounnt." In ExtendScript, if I want to change the property with something like: myLayer.property("Effects").property("Saber").property("Distortion Amount").setValue(5) It only changes the very first one in the list (in other words, the Glow Distortion). Suppose I want to change the Core Distortion as well with ExtendScript. How would I reference it in ExtendScript? How do I change the Core Distortion effect property?
... View more
‎Jun 06, 2020
05:09 PM
Sorry, I should have been more clear. The original source was rendered in a separate 3D application at the same resolution as the final composition, so collapse transformations doesn't help here. The items' positions aren't being animated in After Effects.
... View more
‎Jun 06, 2020
12:41 PM
Sometimes I apply a glow effect to a scene with items that are moving quickly on and off the screen. Depending on the size of the glow, the glow itself will disappear the moment the object goes off frame (even though you should still see some of the light emanating from it). Obviously this happens because once the item is off frame, the glow effect has nothing apply itself to. When objects are moving fast, this creates a really noticeable effect as the glow halos just instantly vanish in a single frame (the frame the object moves off screen). This is not a desirable effect. I've been thinking of ways around it, but the best I've come up with so far is this: Precompose the layer with the glow effect applied, increase the comp dimensions, then duplicate the layer, move it beneath the original, scale it up by about 2%, offset it by one frame, and repeat. So you'll have a pyramid of layers with scales 100, 102, 104, 106, etc. Since they are offset by one frame, they don't all disappear on the same frame and you get this look as though they are extended. Here's a video example: https://www.youtube.com/watch?v=6auMIyMB-Ec&feature=youtu.be Unfortunately, this takes a bit longer to render and probably isn't the best way. Does anybody else know a better way to do it? Is there a built-in effect in After Effects that can achieve something similar? Remember, the key is that each scaled layer is a frame off from the previous. This is what creates the illusion of the moving object still going forward beyond the frame. Motion tile with mirror edges doesn't work because it still vanishes in a single frame.
... View more
‎Mar 03, 2020
08:33 PM
I didn't realize you could check for keyframes like that. This is perfect. Thank you so much!
... View more
‎Mar 02, 2020
05:30 PM
Thank you, but I'm afraid this won't work if any of the layers have their position keyframed. How would you account for that?
... View more
‎Mar 01, 2020
09:51 PM
When I use the following to increase the resolution of a composition in extendscript: mycomp.width = width mycomp.height = height The compositions resolution changes, but the positions of all items in the comp remain identical. This is the not the same as changing the composition resolution through the dialog box manually, which adjusts the positions accordingly (so the items remain centered). Here's a video showing my problem. What does my script need to look like so that I don't get the black bars (I want the same effect as changing the resolution manually)? https://www.youtube.com/watch?v=t12EC4PRt1M&feature=youtu.be
... View more
‎Feb 16, 2020
10:24 AM
I have looked through the scripting guide and I don't see any such documentation regarding this. That's why I asked here; oftentimes people figure out ways to achieve things not documented.
... View more
‎Feb 15, 2020
03:08 PM
Using extendscript, I want to hide a layer; essentially, it should be the equivalent of clicking the following button: How would I hide a layer in extendscript? I've tried myLayer.visible = false but to no avail.
... View more
‎Feb 10, 2020
07:30 PM
Is it possible to have the particles in CC particle world independently have their opacity randomly fade in and out? What I mean by this is that if you were to watch a single particle as it moved, its opacity would fade in and out randomly over time and completely independently of any other particle.
There are two "solutions" I've come across so far, but they're not true solutions in the sense that they aren't really that random or independent. For example, on the particle's opacity map, I could do something like this:
But the problem here is that it's not really random; it's tied to the life of the particle, which can be noticable if they're spawning from the same place. Additionally, it's very difficult to draw nice looking curves with the mouse.
Another "solution" I've considered is using a fractal noise to mask the particles layer and then animate the noise evolution. The problem with this is that it may mask multiple particles that are near each other at the same time, which means that the particles' opacities aren't independent of each other. Additionally, it doesn't look too great when a single particle is on the noise border between black and white where part of the particle is masked and the part other isn't.
Is there any way to truly independently control the opacity of particles in After Effects? If not, what do you do?
... View more
‎Dec 26, 2019
02:37 PM
I don't entirely understand what the "Interpret as Linear Light" option in the "Interpret Footage" settings means. The documentation says the following: "The Interpret As Linear Light option determines whether the assigned input color profile is interpreted as being linear (gamma equals 1.0). This option also works when color management is turned off for the project." So what is the "assigned input color profile" being interpreted as whenever this option isn't chosen? The main reason that I ask is because I recently encountered a problem when trying to import the following PNG file: https://drive.google.com/open?id=1ffur70dS81BI5GaSBCXlWI2M-8PKTzZy When I open it in Windows Photo Viewer, I am able to see the walls. But if I import it with "Interpret as Linear Light" set to "Off", then the image is overly dark (you aren't able to see the walls). You have to set it to "On" in order to see the walls. I don't understand why this is, because I've never had to turn it on for other image files. Here's a screenshot of the image as it appears in After Effects with "Interpret as Linear Light" set to off: And on: Here's how it appears in Windows Photo Viewer:
... View more
‎Nov 29, 2019
09:30 AM
Thank you, but I can get better filespace savings than storing the PNGs separately; the PNG files are only compressed using intraframe compression (obviously, they're separate files) whereas both inter and intraframe compression are used by the lossless x264/x265 codecs (I've actually been able to get significant filespace savings over the separate png files by encoding to x264 and x265). So, considering this, do you have recommendations for alternative lossless codecs that I can use instead, ones which would adhere to the specs you mentioned?
... View more
‎Nov 27, 2019
12:23 PM
1 Upvote
I create lots of 3D animations and do the final compositing work in After Effects. Usually, the frames of these animations are originally rendered out of my 3D software as separate PNG files, which I then import into After Effects as a "PNG Sequence." However, the issue with this method is that the PNG files themselves usually take up lots of space on disk. I've been looking into alternative methods to losslessly compress them, such as by using ffmpeg: ffmpeg -framerate 60 -i out%04d.png -c:v libx264rgb -qp 0 out.mp4 or: ffmpeg -framerate 60 -i out%04d.png -c:v libx265 -preset ultrafast -x265-params lossless=1 out.mp4 And these output files actually do give me much smaller filesizes than storing the original PNG frames (for example, 1.92GB instead of 4.5GB). However, the issue is that After Effects does not seem to be able to import these video files output by ffmpeg correctly. For example, here's what original first PNG frame looks like: However, when I import the ffmpeg video files into after effects cc 2019 or premiere pro cc 2019, here's what the x264 video's first frame looks like: And the x265 first frame: Clearly, After Effects isn't able to interpret the colors in the ffmpeg video file correctly, but I don't really understand why. If I open the video files in VLC Media Player, for example, the colors ARE interpreted correctly, so this must be a problem with Adobe's software. Is it possible to fix this problem by changing import settings in After Effects? Are there special output settings I need to specify for ffmpeg to avoid this problem? If none of these, do you have recommendations for alternative codecs that After Effects interprets properly?
... View more
‎Nov 27, 2019
10:27 AM
I am also interested in this problem. Have you found a solution?
... View more
‎Nov 03, 2019
02:51 PM
I know that it's possible to copy a path from Adobe Illustrator and paste it onto a layer in After Effects so that it is treated like a mask. However, suppose I want to do this using scripting so that it is automated (as in, I don't want to manually copy and paste hundreds of different illustrator file paths onto different layers in After Effects). How can I achieve this using scripting?
Keep in mind, that I'm wansng the actual path itself to be treated as a mask on a given layer; I am NOT trying to simply import the illustrator file and then have the layer beneath have its track matte set to use the illustrator vector layer as a track matte mask.
... View more
‎Oct 12, 2019
08:42 PM
You are correct, I apologize. It turns out I had a bug in my script that was leading me astray.
... View more
‎Oct 12, 2019
03:29 PM
In After Effects, suppose I have a layer with keyframes and I want to move its position in time. I can't just set it using
myLayer.startTime = new_start_time
because that doesn't move the keyframes along with it. I essentially want the exact same effect as dragging a layer to the left or right (as you would in the GUI) but with scripting: You can see what I mean here: https://imgur.com/qpIilCw
How do I move a layer and its keyframes with scripting?
... View more
‎Jul 10, 2019
06:00 PM
I did a little bit of experimentation, and, interestingly, when I export using the ProRes 422 codec from After Effects CC 2019, I get the options "Millions of Colors" and "Trillions of Colors" for bit depth. The "Trillions of Colors" choice gives me the same output I get when I choose either 8 or 16 bpc in Premiere Pro, but the "Millions of Colors" option actually gives me a file that's slightly smaller in size and with a lower bit rate. Additionally, importing both of these exports back into a 16 bpc AE comp and applying several heavy contrast layers shows that the "Millions of Colors" option does indeed look worse (probably has a lower bit depth) than the "Trillions of Colors" option. I'm not sure why there's no difference between 8 and 16 BPC in Premiere Pro when there does seem to be a difference in After Effects.
... View more
‎Jul 08, 2019
09:36 PM
Did anybody ever figure this out? I am also curious.
... View more
‎Jul 06, 2019
05:57 PM
Is it possible to use an Extendscript script in Premiere Pro to change the speed of a clip? If so, can you provide an example on how this would be done? I suspected that it would be somewhere in clips.components, but that only seems to contain opacity and motion values.
... View more
‎Jul 02, 2019
05:38 PM
1 Upvote
Thank you very much for that suggestion. I have confirmed that the output is indeed using all 10 bits per channel when rendered out with the project settings in 16 bpc, despite the fact that I chose "Millions of Colors." I'll document my results here for future reference: For all of the tests, the same gradient was exported using the same codec and the same "Millions of Colors" option, with the only different being the project's bit depth. Original AE Project was in 8 bpc: Original AE project was in 16 bpc: Original AE project was in 32 bpc: So, despite the fact that "Millions of Colors" was selected as the output depth in all scenarios, and all of those MXF files are listed as storing the video in 10 bpc, we can see that if the project bpc was 16 or higher, then the MXF codec does indeed use those extra two bits. So I guess "Millions of Colors" could mean 8 or 10 bpc.
... View more