Blender Kitsu: Refactor Shot Builder #183
@ -10,20 +10,24 @@ active_project = None
|
|||||||
def get_shots_for_seq(
|
def get_shots_for_seq(
|
||||||
self: Any, context: bpy.types.Context
|
self: Any, context: bpy.types.Context
|
||||||
) -> List[Tuple[str, str, str]]:
|
) -> List[Tuple[str, str, str]]:
|
||||||
if not self.seq_id:
|
if self.seq_id != '':
|
||||||
return []
|
|
||||||
seq = active_project.get_sequence(self.seq_id)
|
seq = active_project.get_sequence(self.seq_id)
|
||||||
return cache.get_shots_enum_for_seq(self, context, seq)
|
shot_enum = cache.get_shots_enum_for_seq(self, context, seq)
|
||||||
|
if shot_enum != []:
|
||||||
|
return shot_enum
|
||||||
|
return [('NONE', "No Shots Found", '')]
|
||||||
|
|
||||||
|
|
||||||
def get_tasks_for_shot(
|
def get_tasks_for_shot(
|
||||||
self: Any, context: bpy.types.Context
|
self: Any, context: bpy.types.Context
|
||||||
) -> List[Tuple[str, str, str]]:
|
) -> List[Tuple[str, str, str]]:
|
||||||
global active_project
|
global active_project
|
||||||
if not self.seq_id:
|
if not (self.shot_id == '' or self.shot_id == 'NONE'):
|
||||||
return []
|
|
||||||
shot = active_project.get_shot(self.shot_id)
|
shot = active_project.get_shot(self.shot_id)
|
||||||
return cache.get_shot_task_types_enum_for_shot(self, context, shot)
|
task_enum = cache.get_shot_task_types_enum_for_shot(self, context, shot)
|
||||||
|
if task_enum != []:
|
||||||
|
return task_enum
|
||||||
|
return [('NONE', "No Tasks Found", '')]
|
||||||
|
|
||||||
|
|
||||||
class KITSU_OT_build_new_shot(bpy.types.Operator):
|
class KITSU_OT_build_new_shot(bpy.types.Operator):
|
||||||
|
Loading…
Reference in New Issue
Block a user