Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[README] Update NewClipShape, Phantom, Resample, and SplitTimer #42

Merged
merged 4 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions DependencyControl.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,30 @@
]
}
},
"petzku.NewClipShape": {
"fileBaseUrl": "@{fileBaseUrl}/@{channel}/macros/@{namespace}",
"url": "@{baseUrl}#new-clip-shape",
"author": "petzku",
"name": "New Clip Shape",
"description": "Converts the last point of a vectorial clip into a new origin point",
"channels": {
"stable": {
"version": "0.3.1",
"released": "2023-11-19",
"default": true,
"files": [
{
"name": ".moon",
"url": "@{fileBaseUrl}@{fileName}",
"sha1": "b7ebc857b56a8c20cc9b93ab10954043074cb811"
}
]
}
},
"changelog": {
"0.3.1": ["Initial release"]
}
},
"petzku.Phantom": {
"fileBaseUrl": "@{fileBaseUrl}/@{channel}/macros/@{namespace}",
"url": "@{baseUrl}#phantom",
Expand Down
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,27 @@ Handles positioning on both axes, and all bottom- or top-aligned alignments, spe

**WARNING:** older versions of Aegisub (at the time of writing, this is most commonly used builds) do not handle opening files with negative margin values correctly (negative values are simply clamped to zero). If you use this macro, beware of those values being silently discarded.

### New Clip Shape

Hotkeyable macro to turn the last point of the active line's vectorial clip into a new "origin point" (i.e. `m 0 0 l 50 50 100 100` into `m 0 0 l 50 50 m 100 100`). Works for `l` as well as `b` (though it relies on Aegisub to fix potentially malformed shapes).

### Phantom

Helps with messing with dialogue layout using `\alphaFF`, somewhat akin to LaTeX `\phantom`. Split the line into three parts with `{}` (an empty tag section) to signify which part should be "hidden", and which part should "replace" it. If using the `Align start` mode, this should be `common{}replace{}hidden`; for `Align end`, `hidden{}replace{}common`. To demonstrate this better, in the image below, the "common" part is `The quick br`, "replace" is `—` (the em dash), and the "hidden" part is `own fox`, i.e. `The quick br{}—{}own fox`.

![Phantom text demonstration image](phantom.png)
_Demonstration of the Phantom macro. The top and bottom lines are completely unmodified, the middle line is Phantomed to align exactly with the full line._

If you're using a new-ish Aegisub build that includes the Lua GUI API (such as [arch1t3ct's](https://github.com/arch1t3cht/Aegisub)), there is a third macro, `By cursor`, that determines the sections and direction from the selection. Simply select the "replace" part (i.e. `—` in the example above), starting the selection from the direction that should remain aligned (i.e. left to right).

### Split Timer

Automatically splits any lines longer than a given threshold, retiming transforms and moves so rendering should be unaffected. `10 second chunks` has a threshold of 10 seconds, useful to account for player lookback buffers. `N frames` prompts for a length of frames, and uses that as the threshold.

`On video frame` behaves slightly differently, emulating Aegisub's built-in "Split lines before current frame" function, but still accurately preserving transforms.

It is good to note, though, that `\move` has the erratic behavior that treats negative start- and end-times as if neither had been passed—essentially "breaking" this macro. The simple fix is to make it simply a `\pos` in these cases. (I should address this soon-ish)

### Typewriter

Takes a line and "writes" it character by character, making the characters appear one by one (using alphas) either frame-by-frame or evenly spaced over the line's duration. My first script, initially made before I even knew what the hell alpha-timing was and actually deleted characters from the string to make this work. Obviously this has been changed since.
Expand Down Expand Up @@ -165,9 +182,11 @@ Specifically, the macro expects the style defaults to be `\an4\fs50\fnPT Sans` a

### Resample

Corrects 3D-rotations (`\frx\fry`) when resampling script resolutions. Uses trigonometry instead of the classic "multiply by the ratio of the resolutions" and also scales subtitle dimensions when necessary, so this handles even extreme rotations correctly, or at least very nearly so. Still kind of experimental, though I see little reason not to use this if you ever end up resampling scripts.
Don't use this, use [arch1t3ct's one](https://github.com/TypesettingTools/arch1t3cht-Aegisub-Scripts#resample-perspective) instead. Consider this script deprecated, and likely to be removed from the repo soon.

~~Corrects 3D-rotations (`\frx\fry`) when resampling script resolutions. Uses trigonometry instead of the classic "multiply by the ratio of the resolutions" and also scales subtitle dimensions when necessary, so this handles even extreme rotations correctly, or at least very nearly so. Still kind of experimental, though I see little reason not to use this if you ever end up resampling scripts.~~

Somewhat WIP. Does not always handle in-line `bord` and `shad` tags correctly. Also, I've been told the math I've used relies on incorrect assumptions, but it seemed to work correctly in all my testing.
~~Somewhat WIP. Does not always handle in-line `bord` and `shad` tags correctly. Also, I've been told the math I've used relies on incorrect assumptions, but it seemed to work correctly in all my testing.~~

### Shake

Expand Down
Binary file added phantom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading