FORUMS: list search recent posts

Write a script to unlink all media in After Effects

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Linus Kraemer
Write a script to unlink all media in After Effects
on Mar 22, 2019 at 3:56:03 pm

Wonder if anyone can help me with this? I'd like to have a way to make every project item - or just the selected items - become "missing".

The reason I need this is because I need to deliver working files from my local computer (where the files are all over the place), to a network drive (where the source files already exist).
I don't want to collect files because there's too much data. And I can't move/rename the source folders because they're spread all over my local drive.
So I want to unlink all the project assets, move my AE file into the network, and then relink the footage to the data on the network.

I'm alright with expressions but never gone near writing a script before. Anyone want to help me!?
Would super appreciate it!!
Linus


Return to posts index

Max Haller
Re: Write a script to unlink all media in After Effects
on Mar 22, 2019 at 4:23:45 pm

If you want them to all go offline, that means you'll have to manually relink them correct? Since the folder paths on the network drive won't match the paths on your local drive?

So isn't that the same as just manually relinking them without having them go offline first? Sorry if i've missed something it seems unnecessary to make them go offline first to me


Return to posts index

Linus Kraemer
Re: Write a script to unlink all media in After Effects
on Mar 22, 2019 at 4:38:43 pm

Good point, but the assets on the network are all nicely organised in the same place (they were collected properly!). So when I relink one of the files, all the rest will link up automatically.


Return to posts index


Dave LaRonde
Re: Write a script to unlink all media in After Effects
on Mar 22, 2019 at 5:28:12 pm

I would just copy the AE project file to the new location. Since the media file path will be different, all media will not appear. It should then be a simple matter to reconnect the media all at once.

Dave LaRonde
Promotion Producer
KGAN (CBS) & KFXA (Fox) Cedar Rapids, IA


Return to posts index

Linus Kraemer
Re: Write a script to unlink all media in After Effects
on Mar 22, 2019 at 5:32:06 pm

I thought that would be the solution too but that doesn't do it either. I'm on AE 2019 on Windows and moving the AE project doesn't unlink the footage.


Return to posts index

Max Haller
Re: Write a script to unlink all media in After Effects
on Mar 22, 2019 at 5:58:13 pm

Anyway you can move the footage on your local drive into a new folder. I think that might be enough to break the path in AE and force them to go offline. Like if you made a new folder and just moved the root of the path that the footage is in on your local drive.


Return to posts index


Linus Kraemer
Re: Write a script to unlink all media in After Effects
on Mar 22, 2019 at 6:11:05 pm

Can't do that, it's all in different places on the machine.

Anyone have any thoughts on how to make a script for this?
I saw in the AE Scripting guide that there is an attribute called footageMissing, but it's a read only attribute so perhaps that can't be changed. I wonder if a script could be written that just changes the source to somewhere that doesn't exist?? And that would then make everything missing?


Return to posts index

Max Haller
Re: Write a script to unlink all media in After Effects
on Mar 22, 2019 at 6:39:12 pm

Well i can't help you with the scripting and im not sure its possible. Heres one last bit of help though. https://forums.creativecow.net/docs/forums/post.php?forumid=227&postid=2076...

That thread is dealing with scripts to replace the source footage, you might be able to get it to replace the source with the footage on the network drive that way. Good luck at least you learned to organize your footage better next time.


Return to posts index

Dave LaRonde
Re: Write a script to unlink all media in After Effects
on Mar 22, 2019 at 6:35:48 pm

Well then, copy the project file, turn off your computer, open the AE project file on a different machine and re-link from it.

Sometimes brute force is necessary.

Thanks for the warning that Win 10 does weird things.

Dave LaRonde
Promotion Producer
KGAN (CBS) & KFXA (Fox) Cedar Rapids, IA


Return to posts index

Walter Soyka
Re: Write a script to unlink all media in After Effects
on Mar 22, 2019 at 6:57:25 pm

[Dave LaRonde] "Thanks for the warning that Win 10 does weird things."

Windows 10 isn't doing anything weird. Ae always remembers the last absolute path to all footage files -- not just the relative path from the AEP. This way, it can stay connected to footage files whether the project file only moves, or whether all the footage and the project file move together and keep the same relative paths.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Walter Soyka
Re: Write a script to unlink all media in After Effects
on Mar 22, 2019 at 6:47:14 pm

I don't think there's any way, even via scripting, to force a file in Ae offline. (You can replace it with a placeholder, but I think that will completely break the link to the original footage, making it unable to automatically relink later.)

The easiest path I could suggest for you is to save your project as an After Effects XML file; then you can search and replace a common string, like the drive letter(s), to make all the footage offline.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Linus Kraemer
Re: Write a script to unlink all media in After Effects
on Mar 23, 2019 at 5:35:20 pm

Actually both of these suggestions are great, thank you Walter! One problem that I realised for what I've been looking for is that PNG sequences would cause problems because they're always in their own folder, and the relinking only works when everything is in the same folder.

The XML idea is awesome! I did what you said. Opened the XML as text, did find replace on "/Users/" to "/bla/" and saved it again. Interestingly, that alone wasn't enough, I just had to move the AE project file somewhere else, and then everything unlinked.

The placeholders idea would also work! I haven't been able to find a script that would make all assets into placeholders, but when I tried doing it manually (just clicking on a load of assets and making them placeholders one at a time), when I relinked the first item, all the others relinked too.

Essentially the two options do the same thing, so I would love to have a script that creates all assets into placeholders. Anyone know if that exists? Been doing quite a bit off googling and haven't found it. I know the script would use this though! FootageItem.replaceWithPlaceholder()


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]