kt-forpro-tools 1.0.6 → 1.0.8
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/KT_ForproTools.ts +3 -1
- package/src/tests/index.test.ts +2 -1
- package/src/utils.ts +20 -0
package/package.json
CHANGED
package/src/KT_ForproTools.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { KT_SlidesAPI } from "./slides";
|
|
2
|
-
import { createCleanupStructure } from "./utils";
|
|
2
|
+
import { createCleanupStructure, KT_FP_Utils } from "./utils";
|
|
3
|
+
|
|
3
4
|
class __KT_ForproTools {
|
|
4
5
|
private name = "KtForproTools";
|
|
5
6
|
private version = "1.0.0";
|
|
6
7
|
Slides = KT_SlidesAPI;
|
|
7
8
|
Cleanup = createCleanupStructure;
|
|
9
|
+
utils = KT_FP_Utils;
|
|
8
10
|
constructor() {
|
|
9
11
|
$.writeln("KtForproTools constructor");
|
|
10
12
|
}
|
package/src/tests/index.test.ts
CHANGED
|
@@ -8,7 +8,8 @@ describe("KtForproTools Tests", () => {
|
|
|
8
8
|
const width = 3840;
|
|
9
9
|
const height = 2160;
|
|
10
10
|
|
|
11
|
-
KT_ForproTools.Cleanup();
|
|
11
|
+
// KT_ForproTools.Cleanup();
|
|
12
|
+
KT_ForproTools.utils.cleanNamePrecomp();
|
|
12
13
|
// const slides = new KT_Slides({
|
|
13
14
|
// name: "Test Slides",
|
|
14
15
|
// duration: duration,
|
package/src/utils.ts
CHANGED
|
@@ -32,3 +32,23 @@ export function createCleanupStructure(name: string = "Project"): FolderItem {
|
|
|
32
32
|
name + " Cleanup"
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
class __KT_FP_Utils {
|
|
37
|
+
cleanNamePrecomp = () => {
|
|
38
|
+
const selectedItems = app.project.selection;
|
|
39
|
+
const createdComps: CompItem[] = [];
|
|
40
|
+
for (let i = 0; i < selectedItems.length; i++) {
|
|
41
|
+
const item = selectedItems[i];
|
|
42
|
+
const itemName = item.name.split("/")[0];
|
|
43
|
+
const parentFolder = item.parentFolder;
|
|
44
|
+
const comp = KT_Project.add.compFromFootage(item, { name: itemName, parentFolder: parentFolder });
|
|
45
|
+
if (comp) {
|
|
46
|
+
createdComps.push(comp);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return createdComps;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const KT_FP_Utils = new __KT_FP_Utils();
|
|
54
|
+
export { KT_FP_Utils };
|