10
##---------------------------RELOAD IMAGES------------------
11
class reloadImages (bpy.types.Operator):
12
bl_idname = "image.reload_images_osc"
13
bl_label = "Reload Images"
14
bl_options = {"REGISTER", "UNDO"}
15
def execute(self,context):
16
for imgs in bpy.data.images:
21
##------------------------ SAVE INCREMENTAL ------------------------
23
class saveIncremental(bpy.types.Operator):
24
bl_idname = "file.save_incremental_osc"
25
bl_label = "Save Incremental File"
26
bl_options = {"REGISTER", "UNDO"}
27
def execute(self, context):
28
filepath = bpy.data.filepath
29
if filepath.count("_v"):
30
strnum = filepath.rpartition("_v")[-1].rpartition(".blend")[0]
32
modnum = strnum.replace(str(intnum),str(intnum+1))
33
output = filepath.replace(strnum,modnum)
34
basename = os.path.basename(filepath)
35
bpy.ops.wm.save_as_mainfile(filepath=os.path.join(os.path.dirname(filepath),"%s_v%s.blend" % (basename.rpartition("_v")[0],str(modnum))))
38
output = filepath.rpartition(".blend")[0]+"_v01"
39
bpy.ops.wm.save_as_mainfile(filepath=output)
43
##------------------------ REPLACE FILE PATHS ------------------------
45
bpy.types.Scene.oscSearchText = bpy.props.StringProperty(default="Search Text")
46
bpy.types.Scene.oscReplaceText = bpy.props.StringProperty(default="Replace Text")
48
class replaceFilePath(bpy.types.Operator):
49
bl_idname = "file.replace_file_path_osc"
50
bl_label = "Replace File Path"
51
bl_options = {"REGISTER", "UNDO"}
52
def execute(self, context):
53
TEXTSEARCH = bpy.context.scene.oscSearchText
54
TEXTREPLACE = bpy.context.scene.oscReplaceText
56
for image in bpy.data.images:
57
image.filepath = image.filepath.replace(TEXTSEARCH,TEXTREPLACE)
b'\\ No newline at end of file'