Skip to content

Commit

Permalink
Line2Fbf: Add script
Browse files Browse the repository at this point in the history
  • Loading branch information
arch1t3cht committed Jan 22, 2024
1 parent 02323d9 commit 29a42da
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
48 changes: 48 additions & 0 deletions DependencyControl.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,54 @@
]
}
},
"arch.Line2Fbf": {
"fileBaseUrl": "@{fileBaseUrl}/macros/@{namespace}",
"url": "@{baseUrl}#@{namespace}",
"author": "arch1t3cht",
"name": "FBF-ifier",
"description": "Convert lines into frame-by-frame chunks",
"channels": {
"release": {
"version": "0.1.0",
"released": "2024-01-22",
"default": true,
"files": [
{
"name": ".moon",
"url": "@{fileBaseUrl}@{fileName}",
"sha1": ""
}
],
"requiredModules": [
{
"moduleName": "a-mo.LineCollection",
"version": "1.3.0",
"name": "Aegisub-Motion (LineCollection)",
"url": "https://github.com/TypesettingTools/Aegisub-Motion",
"feed": "https://raw.githubusercontent.com/TypesettingTools/Aegisub-Motion/DepCtrl/DependencyControl.json"
},
{
"moduleName": "l0.ASSFoundation",
"name": "ASSFoundation",
"url": "https://github.com/TypesettingTools/ASSFoundation",
"version": "0.5.0",
"feed": "https://raw.githubusercontent.com/TypesettingTools/ASSFoundation/master/DependencyControl.json"
},
{
"moduleName": "arch.Util",
"name": "Util",
"url": "https://github.com/TypesettingTools/arch1t3cht-Aegisub-Scripts",
"version": "0.1.0"
}
]
}
},
"changelog": {
"0.1.0": [
"Initial Release"
]
}
},
"arch.PerspectiveMotion": {
"fileBaseUrl": "@{fileBaseUrl}/macros/@{namespace}",
"url": "@{baseUrl}#@{namespace}",
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ A script that generates moving focus lines, tweakable with a few parameters.

https://user-images.githubusercontent.com/99741385/180628464-2f970f02-b134-474b-b4b6-a998c22fcf75.mp4

### FBF-ifier
Yet another line2fbf script. Meaning, this script turns lines into frame-by-frame chunks without changing the rendering output, replacing all transform (and fade and move) tags by constant tags in the process. This script should be more accurate than the other line2fbf scripts floating around.

### PerspectiveMotion
An analogue to [Aegisub-Motion](https://github.com/TypesettingTools/Aegisub-Motion) that can handle perspective motion. Unlike the "After Effects Transform Data" that Aegisub-Motion needs, this tool requires an "After Effects Power Pin" track, which you can export directly from Mocha, or using [Akatsumekusa's plugin](https://github.com/Akatmks/Akatsumekusa-Aegisub-Scripts) for Blender.

Expand Down
41 changes: 41 additions & 0 deletions macros/arch.Line2Fbf.moon
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
export script_name = "FBF-ifier" -- thank Light for the name, I needed something that doesn't clash with Zeref's "Line To FBF"
export script_description = "Convert lines into frame-by-frame chunks"
export script_author = "arch1t3cht"
export script_namespace = "arch.Line2Fbf"
export script_version = "0.1.0"

DependencyControl = require "l0.DependencyControl"
dep = DependencyControl{
feed: "https://raw.githubusercontent.com/TypesettingTools/arch1t3cht-Aegisub-Scripts/main/DependencyControl.json",
{
{"a-mo.LineCollection", version: "1.3.0", url: "https://github.com/TypesettingTools/Aegisub-Motion",
feed: "https://raw.githubusercontent.com/TypesettingTools/Aegisub-Motion/DepCtrl/DependencyControl.json"},
{"l0.ASSFoundation", version: "0.5.0", url: "https://github.com/TypesettingTools/ASSFoundation",
feed: "https://raw.githubusercontent.com/TypesettingTools/ASSFoundation/master/DependencyControl.json"},
{"arch.Util", version: "0.1.0", url: "https://github.com/TypesettingTools/arch1t3cht-Aegisub-Scripts",
feed: "https://raw.githubusercontent.com/TypesettingTools/arch1t3cht-Aegisub-Scripts/main/DependencyControl.json"},
}
}
LineCollection, ASS, Util = dep\requireModules!

logger = dep\getLogger!

fbfify = (subs, sel, active) ->
lines = LineCollection subs, sel, () -> true

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

table.insert to_delete, line

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

lines\insertLines!
lines\deleteLines to_delete

dep\registerMacro fbfify

0 comments on commit 29a42da

Please sign in to comment.