diff --git a/operators/operators.py b/operators/operators.py index e0fd8ac..8ceb80c 100644 --- a/operators/operators.py +++ b/operators/operators.py @@ -317,12 +317,14 @@ class VSETB_OT_load_projects(Operator): tracker.connect() for project_data in tracker.get_projects(): + + project = settings.projects.add() - project.type = project_data['production_type'] + project.type = project_data['production_type'].upper().replace(' ', '') project.name = project_data['name'] project.id = project_data['id'] - if project.type == 'TV Show': + if project.type == 'TVSHOW': for episode_data in tracker.get_episodes(project_data): episode = project.episodes.add() episode.name = episode_data['name'] diff --git a/panels.py b/panels.py index 1f4a808..90881c0 100644 --- a/panels.py +++ b/panels.py @@ -35,7 +35,7 @@ class VSETB_PT_main(VSETB_main, Panel): col.prop(settings, 'project_name', text='Project') if project: - if project.type == 'TV Shows': + if project.type == 'TVSHOW': col.prop(project, 'episode_name', text='Episodes') #col.separator() diff --git a/properties.py b/properties.py index 330f918..e7991f7 100644 --- a/properties.py +++ b/properties.py @@ -149,7 +149,7 @@ class Project(PropertyGroup): for metadata_type in self.metadata_types: prop_name = metadata_type.name - if metadata_type['choices']: + if metadata_type.get('choices'): prop = bpy.props.EnumProperty(items=[(c, c.replace(' ', '_').upper(), '') for c in metadata_type['choices']]) else: prop = bpy.props.StringProperty() diff --git a/sequencer_utils.py b/sequencer_utils.py index 4fb31ea..5c26a10 100644 --- a/sequencer_utils.py +++ b/sequencer_utils.py @@ -8,6 +8,7 @@ from pathlib import Path from vse_toolbox.bl_utils import get_scene_settings, get_strip_settings from vse_toolbox.constants import SOUND_SUFFIXES + def new_text_strip(name='Text', channel=0, start=0, end=50, text='Text', font_size=48, x=0.5, y=0.5, align_x='CENTER', align_y='CENTER', select=False, box_color=None, box_margin=0.005): @@ -85,7 +86,7 @@ def rename_strips( project = settings.active_project episode_name = '' if settings.active_episode: - episode_name = episode.name + episode_name = settings.active_episode.name prev_sequence_name = None strip_number = 0