kt-forpro-tools 1.0.17 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/freeze.ts +63 -0
- package/src/index.ts +2 -1
- package/src/tests/index.test.ts +12 -11
- package/src/utils.ts +1 -6
package/package.json
CHANGED
package/src/freeze.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { KT_Project } from "kt-ae-tools-project";
|
|
2
|
+
|
|
3
|
+
class __KT_SlidesFreeze {
|
|
4
|
+
courseTitle = KT_Project.find.comps("titulo-curso")[0];
|
|
5
|
+
professorPastilla = KT_Project.find.comps("profesor-pastilla")[0];
|
|
6
|
+
logo_in = KT_Project.find.comps("Logotipo")[0];
|
|
7
|
+
logosCartela = KT_Project.find.comps("Logotipos-cartela")[0];
|
|
8
|
+
logo_out = KT_Project.find.comps("logo_out")[0];
|
|
9
|
+
chyrons = KT_Project.find.comps("chyrons")[0];
|
|
10
|
+
//find comps named with only two digits
|
|
11
|
+
lessons: CompItem[] = KT_Project.find.comps(/^\d{2}$/);
|
|
12
|
+
init = () => {
|
|
13
|
+
$.writeln("Dummy method to force transpilation");
|
|
14
|
+
};
|
|
15
|
+
private frezzeExpression(property: Property) {
|
|
16
|
+
if (property.canSetExpression && property.expressionEnabled) {
|
|
17
|
+
const value = property.value;
|
|
18
|
+
property.setValue(value);
|
|
19
|
+
property.expressionEnabled = false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
private unfreezeExpression(property: Property) {
|
|
24
|
+
if (property.canSetExpression && !property.expressionEnabled) {
|
|
25
|
+
property.expressionEnabled = true;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
private findProperties() {
|
|
30
|
+
const properties: Property[] = [
|
|
31
|
+
(this.courseTitle.layers.byName("titulo") as TextLayer).text.sourceText,
|
|
32
|
+
(this.professorPastilla.layers.byName("profesor") as TextLayer).text.sourceText,
|
|
33
|
+
(this.logosCartela.layers[1] as AVLayer).transform.opacity,
|
|
34
|
+
(this.logosCartela.layers[2] as AVLayer).transform.opacity,
|
|
35
|
+
(this.logo_out.layers[1] as AVLayer).transform.opacity,
|
|
36
|
+
(this.logo_out.layers[2] as AVLayer).transform.opacity,
|
|
37
|
+
(this.chyrons.layers.byName("profesor") as TextLayer).text.sourceText,
|
|
38
|
+
(this.chyrons.layers.byName("titulo") as TextLayer).text.sourceText,
|
|
39
|
+
(this.logo_out.layers.byName("logo-cat") as AVLayer).transform.opacity,
|
|
40
|
+
(this.logo_out.layers.byName("logo-esp") as AVLayer).transform.opacity,
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
this.lessons.forEach((comp) => {
|
|
44
|
+
properties.push((comp.layers.byName("Lección") as TextLayer).text.sourceText);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return properties;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
freeze() {
|
|
51
|
+
const properties = this.findProperties();
|
|
52
|
+
properties.forEach((property) => {
|
|
53
|
+
this.frezzeExpression(property);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
unfreeze() {
|
|
57
|
+
const properties = this.findProperties();
|
|
58
|
+
properties.forEach((property) => {
|
|
59
|
+
this.unfreezeExpression(property);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export const KT_SlidesFreeze = new __KT_SlidesFreeze();
|
package/src/index.ts
CHANGED
|
@@ -2,5 +2,6 @@ import { KT_Core } from "kt-core";
|
|
|
2
2
|
import { KT_ForproTools } from "./KT_ForproTools";
|
|
3
3
|
import { KT_Slides } from "./slides";
|
|
4
4
|
import { type KT_SlidesOptions } from "./slides";
|
|
5
|
+
import { KT_SlidesFreeze } from "./freeze";
|
|
5
6
|
|
|
6
|
-
export { KT_ForproTools, KT_Slides, type KT_SlidesOptions };
|
|
7
|
+
export { KT_ForproTools, KT_Slides, type KT_SlidesOptions, KT_SlidesFreeze };
|
package/src/tests/index.test.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect, runTests, beforeAll, afterAll, beforeEach, afterEach } from "kt-testing-suite-core";
|
|
2
|
-
import { KT_Slides, KT_ForproTools } from "../index";
|
|
2
|
+
import { KT_Slides, KT_ForproTools, KT_SlidesFreeze } from "../index";
|
|
3
3
|
|
|
4
4
|
describe("KtForproTools Tests", () => {
|
|
5
5
|
it("should import the slides module", () => {
|
|
@@ -7,7 +7,8 @@ describe("KtForproTools Tests", () => {
|
|
|
7
7
|
const slideMultiplier = 16;
|
|
8
8
|
const width = 3840;
|
|
9
9
|
const height = 2160;
|
|
10
|
-
|
|
10
|
+
KT_SlidesFreeze.init();
|
|
11
|
+
KT_SlidesFreeze.unfreeze();
|
|
11
12
|
// KT_ForproTools.Cleanup();
|
|
12
13
|
// KT_ForproTools.utils.cleanNamePrecomp();
|
|
13
14
|
// KT_ForproTools.utils.sendCleanupToMediaEncoder(["esp", "cat"]);
|
|
@@ -15,20 +16,20 @@ describe("KtForproTools Tests", () => {
|
|
|
15
16
|
// KT_ForproTools.utils.sendCleanupToMediaEncoder();
|
|
16
17
|
// KT_ForproTools.utils.autoPrecompAndKeyOut();
|
|
17
18
|
// KT_ForproTools.utils.copyMarkersToComp(app.project.activeItem as CompItem);
|
|
18
|
-
KT_ForproTools.utils.copyMasksFromMasterToLayer();
|
|
19
|
+
// KT_ForproTools.utils.copyMasksFromMasterToLayer();
|
|
19
20
|
// const folder = Folder.selectDialog("Select a folder with language subfolders");
|
|
20
21
|
// $.writeln("Selected folder: " + folder?.fsName);
|
|
21
22
|
// KT_ForproTools.utils.precompAndKeyOut("cat");
|
|
22
23
|
// KT_ForproTools.utils.createCleanupStructure();
|
|
23
24
|
|
|
24
|
-
const slides = new KT_Slides({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
});
|
|
25
|
+
// const slides = new KT_Slides({
|
|
26
|
+
// name: "Test Slides",
|
|
27
|
+
// duration: duration,
|
|
28
|
+
// width: width,
|
|
29
|
+
// height: height,
|
|
30
|
+
// comp: app.project.activeItem as CompItem,
|
|
31
|
+
// slideMultiplier: slideMultiplier,
|
|
32
|
+
// });
|
|
32
33
|
|
|
33
34
|
// slides.cleanUp();
|
|
34
35
|
// slides.import();
|
package/src/utils.ts
CHANGED
|
@@ -198,16 +198,11 @@ class __KT_FP_Utils {
|
|
|
198
198
|
}
|
|
199
199
|
for (const lang in items) {
|
|
200
200
|
const langPath = IO.path.join(outputPath.fsName, lang);
|
|
201
|
-
|
|
202
|
-
const rqItems = KT_Project.render.sendToAME({
|
|
201
|
+
KT_Project.render.sendToAME({
|
|
203
202
|
comps: items[lang],
|
|
204
203
|
path: langPath,
|
|
205
204
|
});
|
|
206
|
-
if (rqItems && rqItems.length > 0) {
|
|
207
|
-
allRQItems.push(...rqItems);
|
|
208
|
-
}
|
|
209
205
|
}
|
|
210
|
-
return allRQItems;
|
|
211
206
|
};
|
|
212
207
|
}
|
|
213
208
|
|