diff --git a/scripts-blender/addons/blender_kitsu/sqe/ops.py b/scripts-blender/addons/blender_kitsu/sqe/ops.py index 77008306..6829e1b7 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/ops.py +++ b/scripts-blender/addons/blender_kitsu/sqe/ops.py @@ -338,6 +338,7 @@ class KITSU_OT_sqe_push_new_sequence(bpy.types.Operator): return {"CANCELLED"} project_active = cache.project_active_get() + episode_active = cache.episode_active_get() sequence = project_active.get_sequence_by_name(self.sequence_name) @@ -349,7 +350,10 @@ class KITSU_OT_sqe_push_new_sequence(bpy.types.Operator): return {"CANCELLED"} # Create sequence. - sequence = project_active.create_sequence(self.sequence_name) + sequence = project_active.create_sequence( + self.sequence_name, + episode_active.id if episode_active else None, + ) # Push sequence color. opsdata.push_sequence_color(context, sequence) diff --git a/scripts-blender/addons/blender_kitsu/sqe/push.py b/scripts-blender/addons/blender_kitsu/sqe/push.py index 66a60eb1..002fd2e2 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/push.py +++ b/scripts-blender/addons/blender_kitsu/sqe/push.py @@ -85,6 +85,7 @@ def new_shot( def new_sequence(strip: bpy.types.Sequence, project: Project) -> Sequence: sequence = project.create_sequence( strip.kitsu.sequence_name, + strip.kitsu.episode_id ) logger.info( "Pushed create sequence: %s for project: %s", sequence.name, project.name diff --git a/scripts-blender/addons/blender_kitsu/types.py b/scripts-blender/addons/blender_kitsu/types.py index 5afc1809..0230bc18 100644 --- a/scripts-blender/addons/blender_kitsu/types.py +++ b/scripts-blender/addons/blender_kitsu/types.py @@ -319,9 +319,12 @@ class Project(Entity): ] return sorted(sequences, key=lambda x: x.name) - def create_sequence(self, sequence_name: str) -> Sequence: + def create_sequence(self, sequence_name: str, episode_id: Optional[str] = None) -> Sequence: # This function returns a seq dict even if seq already exists, it does not override. - seq_dict = gazu.shot.new_sequence(asdict(self), sequence_name, episode=None) + seq_dict = gazu.shot.new_sequence( + asdict(self), + sequence_name, + episode=episode_id) return Sequence.from_dict(seq_dict) # SHOT