Skip to content

Commit

Permalink
PerspectiveMotion: Fix lines missing in line2fbf
Browse files Browse the repository at this point in the history
  • Loading branch information
arch1t3cht committed Jan 17, 2024
1 parent 3d633f8 commit cbddb3e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions DependencyControl.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@
],
"0.1.1": [
"Fix crash on empty clipboard on Windows"
],
"0.1.2": [
"Fix min version for Math libary"
],
"0.1.3": [
"Fix line ordering and missing frames in line2fbf"
]
}
},
Expand Down
9 changes: 5 additions & 4 deletions macros/arch.PerspectiveMotion.moon
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export script_name = "Aegisub Perspective-Motion"
export script_description = "Apply perspective motion tracking data"
export script_author = "arch1t3cht"
export script_namespace = "arch.PerspectiveMotion"
export script_version = "0.1.2"
export script_version = "0.1.3"

DependencyControl = require "l0.DependencyControl"
dep = DependencyControl{
Expand Down Expand Up @@ -57,7 +57,7 @@ line2fbf = (sourceData, cleanLevel = 3) ->
-- Aegisub will never give us timestamps that aren't rounded to centiseconds, but lua code might.
-- Explicitly round to centiseconds just to be sure.
startTime = round_to_cs line.start_time
startFrame = round_to_cs line.startFrame
startFrame = line.startFrame
endFrame = line.endFrame

-- Tag Collection
Expand All @@ -71,7 +71,7 @@ line2fbf = (sourceData, cleanLevel = 3) ->

-- Fbfing
fbfLines = {}
for frame = startFrame, endFrame-1, 1
for frame = startFrame, endFrame-1
newLine = Line sourceData.line, sourceData.line.parentCollection
newLine.start_time = aegisub.ms_from_frame(frame)
newLine.end_time = aegisub.ms_from_frame(frame + 1)
Expand Down Expand Up @@ -188,14 +188,15 @@ track = (quads, options, subs, sel, active) ->

-- First, FBF everything
to_delete = {}
lines\runCallback (lines, line) ->
lines\runCallback ((lines, line) ->
data = ASS\parse line

table.insert to_delete, line

fbf = line2fbf data
for fbfline in *fbf
lines\addLine fbfline
), true

-- Then, find the line we do everything relative to

Expand Down

0 comments on commit cbddb3e

Please sign in to comment.