kt-forpro-tools 1.1.0 → 1.1.1
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 +159 -19
- package/src/tests/batchSplitSlides.test.ts +23 -0
- package/src/tests/index.test.ts +70 -66
- package/src/tests/slides.test.ts +40 -0
- package/src/tests/splitSlides.test.ts +23 -0
package/package.json
CHANGED
package/src/slides.ts
CHANGED
|
@@ -54,6 +54,7 @@ class KT_Slides {
|
|
|
54
54
|
name: string = "Slides";
|
|
55
55
|
slideMultiplier: number = 1;
|
|
56
56
|
backgroundColor: [number, number, number] = [1, 1, 1];
|
|
57
|
+
backgroundPivotPrefix: string = "_BG_";
|
|
57
58
|
private getNextColor = colorSelector();
|
|
58
59
|
|
|
59
60
|
constructor(options: KT_SlidesOptions = {}) {
|
|
@@ -154,7 +155,7 @@ class KT_Slides {
|
|
|
154
155
|
this.width,
|
|
155
156
|
this.height,
|
|
156
157
|
1,
|
|
157
|
-
this.duration
|
|
158
|
+
this.duration,
|
|
158
159
|
);
|
|
159
160
|
}
|
|
160
161
|
|
|
@@ -206,6 +207,8 @@ class KT_Slides {
|
|
|
206
207
|
|
|
207
208
|
footage.forEach((item, index) => {
|
|
208
209
|
const randomColorIndex = this.getNextColor();
|
|
210
|
+
const groupStartTime = (index * this.slideMultiplier + 0) * this.inDuration * 2;
|
|
211
|
+
let lowerGroupLayer: Layer | null = null;
|
|
209
212
|
for (let i = 0; i < this.slideMultiplier; i++) {
|
|
210
213
|
const subComp = this.precompSlide(item as FootageItem, i);
|
|
211
214
|
|
|
@@ -213,31 +216,128 @@ class KT_Slides {
|
|
|
213
216
|
subComp as AVItem,
|
|
214
217
|
this.inDuration * 2,
|
|
215
218
|
this.masterComp,
|
|
216
|
-
(index * this.slideMultiplier + i) * this.inDuration * 2
|
|
219
|
+
(index * this.slideMultiplier + i) * this.inDuration * 2,
|
|
217
220
|
);
|
|
218
221
|
this.enableTimeRemap(layer as AVLayer);
|
|
219
222
|
layer.outPoint = this.masterComp.duration;
|
|
220
223
|
layer.label = randomColorIndex;
|
|
221
224
|
if (i === 0) {
|
|
222
|
-
|
|
223
|
-
backgroundlayer.selected = false;
|
|
224
|
-
backgroundlayer.moveToEnd();
|
|
225
|
-
layer.source.layers[1].selected = true;
|
|
225
|
+
lowerGroupLayer = layer;
|
|
226
226
|
}
|
|
227
227
|
this.slides.push(layer);
|
|
228
228
|
}
|
|
229
|
-
});
|
|
230
229
|
|
|
230
|
+
const bgPivot = this.masterComp.layers.add(this.backgroundComp);
|
|
231
|
+
|
|
232
|
+
this.fitLayerToComp(bgPivot, this.masterComp);
|
|
233
|
+
bgPivot.name = this.backgroundPivotPrefix + item.name.split("-")[0];
|
|
234
|
+
bgPivot.startTime = groupStartTime;
|
|
235
|
+
bgPivot.outPoint = this.masterComp.duration;
|
|
236
|
+
bgPivot.label = randomColorIndex;
|
|
237
|
+
this.enableTimeRemap(bgPivot as AVLayer);
|
|
238
|
+
if (lowerGroupLayer) {
|
|
239
|
+
bgPivot.moveAfter(lowerGroupLayer);
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
this.batchSplitSlides();
|
|
231
243
|
return this;
|
|
232
244
|
};
|
|
233
245
|
batchSplitSlides = () => {
|
|
234
|
-
const
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
|
|
246
|
+
const layers = KT_Layers.find.layers({ comps: this.masterComp });
|
|
247
|
+
const backgroundPivots = this.getBackgroundPivots(layers);
|
|
248
|
+
|
|
249
|
+
if (backgroundPivots.length === 0) {
|
|
250
|
+
const legacyBatches = this.getLegacySlideBatches(layers);
|
|
251
|
+
legacyBatches.forEach((batchLayers) => {
|
|
252
|
+
this.splitSlides(batchLayers);
|
|
253
|
+
});
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
backgroundPivots.forEach((pivotLayer, index, collection) => {
|
|
258
|
+
const nextPivot = collection[index + 1];
|
|
259
|
+
const nextPivotStart = nextPivot ? nextPivot.startTime : Number.MAX_VALUE;
|
|
260
|
+
|
|
261
|
+
const groupSlides = layers.filter((layer) => {
|
|
262
|
+
if (this.isBackgroundPivot(layer)) {
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
265
|
+
return layer.startTime >= pivotLayer.startTime && layer.startTime < nextPivotStart;
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
if (groupSlides.length === 0) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
this.splitSlides(groupSlides);
|
|
273
|
+
});
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
migrateBackgroundPivots = () => {
|
|
277
|
+
const layers = KT_Layers.find.layers({ comps: this.masterComp });
|
|
278
|
+
const backgroundPivots = this.getBackgroundPivots(layers);
|
|
279
|
+
if (backgroundPivots.length > 0) {
|
|
280
|
+
return 0;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const batches = this.getLegacySlideBatches(layers);
|
|
284
|
+
let addedPivots = 0;
|
|
285
|
+
|
|
286
|
+
batches.forEach((batchLayers) => {
|
|
287
|
+
if (!batchLayers || batchLayers.length === 0) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
let firstLayer = batchLayers[0];
|
|
292
|
+
let lowerGroupLayer = batchLayers[0];
|
|
293
|
+
batchLayers.forEach((layer) => {
|
|
294
|
+
if (layer.startTime < firstLayer.startTime) {
|
|
295
|
+
firstLayer = layer;
|
|
296
|
+
}
|
|
297
|
+
if (layer.index > lowerGroupLayer.index) {
|
|
298
|
+
lowerGroupLayer = layer;
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
const bgPivot = this.masterComp.layers.add(this.backgroundComp);
|
|
303
|
+
this.fitLayerToComp(bgPivot, this.masterComp);
|
|
304
|
+
bgPivot.name = this.backgroundPivotPrefix + firstLayer.name.split("-")[0];
|
|
305
|
+
bgPivot.startTime = firstLayer.startTime;
|
|
306
|
+
bgPivot.outPoint = this.masterComp.duration;
|
|
307
|
+
bgPivot.label = firstLayer.label;
|
|
308
|
+
this.enableTimeRemap(bgPivot as AVLayer);
|
|
309
|
+
bgPivot.moveAfter(lowerGroupLayer);
|
|
310
|
+
addedPivots += 1;
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
return addedPivots;
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
private getBackgroundPivots = (layers: Layer[]) => {
|
|
317
|
+
const pivots = layers.filter((layer) => this.isBackgroundPivot(layer));
|
|
318
|
+
pivots.sort((a, b) => a.startTime - b.startTime);
|
|
319
|
+
return pivots;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
private isBackgroundPivot = (layer: Layer) => {
|
|
323
|
+
const avLayer = layer as AVLayer;
|
|
324
|
+
if (avLayer.source && avLayer.source === this.backgroundComp) {
|
|
325
|
+
return true;
|
|
326
|
+
}
|
|
327
|
+
return layer.name.indexOf(this.backgroundPivotPrefix) === 0;
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
private getLegacySlideBatches = (layers: Layer[]) => {
|
|
331
|
+
const batches: Layer[][] = [];
|
|
332
|
+
const batchSize = this.slideMultiplier > 0 ? this.slideMultiplier : 1;
|
|
333
|
+
|
|
334
|
+
for (let i = 0; i < layers.length; ) {
|
|
335
|
+
const batchLayers = layers.slice(i, i + batchSize);
|
|
336
|
+
if (batchLayers.length === 0) {
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
for (let j = 0; j < batchLayers.length - 1; j++) {
|
|
241
341
|
const layer = batchLayers[j] as AVLayer;
|
|
242
342
|
const nextLayer = batchLayers[j + 1] as AVLayer;
|
|
243
343
|
if (layer.inPoint - nextLayer.inPoint > this.inDuration * 3) {
|
|
@@ -245,15 +345,23 @@ class KT_Slides {
|
|
|
245
345
|
break;
|
|
246
346
|
}
|
|
247
347
|
}
|
|
348
|
+
|
|
349
|
+
batches.push(batchLayers);
|
|
248
350
|
i += batchLayers.length;
|
|
249
|
-
this.splitSlides(batchLayers);
|
|
250
351
|
}
|
|
352
|
+
|
|
353
|
+
return batches;
|
|
251
354
|
};
|
|
355
|
+
|
|
252
356
|
splitSlides = (layers?: Layer[]) => {
|
|
253
357
|
if (!Array.isArray(layers) || layers.length <= 1) {
|
|
254
358
|
layers = this.masterComp.selectedLayers;
|
|
255
359
|
}
|
|
256
360
|
|
|
361
|
+
if (layers) {
|
|
362
|
+
layers = layers.filter((layer) => !this.isBackgroundPivot(layer));
|
|
363
|
+
}
|
|
364
|
+
|
|
257
365
|
if (!layers || layers.length === 0) {
|
|
258
366
|
$.writeln("No layers selected for precomp");
|
|
259
367
|
return;
|
|
@@ -322,6 +430,7 @@ class KT_Slides {
|
|
|
322
430
|
pivotIndex += 1;
|
|
323
431
|
// Ajustar la duración de la precomp
|
|
324
432
|
const solid = precomp.layers.add(this.backgroundComp);
|
|
433
|
+
this.fitLayerToComp(solid, precomp);
|
|
325
434
|
solid.moveToEnd();
|
|
326
435
|
precomp.duration = this.duration;
|
|
327
436
|
});
|
|
@@ -333,6 +442,9 @@ class KT_Slides {
|
|
|
333
442
|
const compsToKeep: string[] = [];
|
|
334
443
|
for (let i = 1; i <= layers.length; i++) {
|
|
335
444
|
const layer = layers[i];
|
|
445
|
+
if (this.isBackgroundPivot(layer)) {
|
|
446
|
+
continue;
|
|
447
|
+
}
|
|
336
448
|
const nameSplit = layer.name.split("-");
|
|
337
449
|
const slideIndex = parseInt(nameSplit[nameSplit.length - 1]) - 1;
|
|
338
450
|
const slideName = this.getSlideName(layer, slideIndex, "_Slide_");
|
|
@@ -345,7 +457,10 @@ class KT_Slides {
|
|
|
345
457
|
const keep = compsToKeep.indexOf(item.name) >= 0;
|
|
346
458
|
if (!keep) {
|
|
347
459
|
$.writeln(
|
|
348
|
-
"Removing comp: " +
|
|
460
|
+
"Removing comp: " +
|
|
461
|
+
item.name +
|
|
462
|
+
"indexof: " +
|
|
463
|
+
compsToKeep.indexOf(item.name),
|
|
349
464
|
);
|
|
350
465
|
item.remove();
|
|
351
466
|
}
|
|
@@ -357,11 +472,12 @@ class KT_Slides {
|
|
|
357
472
|
source: AVItem,
|
|
358
473
|
duration: number,
|
|
359
474
|
comp: CompItem = app.project.activeItem as CompItem,
|
|
360
|
-
startTime?: number
|
|
475
|
+
startTime?: number,
|
|
361
476
|
) {
|
|
362
477
|
const layer = comp.layers.add(source);
|
|
363
478
|
layer.startTime = 0;
|
|
364
479
|
layer.outPoint = duration;
|
|
480
|
+
this.fitLayerToComp(layer, comp);
|
|
365
481
|
this.slideUp(layer);
|
|
366
482
|
this.disolveIn(layer);
|
|
367
483
|
layer.startTime = startTime || 0;
|
|
@@ -380,7 +496,7 @@ class KT_Slides {
|
|
|
380
496
|
private getSlideName = (
|
|
381
497
|
item: _ItemClasses | Layer,
|
|
382
498
|
index: number,
|
|
383
|
-
infix: string = "-"
|
|
499
|
+
infix: string = "-",
|
|
384
500
|
): string => {
|
|
385
501
|
return item.name.split("-")[0] + infix + (index + 1);
|
|
386
502
|
};
|
|
@@ -414,13 +530,32 @@ class KT_Slides {
|
|
|
414
530
|
});
|
|
415
531
|
};
|
|
416
532
|
|
|
533
|
+
private fitLayerToComp = (layer: Layer, comp: CompItem): Layer => {
|
|
534
|
+
const avLayer = layer as AVLayer;
|
|
535
|
+
if (!avLayer.source) return layer;
|
|
536
|
+
const src = avLayer.source as CompItem | FootageItem;
|
|
537
|
+
const sourceWidth = src.width;
|
|
538
|
+
const sourceHeight = src.height;
|
|
539
|
+
if (!sourceWidth || !sourceHeight) return layer;
|
|
540
|
+
const scalePercent = Math.min(comp.width / sourceWidth, comp.height / sourceHeight) * 100;
|
|
541
|
+
const currentScale = layer.scale.value as number[];
|
|
542
|
+
const newScale: number[] = [scalePercent, scalePercent];
|
|
543
|
+
if (currentScale.length > 2) newScale.push(currentScale[2]);
|
|
544
|
+
layer.scale.setValue(newScale);
|
|
545
|
+
const center: number[] = [comp.width / 2, comp.height / 2];
|
|
546
|
+
const currentPos = layer.position.value as number[];
|
|
547
|
+
if (currentPos.length > 2) center.push(currentPos[2]);
|
|
548
|
+
layer.position.setValue(center);
|
|
549
|
+
return layer;
|
|
550
|
+
};
|
|
551
|
+
|
|
417
552
|
private enableTimeRemap = (layer: AVLayer) => {
|
|
418
553
|
layer.timeRemapEnabled = true;
|
|
419
554
|
const property = layer.property("ADBE Time Remapping") as Property;
|
|
420
555
|
if (!is.layer || layer.canSetTimeRemapEnabled === false) return layer;
|
|
421
556
|
if (property) {
|
|
422
557
|
property.addKey(
|
|
423
|
-
property.keyTime(property.numKeys) - layer.containingComp.frameDuration
|
|
558
|
+
property.keyTime(property.numKeys) - layer.containingComp.frameDuration,
|
|
424
559
|
);
|
|
425
560
|
property.removeKey(property.numKeys);
|
|
426
561
|
}
|
|
@@ -451,6 +586,11 @@ class __KT_SlidesAPI {
|
|
|
451
586
|
const slidesInstance = new KT_Slides(options);
|
|
452
587
|
slidesInstance.cleanUp();
|
|
453
588
|
};
|
|
589
|
+
|
|
590
|
+
static migrate = (options: KT_SlidesOptions) => {
|
|
591
|
+
const slidesInstance = new KT_Slides(options);
|
|
592
|
+
return slidesInstance.migrateBackgroundPivots();
|
|
593
|
+
};
|
|
454
594
|
}
|
|
455
595
|
|
|
456
596
|
export const KT_SlidesAPI = __KT_SlidesAPI;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { describe, it, expect } from "kt-testing-suite-core";
|
|
2
|
+
import { KT_Slides } from "../index";
|
|
3
|
+
|
|
4
|
+
describe("KT_Slides Tests", () => {
|
|
5
|
+
it("should batch split slides correctly", () => {
|
|
6
|
+
const duration = 30;
|
|
7
|
+
const slideMultiplier = 10;
|
|
8
|
+
const width = 3840;
|
|
9
|
+
const height = 2160;
|
|
10
|
+
|
|
11
|
+
const slides = new KT_Slides({
|
|
12
|
+
name: "Test Slides",
|
|
13
|
+
duration: duration,
|
|
14
|
+
width: width,
|
|
15
|
+
height: height,
|
|
16
|
+
comp: app.project.activeItem as CompItem,
|
|
17
|
+
slideMultiplier: slideMultiplier,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
slides.batchSplitSlides();
|
|
21
|
+
slides.cleanUp();
|
|
22
|
+
});
|
|
23
|
+
});
|
package/src/tests/index.test.ts
CHANGED
|
@@ -9,80 +9,84 @@ import {
|
|
|
9
9
|
afterEach,
|
|
10
10
|
} from "kt-testing-suite-core";
|
|
11
11
|
import { KT_Slides, KT_ForproTools, KT_SlidesFreeze } from "../index";
|
|
12
|
-
import "./freezer.test";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const slideMultiplier = 16;
|
|
17
|
-
const width = 3840;
|
|
18
|
-
const height = 2160;
|
|
12
|
+
// import "./freezer.test";
|
|
13
|
+
// import "./slides.test";
|
|
14
|
+
// import "./batchSplitSlides.test";
|
|
15
|
+
import "./splitSlides.test";
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// KT_ForproTools.utils.copyMarkersToComp(app.project.activeItem as CompItem);
|
|
27
|
-
// KT_ForproTools.utils.copyMasksFromMasterToLayer();
|
|
28
|
-
// const folder = Folder.selectDialog("Select a folder with language subfolders");
|
|
29
|
-
// $.writeln("Selected folder: " + folder?.fsName);
|
|
30
|
-
// KT_ForproTools.utils.precompAndKeyOut("cat");
|
|
31
|
-
// KT_ForproTools.utils.createCleanupStructure();
|
|
17
|
+
// describe("KtForproTools Tests", () => {
|
|
18
|
+
// it("should import the slides module", () => {
|
|
19
|
+
// const duration = 30;
|
|
20
|
+
// const slideMultiplier = 16;
|
|
21
|
+
// const width = 3840;
|
|
22
|
+
// const height = 2160;
|
|
32
23
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
24
|
+
// KT_ForproTools.Cleanup();
|
|
25
|
+
// KT_ForproTools.utils.cleanNamePrecomp();
|
|
26
|
+
// KT_ForproTools.utils.sendCleanupToMediaEncoder(["esp", "cat"]);
|
|
27
|
+
// KT_ForproTools.utils.sendLanguagesToMediaEncoder();
|
|
28
|
+
// KT_ForproTools.utils.sendCleanupToMediaEncoder();
|
|
29
|
+
// KT_ForproTools.utils.autoPrecompAndKeyOut();
|
|
30
|
+
// KT_ForproTools.utils.copyMarkersToComp(app.project.activeItem as CompItem);
|
|
31
|
+
// KT_ForproTools.utils.copyMasksFromMasterToLayer();
|
|
32
|
+
// const folder = Folder.selectDialog("Select a folder with language subfolders");
|
|
33
|
+
// $.writeln("Selected folder: " + folder?.fsName);
|
|
34
|
+
// KT_ForproTools.utils.precompAndKeyOut("cat");
|
|
35
|
+
// KT_ForproTools.utils.createCleanupStructure();
|
|
41
36
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
37
|
+
// const slides = new KT_Slides({
|
|
38
|
+
// name: "Test Slides",
|
|
39
|
+
// duration: duration,
|
|
40
|
+
// width: width,
|
|
41
|
+
// height: height,
|
|
42
|
+
// comp: app.project.activeItem as CompItem,
|
|
43
|
+
// slideMultiplier: slideMultiplier,
|
|
44
|
+
// });
|
|
48
45
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// .concat(((timeTaken % 60000) / 1000).toFixed(0), "s")
|
|
56
|
-
// );
|
|
46
|
+
// slides.cleanUp();
|
|
47
|
+
// slides.import();
|
|
48
|
+
// slides.splitSlides();
|
|
49
|
+
// const startTime = new Date().getTime();
|
|
50
|
+
// slides.batchSplitSlides();
|
|
51
|
+
// // slides.splitSlides();
|
|
57
52
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
// const endTime = new Date().getTime();
|
|
54
|
+
// const timeTaken = endTime - startTime;
|
|
55
|
+
// //display time taken in minutes and seconds format mm:ss
|
|
56
|
+
// $.writeln(
|
|
57
|
+
// "Time taken: "
|
|
58
|
+
// .concat(Math.floor(timeTaken / 60000).toFixed(0), ":")
|
|
59
|
+
// .concat(((timeTaken % 60000) / 1000).toFixed(0), "s")
|
|
60
|
+
// );
|
|
63
61
|
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
// const comp = app.project.activeItem as CompItem;
|
|
63
|
+
// const layer = comp.layers[1];
|
|
64
|
+
// const masks = layer.mask;
|
|
65
|
+
// const mask1 = masks.property(1);
|
|
66
|
+
// const maskShape = mask1.property("Mask Path").value;
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
// var inspectProps = [];
|
|
70
|
-
// for (let i = 1; i <= mask1.numProperties; i++) {
|
|
71
|
-
// inspectProps.push(mask1.property(i));
|
|
72
|
-
// }
|
|
68
|
+
// const layer2 = comp.layers[2];
|
|
69
|
+
// const masks2 = layer2.Masks.addProperty("Mask");
|
|
73
70
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
// masks2.inverted = mask1.inverted;
|
|
81
|
-
// masks2.maskMode = mask1.maskMode;
|
|
82
|
-
// expect(maskShape).toBeGreaterThan(0);
|
|
71
|
+
// var newMask = masks2.property("maskShape");
|
|
72
|
+
// var theShape = newMask.value;
|
|
73
|
+
// var inspectProps = [];
|
|
74
|
+
// for (let i = 1; i <= mask1.numProperties; i++) {
|
|
75
|
+
// inspectProps.push(mask1.property(i));
|
|
76
|
+
// }
|
|
83
77
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
78
|
+
// const newShape = new Shape();
|
|
79
|
+
// newShape.vertices = maskShape.vertices;
|
|
80
|
+
// newShape.inTangents = maskShape.inTangents;
|
|
81
|
+
// newShape.outTangents = maskShape.outTangents;
|
|
82
|
+
// newShape.isClosed = maskShape.isClosed;
|
|
83
|
+
// newMask.setValue(newShape);
|
|
84
|
+
// masks2.inverted = mask1.inverted;
|
|
85
|
+
// masks2.maskMode = mask1.maskMode;
|
|
86
|
+
// expect(maskShape).toBeGreaterThan(0);
|
|
87
|
+
|
|
88
|
+
// expect(maskShape).toBeGreaterThan(0);
|
|
89
|
+
// });
|
|
90
|
+
// });
|
|
87
91
|
|
|
88
92
|
runTests();
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { describe, it, expect } from "kt-testing-suite-core";
|
|
2
|
+
import { KT_Slides } from "../index";
|
|
3
|
+
|
|
4
|
+
describe("KT_Slides Tests", () => {
|
|
5
|
+
it("should configure slides module", () => {
|
|
6
|
+
const duration = 30;
|
|
7
|
+
const slideMultiplier = 10;
|
|
8
|
+
const width = 3840;
|
|
9
|
+
const height = 2160;
|
|
10
|
+
|
|
11
|
+
const slides = new KT_Slides({
|
|
12
|
+
name: "Test Slides",
|
|
13
|
+
duration: duration,
|
|
14
|
+
width: width,
|
|
15
|
+
height: height,
|
|
16
|
+
comp: app.project.activeItem as CompItem,
|
|
17
|
+
slideMultiplier: slideMultiplier,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// slides.cleanUp();
|
|
21
|
+
slides.import();
|
|
22
|
+
// slides.splitSlides();
|
|
23
|
+
// const startTime = new Date().getTime();
|
|
24
|
+
// slides.batchSplitSlides();
|
|
25
|
+
|
|
26
|
+
// const endTime = new Date().getTime();
|
|
27
|
+
// const timeTaken = endTime - startTime;
|
|
28
|
+
// $.writeln(
|
|
29
|
+
// "Time taken: "
|
|
30
|
+
// .concat(Math.floor(timeTaken / 60000).toFixed(0), ":")
|
|
31
|
+
// .concat(((timeTaken % 60000) / 1000).toFixed(0), "s")
|
|
32
|
+
// );
|
|
33
|
+
|
|
34
|
+
expect(duration).toBe(30);
|
|
35
|
+
expect(slideMultiplier).toBe(16);
|
|
36
|
+
expect(width).toBe(3840);
|
|
37
|
+
expect(height).toBe(2160);
|
|
38
|
+
expect(!!KT_Slides).toBe(true);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { describe, it, expect } from "kt-testing-suite-core";
|
|
2
|
+
import { KT_Slides } from "../index";
|
|
3
|
+
|
|
4
|
+
describe("KT_Slides Tests", () => {
|
|
5
|
+
it("should split selectedslides correctly", () => {
|
|
6
|
+
const duration = 30;
|
|
7
|
+
const slideMultiplier = 10;
|
|
8
|
+
const width = 3840;
|
|
9
|
+
const height = 2160;
|
|
10
|
+
|
|
11
|
+
const slides = new KT_Slides({
|
|
12
|
+
name: "Test Slides",
|
|
13
|
+
duration: duration,
|
|
14
|
+
width: width,
|
|
15
|
+
height: height,
|
|
16
|
+
comp: app.project.activeItem as CompItem,
|
|
17
|
+
slideMultiplier: slideMultiplier,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
slides.splitSlides();
|
|
21
|
+
// slides.cleanUp();
|
|
22
|
+
});
|
|
23
|
+
});
|