Created
July 19, 2016 12:46
-
-
Save Pullusb/ff0526d65a47f675ab77a01e6b72519c to your computer and use it in GitHub Desktop.
blender script to replace images datapath to current blender folder and subfolder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
import os | |
corrected = [] | |
print ("--------") | |
loc = bpy.path.abspath('//') | |
for i in bpy.data.images: | |
for root, folders, files in os.walk(loc): | |
for f in files: | |
if i.name == f: | |
corrected.append(f) | |
i.filepath = bpy.path.relpath(os.path.join(root,f)) | |
break | |
print ("corrected:", corrected) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment