@nexrender/core 1.31.0 → 1.35.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.
@@ -1,4 +1,4 @@
1
- module.exports = /*syntax:js*/ `// Command line renderer for After Effects. (nexrender-patch-v1.0.2)
1
+ module.exports = /*syntax:js*/ `// Command line renderer for After Effects. (nexrender-patch-v1.0.3)
2
2
 
3
3
  // This function constructs an AECommandLineRenderer object.
4
4
  // One and only one of these will be created to perform rendering tasks
@@ -120,7 +120,7 @@ function AECommandLineRenderer() {
120
120
  // Report an error. This writes errors to the log file, if present.
121
121
  // This is called from the context of the application, so we
122
122
  // need to precede variable names with gAECommandLineRenderer
123
- //
123
+ //
124
124
  function checkParentDied() {
125
125
  var result = false;
126
126
  if (gAECommandLineRenderer.log_file instanceof Socket) {
@@ -143,13 +143,13 @@ function AECommandLineRenderer() {
143
143
  checkParentDied();
144
144
  if (severity_string == "PROBLEM" || severity_string == "FATAL") {
145
145
  // These two errors cause us to change the exit code.
146
- // We don't write an error or throw here, because we got here as part of a thrown
146
+ // We don't write an error or throw here, because we got here as part of a thrown
147
147
  // error already, and the message will be printed as part of the catch.
148
148
  gAECommandLineRenderer.SetExitCode(gAECommandLineRenderer.EXIT_AE_RUNTIME);
149
149
  } else {
150
150
  // PROBLEM and FATAL will throw exceptions, and so will be logged to the file
151
151
  // when we catch the exception.
152
- // All other errors (NAKED, INFO, WARNING, PROGRESS, and DEBUG) will not
152
+ // All other errors (NAKED, INFO, WARNING, PROGRESS, and DEBUG) will not
153
153
  // throw exceptions. So we log them to the file right here:
154
154
  if (gAECommandLineRenderer.is_verbose_mode) {
155
155
  if (gAECommandLineRenderer.log_file != null) {
@@ -177,7 +177,7 @@ function AECommandLineRenderer() {
177
177
 
178
178
  // Report an error. This establishes exitCodes for reporting errors from AfterFX.
179
179
  function my_SetExitCode(code) {
180
- // Some codes are set differently depending on whether we have a custom user
180
+ // Some codes are set differently depending on whether we have a custom user
181
181
  // log file. Check for these and use the alternate if appropriate.
182
182
  var real_code = code;
183
183
  if (gAECommandLineRenderer.has_user_log_file) {
@@ -203,7 +203,7 @@ function AECommandLineRenderer() {
203
203
  }
204
204
  }
205
205
 
206
- // Arguments may be enclosed in quotes. This
206
+ // Arguments may be enclosed in quotes. This
207
207
  // will remove them and return the result.
208
208
  function my_StripAnyEnclosingQuotes(inString) {
209
209
  var result = inString;
@@ -514,7 +514,7 @@ function AECommandLineRenderer() {
514
514
  try {
515
515
  // While rendering we'll report errors to the log file.
516
516
  if (app.onError == this.onError) {
517
- // If the previous error handler is just this one, don't store it.
517
+ // If the previous error handler is just this one, don't store it.
518
518
  // That can happen in extreme cases where this script does not get a
519
519
  // chance to clean up and put back the oldErrorHandler when it's done.
520
520
  this.oldErrorHandler = null;
@@ -719,10 +719,10 @@ function AECommandLineRenderer() {
719
719
  }
720
720
  } else {
721
721
  // Render times are stored as timeSpanStart and timeSpanDuration.
722
- // Setting only the timeSpanStart will not change the timeSpanDuration and
723
- // so will move the end time, but we want the end time unchanged if
722
+ // Setting only the timeSpanStart will not change the timeSpanDuration and
723
+ // so will move the end time, but we want the end time unchanged if
724
724
  // it was not specified.
725
- // So we must calculate both start_time and end_time,
725
+ // So we must calculate both start_time and end_time,
726
726
  // then set both timeSpanStart and timeSpanDuration.
727
727
  // Note: frameDuration is stored in the comp.
728
728
  var start_time = rqi.timeSpanStart;
@@ -760,12 +760,12 @@ function AECommandLineRenderer() {
760
760
  // Increment as defined here is one greater then the
761
761
  // the render queue item's skipFrames.
762
762
  // skipFrames 0 is the same as increment of 1.
763
- //
763
+ //
764
764
  rqi.skipFrames = (this.in_increment - 1);
765
765
  }
766
766
  }
767
767
 
768
- // If we are in verbose mode, set the log type to ERRORS_AND_PER_FRAME_INFO
768
+ // If we are in verbose mode, set the log type to ERRORS_AND_PER_FRAME_INFO
769
769
  // for all RQ items we are about to render.
770
770
  if (this.is_verbose_mode) {
771
771
  this.SetLogPerFrameInfoInRQ();
@@ -12,7 +12,9 @@ const defaultPaths = {
12
12
  '/Applications/Adobe After Effects CC 2019',
13
13
  '/Applications/Adobe After Effects 2020',
14
14
  '/Applications/Adobe After Effects 2021',
15
+ '/Applications/Adobe After Effects 2022',
15
16
  '/Applications/Adobe After Effects CC 2021',
17
+ '/Applications/Adobe After Effects CC 2022',
16
18
  ],
17
19
  win32: [
18
20
  'C:\\Program Files\\Adobe\\After Effects CC',
@@ -25,6 +27,7 @@ const defaultPaths = {
25
27
  'C:\\Program Files\\Adobe\\After Effects CC 2020\\Support Files',
26
28
  'C:\\Program Files\\Adobe\\After Effects 2020\\Support Files',
27
29
  'C:\\Program Files\\Adobe\\After Effects 2021\\Support Files',
30
+ 'C:\\Program Files\\Adobe\\After Effects 2022\\Support Files',
28
31
 
29
32
  'C:\\Program Files\\Adobe\\Adobe After Effects CC',
30
33
  'C:\\Program Files\\Adobe\\Adobe After Effects CC\\Support Files',
@@ -36,6 +39,7 @@ const defaultPaths = {
36
39
  'C:\\Program Files\\Adobe\\Adobe After Effects CC 2020\\Support Files',
37
40
  'C:\\Program Files\\Adobe\\Adobe After Effects 2020\\Support Files',
38
41
  'C:\\Program Files\\Adobe\\Adobe After Effects 2021\\Support Files',
42
+ 'C:\\Program Files\\Adobe\\Adobe After Effects 2022\\Support Files',
39
43
  ],
40
44
  wsl: [
41
45
  '/mnt/c/Program Files/Adobe/After Effects CC',
@@ -48,6 +52,7 @@ const defaultPaths = {
48
52
  '/mnt/c/Program Files/Adobe/After Effects CC 2020/Support Files',
49
53
  '/mnt/c/Program Files/Adobe/After Effects 2020/Support Files',
50
54
  '/mnt/c/Program Files/Adobe/After Effects 2021/Support Files',
55
+ '/mnt/c/Program Files/Adobe/After Effects 2022/Support Files',
51
56
 
52
57
  '/mnt/c/Program Files/Adobe/Adobe After Effects CC',
53
58
  '/mnt/c/Program Files/Adobe/Adobe After Effects CC/Support Files',
@@ -59,6 +64,7 @@ const defaultPaths = {
59
64
  '/mnt/c/Program Files/Adobe/Adobe After Effects CC 2020/Support Files',
60
65
  '/mnt/c/Program Files/Adobe/Adobe After Effects 2020/Support Files',
61
66
  '/mnt/c/Program Files/Adobe/Adobe After Effects 2021/Support Files',
67
+ '/mnt/c/Program Files/Adobe/Adobe After Effects 2022/Support Files',
62
68
  ],
63
69
  }
64
70
 
@@ -1,7 +1,8 @@
1
1
  const fs = require('fs')
2
2
  const path = require('path')
3
3
  const mkdirp = require('mkdirp')
4
- const patched = require('../assets/commandLineRenderer.jsx')
4
+ const patchedDefault = require('../assets/commandLineRenderer-default.jsx')
5
+ const patched2022 = require('../assets/commandLineRenderer-2022.jsx')
5
6
 
6
7
  const writeTo = (data, dst) => fs.writeFileSync(dst, data)
7
8
  const copyTo = (src, dst) => fs.writeFileSync(dst, fs.readFileSync(src))
@@ -14,6 +15,13 @@ module.exports = (settings) => {
14
15
  const targetScript = 'commandLineRenderer.jsx';
15
16
 
16
17
  const afterEffects = path.dirname(settings.binary)
18
+ const afterEffectsYearMatch = afterEffects.match(/(20[0-9]{2})/);
19
+
20
+ let patched = patchedDefault;
21
+ if (afterEffectsYearMatch && afterEffectsYearMatch[0] >= "2022") {
22
+ patched = patched2022;
23
+ }
24
+
17
25
  const originalFile = path.join(afterEffects, 'Scripts', 'Startup', targetScript)
18
26
  const backupFile = path.join(afterEffects, 'Backup.Scripts', 'Startup', targetScript)
19
27
 
package/src/index.js CHANGED
@@ -67,6 +67,7 @@ const init = (settings) => {
67
67
 
68
68
  debug: false,
69
69
  multiFrames: false,
70
+ multiFramesCPU: 90,
70
71
  maxMemoryPercent: undefined,
71
72
  imageCachePercent: undefined,
72
73
  wslMap: undefined,
@@ -21,9 +21,13 @@ module.exports = actionType => (job, settings) => {
21
21
  settings.logger.log(`[${job.uid}] applying ${actionType} actions...`);
22
22
 
23
23
  return PromiseSerial((job.actions[actionType] || []).map(action => () => {
24
- return requireg(action.module)(job, settings, action, actionType).catch(err => {
25
- return Promise.reject(new Error(`Error loading ${actionType} module ${action.module}: ${err}`))
26
- });
24
+ if(settings.actions && settings.actions[action.module]){
25
+ return settings.actions[action.module](job, settings, action, actionType);
26
+ }else{
27
+ return requireg(action.module)(job, settings, action, actionType).catch(err => {
28
+ return Promise.reject(new Error(`Error loading ${actionType} module ${action.module}: ${err}`));
29
+ });
30
+ }
27
31
  })).then(() => {
28
32
  return Promise.resolve(job)
29
33
  });
@@ -53,7 +53,7 @@ module.exports = (job, settings) => {
53
53
 
54
54
  option(params, '-r', jobScriptFile);
55
55
 
56
- if (!settings.skipRender && settings.multiFrames) params.push('-mp');
56
+ if (!settings.skipRender && settings.multiFrames) params.push('-mfr', 'ON', settings.multiFramesCPU);
57
57
  if (settings.reuse) params.push('-reuse');
58
58
  if (job.template.continueOnMissing) params.push('-continueOnMissingFootage')
59
59
 
@@ -186,7 +186,17 @@ module.exports = (job, settings) => {
186
186
  return resolve(job)
187
187
  }
188
188
 
189
- if (!fs.existsSync(outputFile)) {
189
+ // When a render has finished, look for a .mov file too, on AE 2022
190
+ // the outputfile appears to be forced as .mov.
191
+ // We need to maintain this here while we have 2022 and 2020
192
+ // workers simultaneously
193
+ const movOutputFile = outputFile.replace(/\.avi$/g, '.mov')
194
+ const existsMovOutputFile = fs.existsSync(movOutputFile)
195
+ if (existsMovOutputFile) {
196
+ job.output = movOutputFile
197
+ }
198
+
199
+ if (!fs.existsSync(job.output)) {
190
200
  if (fs.existsSync(logPath)) {
191
201
  settings.logger.log(`[${job.uid}] dumping aerender log:`)
192
202
  settings.logger.log(fs.readFileSync(logPath, 'utf8'))
@@ -195,7 +205,7 @@ module.exports = (job, settings) => {
195
205
  return reject(new Error(`Couldn't find a result file: ${outputFile}`))
196
206
  }
197
207
 
198
- const stats = fs.statSync(outputFile)
208
+ const stats = fs.statSync(job.output)
199
209
 
200
210
  /* file smaller than 1000 bytes */
201
211
  if (stats.size < 1000) {