-
Notifications
You must be signed in to change notification settings - Fork 1
/
image_change_path_02.py
37 lines (33 loc) · 1.05 KB
/
image_change_path_02.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""Change path ending"""
import bpy
for img in bpy.data.images:
filepath = img.filepath
if img.filepath.startswith("//images\\2k"):
filepath = filepath.replace("//images\\2k", "//images\\render")
try:
img.filepath = filepath
print("sucess " + img.filepath)
except:
print("Err " + img.filepath)
else:
print("didn't enter" + img.filepath)
print("#################################")
for img in bpy.data.images:
if img.filepath.endswith("_B.png"):
print(img.filepath)
try:
img.filepath = img.filepath[0:-6] + "_C.png"
print("sucess " + img.filepath)
except:
print("Err " + img.filepath)
else:
print("didn't enter" + img.filepath)
if img.filepath.endswith("_R.png"):
print(img.filepath)
try:
img.filepath = img.filepath[0:-6] + "_M.png"
print("sucess " + img.filepath)
except:
print("Err " + img.filepath)
else:
print("didn't enter" + img.filepath)