@nexrender/core 1.48.4 → 1.49.0

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016-2018 Vladyslav Hrytsenko
3
+ Copyright (c) 2016-2024 Vladyslav Hrytsenko
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexrender/core",
3
- "version": "1.48.4",
3
+ "version": "1.49.0",
4
4
  "main": "src/index.js",
5
5
  "author": "Inlife",
6
6
  "homepage": "https://www.nexrender.com",
@@ -38,5 +38,5 @@
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "4642413c229aaa003a7ddab0d603dd59a14e6c07"
41
+ "gitHead": "09d4fa21b61322d4c208d1f95c4271a1d1bb7f62"
42
42
  }
@@ -17,7 +17,7 @@ nexrender.typesMatch = function (types, layer) {
17
17
  }).length > 0;
18
18
  };
19
19
 
20
- nexrender.replaceFootage = function (layer, filepath, sequence) {
20
+ nexrender.replaceFootage = function (layer, filepath, sequence, removeOldFootage) {
21
21
  if (!layer) { return false; }
22
22
 
23
23
  var file = new File(filepath);
@@ -35,7 +35,7 @@ nexrender.replaceFootage = function (layer, filepath, sequence) {
35
35
 
36
36
  layer.replaceSource(theImport, true);
37
37
 
38
- if (oldFootage) oldFootage.remove();
38
+ if (removeOldFootage && oldFootage) oldFootage.remove();
39
39
 
40
40
  return true;
41
41
  };
@@ -178,12 +178,12 @@ nexrender.selectLayersByType = function(
178
178
  });
179
179
 
180
180
  if (!foundOnce && !continueOnMissing) {
181
- throw new Error(
182
- "nexrender: Couldn't find any layers by provided type ("
181
+ throw new Error(
182
+ "nexrender: Couldn't find any layers by provided type ("
183
183
  + type +
184
- ") inside a composition: "
184
+ ") inside a composition: "
185
185
  + compositionName
186
- );
186
+ );
187
187
  }
188
188
  };
189
189
 
@@ -259,4 +259,4 @@ nexrender.changeValueForKeypath = function (layer, keys, val) {
259
259
 
260
260
  /* end of custom user script */
261
261
  },{}]},{},[1]);
262
- `
262
+ `;
@@ -1,9 +1,12 @@
1
1
  const { selectLayers } = require('./helpers')
2
2
  const { checkForWSL } = require('../../helpers/path')
3
3
 
4
+ // wrapBoolean
5
+ const wb = (value) => (value ? 'true' : 'false')
6
+
4
7
  const wrapFootage = (job, settings, { dest, ...asset }) => (`(function() {
5
8
  ${selectLayers(job, asset, `function(layer) {
6
- nexrender.replaceFootage(layer, '${checkForWSL(dest.replace(/\\/g, "\\\\"), settings)}', ${asset.sequence ? 'true' : 'false'})
9
+ nexrender.replaceFootage(layer, '${checkForWSL(dest.replace(/\\/g, "\\\\"), settings)}', ${wb(asset.sequence)}, ${wb(asset.removeOld)})
7
10
  }`)}
8
11
  })();\n`)
9
12