In our pipeline we try to keep a mirrored setup between our actual game assets (*.png, *.fbx etc) and source assets (*.ma, *.psd etc) So for instance .../assets/images/foo.png would have a source file located in .../assets_source/images/foo.psd. But since having a unique *.psd file for every single icon is a bit much, we also have single *.psd files that contain multiple assets.
Our exporter (https://maybedoublequotes.blogspot.com/2021/12/image-exporter-setup-and-tools.html) could then look at the layersets inside the *.psd file to determine the final output path. When exporting a layer or layerset, the path of the *.psd file is used as the base of the export path, adding the layersets of the selected layer or layersets as folders. This makes it possible to export a lot of files from the same *.psd to different locations on disk. But what if the source and assets are out of sync?
We had an issue when development needed to move a lot of files around in Unity depending on usage in the game. This would mean that our source files would be out of sync. We thought about having the devs keep a log of the moves, but that would mean a lot of additional manual work and resources. Using git to track the edits was also considered. But in the end we would still need to use that list to rearrange the layers in Photoshop.
Enter this script. It checks for each selected layer or layerset if a version of it can be found on disk, based on the path of the *.psd file and the layerset path of the exported layer or layerset. If a match is found it will match the layersets with the folders (if needed) If no image is found the script will move it to an assetsNotOnDisk folder. If there are any errors the original filestate will be restored so you don't end up with a half baked file.
No comments:
Post a Comment