clipboard import
This commit is contained in:
+61
-18
@@ -159,7 +159,7 @@ class Episode(PropertyGroup):
|
||||
return self.get(settings.project_name)
|
||||
|
||||
|
||||
class SpreadsheetCell(PropertyGroup):
|
||||
class SpreadsheetExportCell(PropertyGroup):
|
||||
export_name : StringProperty()
|
||||
enabled : BoolProperty(default=True)
|
||||
field_name : StringProperty()
|
||||
@@ -167,6 +167,17 @@ class SpreadsheetCell(PropertyGroup):
|
||||
#sort : BoolProperty(default=True)
|
||||
|
||||
|
||||
def get_cell_items(self, context):
|
||||
settings = get_scene_settings()
|
||||
project = settings.active_project
|
||||
|
||||
return [(cell, cell, '') for cell in project.get_cell_names()]
|
||||
|
||||
class SpreadsheetImportCell(PropertyGroup):
|
||||
enabled : BoolProperty(default=True)
|
||||
import_name : EnumProperty(items=get_cell_items)
|
||||
|
||||
|
||||
def get_custom_name_items(self, context):
|
||||
settings = get_scene_settings()
|
||||
project = settings.active_project
|
||||
@@ -184,7 +195,7 @@ class SpreadsheetExport(PropertyGroup):
|
||||
|
||||
open_folder : BoolProperty(default=False)
|
||||
show_settings : BoolProperty(default=False)
|
||||
cells: CollectionProperty(type=SpreadsheetCell)
|
||||
cells: CollectionProperty(type=SpreadsheetExportCell)
|
||||
cell_index : IntProperty(name='Spreadsheet Index', default=0)
|
||||
|
||||
|
||||
@@ -196,9 +207,13 @@ class SpreadsheetImport(PropertyGroup):
|
||||
custom_name : EnumProperty(items=get_custom_name_items,
|
||||
description='Use a custom name for asset using a metadata value')
|
||||
|
||||
cells: CollectionProperty(type=SpreadsheetCell)
|
||||
cells: CollectionProperty(type=SpreadsheetImportCell)
|
||||
cell_index : IntProperty(name='Spreadsheet Index', default=0)
|
||||
|
||||
import_casting: BoolProperty(default=True)
|
||||
import_custom_data: BoolProperty(default=True)
|
||||
update_edit: BoolProperty(default=True)
|
||||
|
||||
|
||||
class Project(PropertyGroup):
|
||||
id : StringProperty(default='')
|
||||
@@ -243,13 +258,32 @@ class Project(PropertyGroup):
|
||||
|
||||
type : StringProperty()
|
||||
|
||||
def get_cell_names(self):
|
||||
settings = get_scene_settings()
|
||||
project = settings.active_project
|
||||
|
||||
cell_names = ['Sequence', 'Shot', 'Frames', 'Description']
|
||||
|
||||
if project.type == 'TVSHOW':
|
||||
cell_names.insert(0, 'Episode')
|
||||
|
||||
for metadata_type in project.metadata_types:
|
||||
if metadata_type['entity_type'] == "SHOT":
|
||||
cell_names += [metadata_type.name]
|
||||
|
||||
for asset_type in project.asset_types:
|
||||
cell_names += [asset_type.name]
|
||||
|
||||
return cell_names
|
||||
|
||||
def set_spreadsheet(self):
|
||||
spreadsheet = self.spreadsheet_export
|
||||
|
||||
cell_names = ['Sequence', 'Shot', 'Frames', 'Description']
|
||||
if self.type == 'TVSHOW':
|
||||
cell_names.insert(0, 'Episode')
|
||||
|
||||
# Export SpreadSheet
|
||||
spreadsheet = self.spreadsheet_export
|
||||
for cell_name in cell_names:
|
||||
cell = spreadsheet.cells.add()
|
||||
cell.name = cell_name
|
||||
@@ -273,7 +307,6 @@ class Project(PropertyGroup):
|
||||
cell.field_name = asset_type.name.upper()
|
||||
cell.type = "ASSET_TYPE"
|
||||
|
||||
|
||||
def set_strip_metadata(self):
|
||||
|
||||
# Clear Metadatas
|
||||
@@ -363,7 +396,25 @@ class VSETB_UL_casting(UIList):
|
||||
return filtered, ordered
|
||||
|
||||
|
||||
class VSETB_UL_spreadsheet(UIList):
|
||||
class VSETB_UL_spreadsheet_import(UIList):
|
||||
def draw_item(self, context, layout, data, item, icon, active_data,
|
||||
active_propname, index):
|
||||
|
||||
settings = get_scene_settings()
|
||||
project = settings.active_project
|
||||
|
||||
layout.use_property_split = True
|
||||
layout.use_property_decorate = False
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.alignment = 'LEFT'
|
||||
|
||||
row.prop(item, 'enabled', text='')
|
||||
layout.label(text=item.name)
|
||||
layout.prop(item, 'import_name', text='')
|
||||
|
||||
|
||||
class VSETB_UL_spreadsheet_export(UIList):
|
||||
def draw_item(self, context, layout, data, item, icon, active_data,
|
||||
active_propname, index):
|
||||
|
||||
@@ -380,16 +431,6 @@ class VSETB_UL_spreadsheet(UIList):
|
||||
layout.label(text=item.name)
|
||||
layout.prop(item, 'export_name', text='')
|
||||
|
||||
def draw_filter(self, context, layout):
|
||||
row = layout.row()
|
||||
|
||||
subrow = row.row(align=True)
|
||||
subrow.prop(self, "filter_name", text="")
|
||||
subrow.prop(self, "use_filter_invert", text="", icon='ARROW_LEFTRIGHT')
|
||||
|
||||
subrow.separator()
|
||||
subrow.prop(self, "order_by_type", text="Order by Type", icon='MESH_DATA')
|
||||
|
||||
|
||||
class VSETB_PGT_scene_settings(PropertyGroup):
|
||||
|
||||
@@ -442,7 +483,8 @@ class VSETB_PGT_strip_settings(PropertyGroup):
|
||||
classes = (
|
||||
Asset,
|
||||
AssetCasting,
|
||||
SpreadsheetCell,
|
||||
SpreadsheetImportCell,
|
||||
SpreadsheetExportCell,
|
||||
AssetType,
|
||||
TaskStatus,
|
||||
Episode,
|
||||
@@ -452,7 +494,8 @@ classes = (
|
||||
SpreadsheetImport,
|
||||
SpreadsheetExport,
|
||||
Project,
|
||||
VSETB_UL_spreadsheet,
|
||||
VSETB_UL_spreadsheet_import,
|
||||
VSETB_UL_spreadsheet_export,
|
||||
VSETB_UL_casting,
|
||||
VSETB_PGT_scene_settings,
|
||||
VSETB_PGT_strip_settings,
|
||||
|
||||
Reference in New Issue
Block a user