From 697ead9329ebf6f28b60db8d8205c09c196c79c4 Mon Sep 17 00:00:00 2001 From: "florentin.luce" Date: Thu, 15 Feb 2024 10:14:25 +0100 Subject: [PATCH] export comments in spreadsheet --- operators/spreadsheet.py | 6 ++++-- ui/properties.py | 9 ++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/operators/spreadsheet.py b/operators/spreadsheet.py index e2ccd17..31f100b 100644 --- a/operators/spreadsheet.py +++ b/operators/spreadsheet.py @@ -580,13 +580,12 @@ class VSETB_OT_export_spreadsheet(Operator): if cell.type == "METADATA": row += [getattr(strip.vsetb_strip_settings.metadata, cell.field_name)] + elif cell.type == "ASSET_TYPE": asset_castings = [] for asset_casting in strip.vsetb_strip_settings.casting: asset = asset_casting.asset - #print('------------------------') - if not asset: self.report({"WARNING"}, f"The asset {asset_casting['_name']} is missing on strip {strip.name}") continue @@ -605,6 +604,9 @@ 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] + elif cell.field_name == 'EPISODE': row += [settings.active_episode.name] elif cell.field_name == 'SEQUENCE': diff --git a/ui/properties.py b/ui/properties.py index 36f1273..fc66276 100644 --- a/ui/properties.py +++ b/ui/properties.py @@ -139,7 +139,7 @@ class SpreadsheetExportCell(PropertyGroup): export_name : StringProperty() enabled : BoolProperty(default=True) field_name : StringProperty() - type : EnumProperty(items=[(t, t, "") for t in ('METADATA', 'SHOT', 'ASSET_TYPE')]) + type : EnumProperty(items=[(t, t, "") for t in ('METADATA', 'SHOT', 'ASSET_TYPE', 'TASK_TYPE')]) #sort : BoolProperty(default=True) @@ -346,6 +346,13 @@ class Project(PropertyGroup): cell.field_name = norm_str(asset_type.name, format=str.upper) cell.type = "ASSET_TYPE" + for task_type in self.task_types: + cell = spreadsheet.cells.add() + cell.name = task_type.name + cell.export_name = task_type.name + cell.field_name = norm_str(task_type.name, format=str.upper) + cell.type = "TASK_TYPE" + def set_strip_metadata(self): # Clear Metadatas