kt-forpro-tools 1.0.21 → 1.0.22
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/slides.ts +46 -11
package/package.json
CHANGED
package/src/slides.ts
CHANGED
|
@@ -57,7 +57,17 @@ class KT_Slides {
|
|
|
57
57
|
private getNextColor = colorSelector();
|
|
58
58
|
|
|
59
59
|
constructor(options: KT_SlidesOptions = {}) {
|
|
60
|
-
const {
|
|
60
|
+
const {
|
|
61
|
+
name,
|
|
62
|
+
duration,
|
|
63
|
+
width,
|
|
64
|
+
height,
|
|
65
|
+
segments,
|
|
66
|
+
inDuration,
|
|
67
|
+
comp,
|
|
68
|
+
slideMultiplier,
|
|
69
|
+
slideDistance,
|
|
70
|
+
} = options;
|
|
61
71
|
this.name = name || this.name;
|
|
62
72
|
this.duration = duration || this.duration;
|
|
63
73
|
this.width = width || this.width;
|
|
@@ -97,7 +107,10 @@ class KT_Slides {
|
|
|
97
107
|
footageFolder && footageFolder.length > 0
|
|
98
108
|
? footageFolder[0]
|
|
99
109
|
: KT_Project.add.folder({ name: "Footage", parentFolder: this.rootFolder });
|
|
100
|
-
const compsFolder = KT_Project.find.folders({
|
|
110
|
+
const compsFolder = KT_Project.find.folders({
|
|
111
|
+
name: "Premiere Comps",
|
|
112
|
+
root: this.rootFolder,
|
|
113
|
+
});
|
|
101
114
|
this.compsFolder =
|
|
102
115
|
compsFolder && compsFolder.length > 0
|
|
103
116
|
? compsFolder[0]
|
|
@@ -115,9 +128,15 @@ class KT_Slides {
|
|
|
115
128
|
root: this.backgroundFolder,
|
|
116
129
|
})[0] as CompItem;
|
|
117
130
|
} else {
|
|
118
|
-
this.backgroundFolder = KT_Project.add.folder({
|
|
131
|
+
this.backgroundFolder = KT_Project.add.folder({
|
|
132
|
+
name: "Backgrounds",
|
|
133
|
+
parentFolder: this.rootFolder,
|
|
134
|
+
});
|
|
119
135
|
}
|
|
120
|
-
const backgroundComp = KT_Project.find.comps({
|
|
136
|
+
const backgroundComp = KT_Project.find.comps({
|
|
137
|
+
name: "Background",
|
|
138
|
+
root: this.backgroundFolder,
|
|
139
|
+
});
|
|
121
140
|
if (backgroundComp && backgroundComp.length > 0) {
|
|
122
141
|
this.backgroundComp = backgroundComp[0] as CompItem;
|
|
123
142
|
} else {
|
|
@@ -139,7 +158,10 @@ class KT_Slides {
|
|
|
139
158
|
);
|
|
140
159
|
}
|
|
141
160
|
|
|
142
|
-
const compedSlidesFolder = KT_Project.find.folders({
|
|
161
|
+
const compedSlidesFolder = KT_Project.find.folders({
|
|
162
|
+
name: "Comped Slides",
|
|
163
|
+
root: this.rootFolder,
|
|
164
|
+
});
|
|
143
165
|
this.compedSlidesFolder =
|
|
144
166
|
compedSlidesFolder && compedSlidesFolder.length > 0
|
|
145
167
|
? compedSlidesFolder[0]
|
|
@@ -179,7 +201,8 @@ class KT_Slides {
|
|
|
179
201
|
}
|
|
180
202
|
this.slidesFootage = footage as FootageItem[];
|
|
181
203
|
|
|
182
|
-
this.masterComp.duration =
|
|
204
|
+
this.masterComp.duration =
|
|
205
|
+
this.inDuration * 2 * (footage.length * this.slideMultiplier) + this.inDuration;
|
|
183
206
|
|
|
184
207
|
footage.forEach((item, index) => {
|
|
185
208
|
const randomColorIndex = this.getNextColor();
|
|
@@ -288,7 +311,8 @@ class KT_Slides {
|
|
|
288
311
|
if (i === pivotIndex) {
|
|
289
312
|
newLayer.startTime = newLayer.startTime - newLayer.inPoint;
|
|
290
313
|
} else {
|
|
291
|
-
newLayer.startTime =
|
|
314
|
+
newLayer.startTime =
|
|
315
|
+
newLayer.startTime - newLayer.inPoint - this.inDuration * 3;
|
|
292
316
|
}
|
|
293
317
|
|
|
294
318
|
newLayer.outPoint = this.duration;
|
|
@@ -320,7 +344,9 @@ class KT_Slides {
|
|
|
320
344
|
if (is.comp(item)) {
|
|
321
345
|
const keep = compsToKeep.indexOf(item.name) >= 0;
|
|
322
346
|
if (!keep) {
|
|
323
|
-
$.writeln(
|
|
347
|
+
$.writeln(
|
|
348
|
+
"Removing comp: " + item.name + "indexof: " + compsToKeep.indexOf(item.name)
|
|
349
|
+
);
|
|
324
350
|
item.remove();
|
|
325
351
|
}
|
|
326
352
|
}
|
|
@@ -351,7 +377,11 @@ class KT_Slides {
|
|
|
351
377
|
return subComp as CompItem;
|
|
352
378
|
};
|
|
353
379
|
|
|
354
|
-
private getSlideName = (
|
|
380
|
+
private getSlideName = (
|
|
381
|
+
item: _ItemClasses | Layer,
|
|
382
|
+
index: number,
|
|
383
|
+
infix: string = "-"
|
|
384
|
+
): string => {
|
|
355
385
|
return item.name.split("-")[0] + infix + (index + 1);
|
|
356
386
|
};
|
|
357
387
|
private disolveIn = (layer: Layer) => {
|
|
@@ -365,7 +395,10 @@ class KT_Slides {
|
|
|
365
395
|
|
|
366
396
|
private slideUp = (layer: Layer) => {
|
|
367
397
|
const finalPosition = layer.position.value;
|
|
368
|
-
layer.position.setValueAtTime(layer.startTime, [
|
|
398
|
+
layer.position.setValueAtTime(layer.startTime, [
|
|
399
|
+
finalPosition[0],
|
|
400
|
+
finalPosition[1] + this.slideDistance,
|
|
401
|
+
]);
|
|
369
402
|
layer.position.setValueAtTime(layer.startTime + this.inDuration, finalPosition);
|
|
370
403
|
let easeIn = new KeyframeEase(0, 20);
|
|
371
404
|
let easeOut = new KeyframeEase(0, 50);
|
|
@@ -386,7 +419,9 @@ class KT_Slides {
|
|
|
386
419
|
const property = layer.property("ADBE Time Remapping") as Property;
|
|
387
420
|
if (!is.layer || layer.canSetTimeRemapEnabled === false) return layer;
|
|
388
421
|
if (property) {
|
|
389
|
-
property.addKey(
|
|
422
|
+
property.addKey(
|
|
423
|
+
property.keyTime(property.numKeys) - layer.containingComp.frameDuration
|
|
424
|
+
);
|
|
390
425
|
property.removeKey(property.numKeys);
|
|
391
426
|
}
|
|
392
427
|
return layer;
|