Skip to content

Commit

Permalink
feat: add set_frame_start method
Browse files Browse the repository at this point in the history
  • Loading branch information
hanson-hschang committed Sep 11, 2024
1 parent 88a65fb commit e6a0a89
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/bsr/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,24 @@ def current_frame(self, frame: int) -> None:
), "frame must be a positive integer or 0"
self.__frame = frame

def set_frame_start(self, frame: Optional[int] = None) -> None:
"""
Set the start frame number of the scene.
Parameters
----------
frame : int, optional
The start frame number of the scene. The default is None.
If None, the current frame number is used.
"""
if frame is None:
frame = self.__frame
else:
assert (
isinstance(frame, int) and frame >= 0
), "frame must be a positive integer or 0"
bpy.context.scene.frame_start = frame

def set_frame_end(self, frame: Optional[int] = None) -> None:
"""
Set the end frame number of the scene.
Expand Down

0 comments on commit e6a0a89

Please sign in to comment.