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
gpv2
Pullusb 2021-06-28 12:41:56 +02:00
parent 15aec65b19
commit fdd3e2caef
4 changed files with 34 additions and 3 deletions

View File

@ -1,5 +1,9 @@
# Changelog
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
1.5.3

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

View File

@ -15,7 +15,7 @@ bl_info = {
"name": "GP toolbox",
"description": "Set of tools for Grease Pencil in animation production",
"author": "Samuel Bernou, Christophe Seux",
"version": (1, 5, 3),
"version": (1, 5, 4),
"blender": (2, 91, 0),
"location": "Sidebar (N menu) > Gpencil > Toolbox / Gpencil properties",
"warning": "",
@ -458,14 +458,15 @@ class GPTB_prefs(bpy.types.AddonPreferences):
col.prop(self.fixprops, 'set_res_percentage')
col.prop(self.fixprops, 'set_fps', text=f'Reset FPS (to {self.fps})')
col.prop(self.fixprops, 'set_slider_n_sync')
col.prop(self.fixprops, 'set_cursor_type')
col.prop(self.fixprops, 'check_front_axis')
col.prop(self.fixprops, 'check_placement')
col.prop(self.fixprops, 'set_pivot_median_point')
col.prop(self.fixprops, 'disable_guide')
col.prop(self.fixprops, 'list_disabled_anim')
col.prop(self.fixprops, 'autokey_add_n_replace')
#-# col.prop(self.fixprops, 'set_cursor_type')
col.prop(self.fixprops, "select_active_tool", icon='RESTRICT_SELECT_OFF')
col.prop(self.fixprops, "file_path_type")
# row.label(text='lock the active camera if not a draw cam (and if not "layout" in blendfile name)')
if self.pref_tabs == 'UPDATE':

View File

@ -25,7 +25,7 @@ class GP_PG_FixSettings(bpy.types.PropertyGroup):
set_scene_res : BoolProperty(
name="Reset Scene Resolution",
description="Set the scene resolution to current prefs project settings",
default=True, options={'HIDDEN'})
default=False, options={'HIDDEN'})
set_res_percentage : BoolProperty(
name="Reset Resolution Percentage To 100%",
@ -89,6 +89,16 @@ class GP_PG_FixSettings(bpy.types.PropertyGroup):
('builtin.select_lasso', 'Select lasso', 'Use active select lasso active tool', 4),#'MOUSE_MMB'
))
## check file path mapping type
file_path_type : EnumProperty(
name="Check File Path Mapping", description="Check if all path in scene are relative, absolute or disable the check",
default='RELATIVE',
items=(
('none', 'No Check', 'Do not check for path type', 0),
('RELATIVE', 'Relative', 'Check if all path are relative', 1),
('ABSOLUTE', 'Absolute', 'Check if all path are absolute', 2),
))
class GP_PG_ToolsSettings(bpy.types.PropertyGroup):
eraser_radius : IntProperty(
name="Eraser Radius", description="Radius of eraser brush",