use task normed name

pull/5/head
florentin.luce 2024-02-15 10:38:36 +01:00
parent 697ead9329
commit 688a06dffd
3 changed files with 9 additions and 6 deletions

View File

@ -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]

View File

@ -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):

View File

@ -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):