diff --git a/openpype/hosts/flame/api/__init__.py b/openpype/hosts/flame/api/__init__.py index c8660aafc4..dc47488dc1 100644 --- a/openpype/hosts/flame/api/__init__.py +++ b/openpype/hosts/flame/api/__init__.py @@ -11,7 +11,6 @@ from .constants import ( from .lib import ( CTX, FlameAppFramework, - maintain_current_timeline, get_project_manager, get_current_project, get_current_sequence, @@ -68,7 +67,6 @@ __all__ = [ # lib "CTX", "FlameAppFramework", - "maintain_current_timeline", "get_project_manager", "get_current_project", "get_current_sequence", diff --git a/openpype/hosts/flame/api/lib.py b/openpype/hosts/flame/api/lib.py index ccc664ce63..b37cc35afd 100644 --- a/openpype/hosts/flame/api/lib.py +++ b/openpype/hosts/flame/api/lib.py @@ -225,40 +225,6 @@ class FlameAppFramework(object): return True -@contextlib.contextmanager -def maintain_current_timeline(to_timeline, from_timeline=None): - """Maintain current timeline selection during context - - Attributes: - from_timeline (resolve.Timeline)[optional]: - Example: - >>> print(from_timeline.GetName()) - timeline1 - >>> print(to_timeline.GetName()) - timeline2 - - >>> with maintain_current_timeline(to_timeline): - ... print(get_current_sequence().GetName()) - timeline2 - - >>> print(get_current_sequence().GetName()) - timeline1 - """ - # todo: this is still Resolve's implementation - project = get_current_project() - working_timeline = from_timeline or project.GetCurrentTimeline() - - # swith to the input timeline - project.SetCurrentTimeline(to_timeline) - - try: - # do a work - yield - finally: - # put the original working timeline to context - project.SetCurrentTimeline(working_timeline) - - def get_project_manager(): # TODO: get_project_manager return diff --git a/openpype/hosts/flame/api/plugin.py b/openpype/hosts/flame/api/plugin.py index 6122b7bf1f..1ae62f3a8d 100644 --- a/openpype/hosts/flame/api/plugin.py +++ b/openpype/hosts/flame/api/plugin.py @@ -2,7 +2,6 @@ import re from Qt import QtWidgets, QtCore import openpype.api as openpype from openpype import style -from . import selection as opfapi_selection from . import ( lib as flib, pipeline as fpipeline, @@ -279,7 +278,7 @@ class Creator(openpype.Creator): # adding basic current context flame objects self.project = flib.get_current_project() - self.sequence = flib.get_current_sequence(opfapi_selection) + self.sequence = flib.get_current_sequence(flib.CTX.selection) if (self.options or {}).get("useSelection"): self.selected = flib.get_sequence_segments(self.sequence, True)