Is there a way to make blender only use lowercase letters when saving a file? And if not, is there a way around it? For instance executing a script to change the file name to lowercase before actually saving the file in a directory?
For some context, I work with multiple blender artist, and even tho we have a naming convention it does happen that some of us slip back in their old habits of capitalizing names, which creates some problems with GIT that I would like to prevent.
PS. this is specifically about the name that's used to save the .blend file
Update: I believe I found a way to change the file name but only after it's saved, so now I'm looking for a way to pause blender to change the name.
def execute(self, context):
bpy.ops.wm.save_as_mainfile('INVOKE_DEFAULT')
outname = bpy.path.basename(bpy.data.filepath)
outpath = os.path.dirname(bpy.path.abspath(bpy.data.filepath))
filename = bpy.path.basename(bpy.context.blend_data.filepath)
filename = filename.lower()
print(filename)
if not bpy.app.handlers.save_post:
print("not finished")
return {'PASS_THROUGH'}
if bpy.ops.file.execute():
print("yes")
else:
print("finished")
print('done')
# wait = bpy.app.handlers.save_post
print(filename)
print("test111")
bpy.ops.wm.save_mainfile(filepath=os.path.join(outpath, outname),
check_existing=True)
print(filename)
self.SaveAsRotationFix()
return {'FINISHED'}
This is what I'm currently working with, (probably not a very efficient way of doing this.) My thought process is to be able to save the file with capitalization and after the file is created, run another save action to change the name to a lower case version. This fixes the issue I have when saving without a pre-existing file.
Edit: TLDR: if I save a file as Cube.blend I want it to change it to cube.blend
core.ignorecase
is set totrue
it shouldn't really matter what case is used locally. $\endgroup$