Use After Effects 24.5.0x41 per-character styles - #2
Conversation
|
Updated the API a bit: const { parse } = footage("style-parser.jsx").sourceData.get();
const inputText = `# hello!
this next word will be *bold*
and this one will be _italic_
## but check this one out:
i will be ==highlighted==!!!`
const fontMap = {
regular: "Menlo-Regular",
bold: "Menlo-Bold",
italic: "Menlo-Italic",
};
const customParsers = [
{
style: "highlight",
matcher: /==(.+?)==/g,
// styles map to AE's style methods (e.g. `setFillColor` becomes `fillColor`)
styles: { fillColor: [1, 1, 0] },
},
];
const render = parse({
markdown: inputText,
// optional props:
fonts: fontMap,
parsers: customParsers,
});
render();Updated project file: ae-md.zip |
|
Amazing work @fartinmartin, super impressed. This is a way better API/functionality. It would be nice to avoid the Was there a specific reason you created a local copy of |
|
Thanks @timhaywood! Agreed—it would be nice to avoid Haha, yeah, as I started to reference functions in others I needed to export them in a |
|
Oh great idea! Wrapping everything in the I'll approve that PR first and then we can work on this one. Changed this to target a dev branch so we can work on it alongside main before merging. |
|
Nice! I just tested using |
Inspired by this post (in particular Volition74au's use of
eval()in the comments), I've updated this lib for use with After Effects 24.5.0x41 per-character styles expressions—AKA markdown in a singleTextLayer!It strays a bit from the original, but maybe that makes sense given the new AE features.
An example expression with the new lib looks like:
Here's a project file to play with: ae-md.zip