add filepath mapping check

1.5.4

- feat: check file: add check for filepath mapping (if all relative or all absolute)
- change: check file: disable resolution set by default
This commit is contained in:
Pullusb
2021-06-28 12:41:56 +02:00
parent 15aec65b19
commit fdd3e2caef
4 changed files with 34 additions and 3 deletions
+16
View File
@@ -131,6 +131,22 @@ class GPTB_OT_file_checker(bpy.types.Operator):
problems.append(f"Autokey mode reset to 'Add & Replace'")
context.scene.tool_settings.auto_keying_mode = 'ADD_REPLACE_KEYS'
if fix.file_path_type != 'none':
pathes = []
for p in bpy.utils.blend_paths():
if fix.file_path_type == 'RELATIVE':
if not p.startswith('//'):
pathes.append(p)
elif fix.file_path_type == 'ABSOLUTE':
if p.startswith('//'):
pathes.append(p)
if pathes:
mess = f'{len(pathes)}/{len(bpy.utils.blend_paths())} paths not {fix.file_path_type.lower()} (see console)'
problems.append(mess)
print(mess)
print('\n'.join(pathes))
print('-')
# ## Set onion skin filter to 'All type'
# fix_kf_type = 0
# for gp in bpy.data.grease_pencils:#from data