From 688a06dffde62a7ba9d18873cc39950c4ca2ded7 Mon Sep 17 00:00:00 2001 From: "florentin.luce" Date: Thu, 15 Feb 2024 10:38:36 +0100 Subject: [PATCH] use task normed name --- operators/spreadsheet.py | 4 ++-- ui/panels.py | 7 +++++-- ui/properties.py | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/operators/spreadsheet.py b/operators/spreadsheet.py index 31f100b..e4061cf 100644 --- a/operators/spreadsheet.py +++ b/operators/spreadsheet.py @@ -428,7 +428,7 @@ class VSETB_OT_import_spreadsheet(Operator): elif cell_type == 'TASK_TYPE': task_type = project.task_types[cell.import_name] - task = getattr(strip_settings.tasks, task_type.name) + task = getattr(strip_settings.tasks, norm_str(task_type.name)) task.comment = cell_value if cell_type == 'ASSET_TYPE' and spreadsheet.import_casting: @@ -605,7 +605,7 @@ class VSETB_OT_export_spreadsheet(Operator): row += [separator.join(asset_castings)] elif cell.type == 'TASK_TYPE': - row += [getattr(strip.vsetb_strip_settings.tasks, cell.name).comment] + row += [getattr(strip.vsetb_strip_settings.tasks, norm_str(cell.name)).comment] elif cell.field_name == 'EPISODE': row += [settings.active_episode.name] diff --git a/ui/panels.py b/ui/panels.py index 71853cc..617f983 100644 --- a/ui/panels.py +++ b/ui/panels.py @@ -9,6 +9,7 @@ from bl_ui.utils import PresetPanel from vse_toolbox.bl_utils import (get_addon_prefs, get_scene_settings, get_strip_settings) from vse_toolbox.constants import ASSET_PREVIEWS from vse_toolbox.sequencer_utils import (set_active_strip, get_channel_name, get_strips) +from vse_toolbox.file_utils import norm_str class VSETB_main: @@ -350,8 +351,10 @@ class VSETB_PT_comments(VSETB_main, Panel): for task_type in project.task_types: + + norm_task_name = norm_str(task_type.name) - if not hasattr(strip_settings.tasks, task_type.name): + if not hasattr(strip_settings.tasks, norm_task_name): continue label_col.label(text=task_type.name) @@ -365,7 +368,7 @@ class VSETB_PT_comments(VSETB_main, Panel): sub.prop(task_type, 'color', text='') sub.enabled = False - row.prop(getattr(strip_settings.tasks, task_type.name), 'comment', text='') + row.prop(getattr(strip_settings.tasks, norm_task_name), 'comment', text='') def context_menu_prop(self, context): diff --git a/ui/properties.py b/ui/properties.py index fc66276..dd9694f 100644 --- a/ui/properties.py +++ b/ui/properties.py @@ -381,8 +381,8 @@ class Project(PropertyGroup): for task_type in self.task_types: prop = bpy.props.PointerProperty(type=ShotTask) - ShotTasks.__annotations__[task_type.name] = prop - setattr(ShotTasks, task_type.name, prop) + ShotTasks.__annotations__[norm_str(task_type.name)] = prop + setattr(ShotTasks, norm_str(task_type.name), prop) class VSETB_UL_casting(UIList):