fixing broken resource links
Moderators: Víctor Paredes, Belgarath, slowtiger
- montblankdesign
- Posts: 74
- Joined: Wed Aug 15, 2007 8:00 pm
- Location: Los Angeles
- Contact:
fixing broken resource links
I have a lot of assets and sometimes they get moved. Is there a way to fix broken asset links? In Adobe IN DESIGN you are asked to relocate them.
I do cartoons and make music. I like to make music because John K is not likely to tell me I am doing it wrong.
Two solutions:
1. In AS, click the image layer properties and get to the last card, there you can update the image file.
2. If you have a lot of images, it is faster to open the AS file in a text editor, search for the string with the old path to the image, and replace that string with the new path.
Of course it's not a good idea to change the relative location of AS and image files during a project. I keep AS files within one project folder, and one images folder at the same level as the AS files. If I move the whole project folder, paths from AS files to images remain intact.
1. In AS, click the image layer properties and get to the last card, there you can update the image file.
2. If you have a lot of images, it is faster to open the AS file in a text editor, search for the string with the old path to the image, and replace that string with the new path.
Of course it's not a good idea to change the relative location of AS and image files during a project. I keep AS files within one project folder, and one images folder at the same level as the AS files. If I move the whole project folder, paths from AS files to images remain intact.
There is a script floating around for fixing broken image links, but in general there is no "global" fix for this issue. You can also use a text editor and do a search and replace for the linked files but the key is to set up the project folder ahead of time to avoid broken links. Keep all the Anime Studio files ABOVE or at the same level as any other files/folders with linked assets. This makes the paths "relative" and the folder can be moved anywhere without breaking links.
Project folder
--->AS File 1
--->AS File 2
--->Images folder
---------->image files
--->Audio folder
---------->Audio files
If you re-set up an existing project this way, you could use a text editor and search and replace to fix the paths to the assets. Just replace everything in the path up to the asset name with "Images/" or "Sound/" or "Scripts/" or whatever you choose.
This system works PERFECTLY. I use it all the time to transfer files through email. The beauty of is I can send just one AS file to someone. As long as their folders are set up the same way they drop the file in the right spot and it works.
-vern
Project folder
--->AS File 1
--->AS File 2
--->Images folder
---------->image files
--->Audio folder
---------->Audio files
If you re-set up an existing project this way, you could use a text editor and search and replace to fix the paths to the assets. Just replace everything in the path up to the asset name with "Images/" or "Sound/" or "Scripts/" or whatever you choose.
This system works PERFECTLY. I use it all the time to transfer files through email. The beauty of is I can send just one AS file to someone. As long as their folders are set up the same way they drop the file in the right spot and it works.
-vern
- montblankdesign
- Posts: 74
- Joined: Wed Aug 15, 2007 8:00 pm
- Location: Los Angeles
- Contact:
Thanks for the solution
I have been trying to keep that work method. But I am importing anime studio objects to reuse characters and sometimes I do not foresee what I am going to do. I would love a collect for project command like they have in Audio programs.
I do cartoons and make music. I like to make music because John K is not likely to tell me I am doing it wrong.
You are right. Importing files doesn't account for this problem.
This would be a great script idea. I'm not sure if you can "copy" other files using the script interface but I could test this and see. If I can copy/move files using lua, then a "collection" script would be very doable.
I have a couple of ideas on my list of new scripts to try out... this one sounds very cool.
-vern
This would be a great script idea. I'm not sure if you can "copy" other files using the script interface but I could test this and see. If I can copy/move files using lua, then a "collection" script would be very doable.
I have a couple of ideas on my list of new scripts to try out... this one sounds very cool.
-vern
- synthsin75
- Posts: 10280
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
That's definitely doable, Vern. This one's also on my todo list.
As long as people use a properly defined folder structure for their projects, you'd just need them to pick the location of where the resources are coming from. These could then be copied to the current projects location (preferably already in its own project folder), and the paths updated in the AS file.
I was even thinking of automatically generating the projects folder structure. But alas, other scripting has all of my attention at the moment.

As long as people use a properly defined folder structure for their projects, you'd just need them to pick the location of where the resources are coming from. These could then be copied to the current projects location (preferably already in its own project folder), and the paths updated in the AS file.
I was even thinking of automatically generating the projects folder structure. But alas, other scripting has all of my attention at the moment.

- montblankdesign
- Posts: 74
- Joined: Wed Aug 15, 2007 8:00 pm
- Location: Los Angeles
- Contact:
- synthsin75
- Posts: 10280
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
I had problems in the past with image layers "rescaling" that is why I use the text editor. But recently this problem doesn't happen any more for some reason. Maybe it was fixed. I don't know.
I think this will be my next script. An AS "Consolidation" script. It's straight forward, I've already got the code for reading and writing files. I plan to incorporate the "folder structure" into it. It will generate the folders for each thing, images, audio, scripts and place copies of any linked items inside it.
This will actually be a fairly straight forward script. Good grief I already know the file format inside and out from my save bone animation script (still in progress) and this is just a verbatim copy.
I'm excited again!
-vern
I think this will be my next script. An AS "Consolidation" script. It's straight forward, I've already got the code for reading and writing files. I plan to incorporate the "folder structure" into it. It will generate the folders for each thing, images, audio, scripts and place copies of any linked items inside it.
This will actually be a fairly straight forward script. Good grief I already know the file format inside and out from my save bone animation script (still in progress) and this is just a verbatim copy.
I'm excited again!
-vern
- montblankdesign
- Posts: 74
- Joined: Wed Aug 15, 2007 8:00 pm
- Location: Los Angeles
- Contact:
consolidation
That would be so great. I do not see why Anime Studio Pro shouldn't have a steady stream of updates and improvements. I would gladly pay $50 for that script alone.
I do cartoons and make music. I like to make music because John K is not likely to tell me I am doing it wrong.