@nexrender/core 1.48.4 → 1.48.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexrender/core",
3
- "version": "1.48.4",
3
+ "version": "1.48.5",
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": "cac67c43fb0a86570b7de49bffba0adc09fa756a"
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