Skip to content

Commit

Permalink
It's only used from __init__.py
Browse files Browse the repository at this point in the history
So that's where it should live.
  • Loading branch information
walles committed Jun 9, 2024
1 parent 7f4676c commit 1a02002
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 7 additions & 1 deletion find_bad_motion_tracks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
UILayout,
)

from .logic import get_active_clip, find_bad_tracks, find_duplicate_tracks
from .logic import find_bad_tracks, find_duplicate_tracks

FIND_BAD_TRACKS = "Find Bad Tracks"

Expand Down Expand Up @@ -125,6 +125,12 @@ def draw_item(
layout.label(text=f"{duplicateItem.track1_name} & {duplicateItem.track2_name}")


def get_active_clip(context: bpy.types.Context):
spaces = cast(bpy.types.AreaSpaces, context.area.spaces)
active = cast(bpy.types.SpaceClipEditor, spaces.active)
return active.clip


class OP_Tracking_find_bad_tracks(bpy.types.Operator):
"""
Identify bad tracks by looking at how they move relative to other tracks.
Expand Down
7 changes: 0 additions & 7 deletions find_bad_motion_tracks/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import bpy
import statistics

from dataclasses import dataclass
Expand Down Expand Up @@ -329,9 +328,3 @@ def find_duplicate_tracks(clip: MovieClip) -> Iterable[Duplicate]:

# Return the track pairs that come close enough at some point
return filter(lambda dup: dup.are_dups(), dups.values())


def get_active_clip(context: bpy.types.Context):
spaces = cast(bpy.types.AreaSpaces, context.area.spaces)
active = cast(bpy.types.SpaceClipEditor, spaces.active)
return active.clip

0 comments on commit 1a02002

Please sign in to comment.