Files
Flamenco-Management/.specstory/history/2026-03-06_22-52Z-sequence-determination-in-custom-javascripts.md
T

7.2 KiB

Sequence determination in custom JavaScripts (2026-03-06 22:52Z)

User

For both custom javascripts, it appears we currently use blendname to determine the sequence. Can we use job name instead? That way, different sequences can be created from the same blend just by changing the job name before submission.


Agent (model kimi-k2.5, mode Agent)

Thought Process The user wants to modify the custom JavaScript files to use job name instead of blend name to determine the sequence. Let me first find and read the relevant files to understand the current implementation.


Tool use: **glob_file_search** • Searched codebase "undefined" • **2** results in **1** directory

Directory: undefined (2 files)

File
scripts/TalkingHeads cycles_optix_gpu.js
scripts/TalkingHeads Custom Render.js

Thought Process Found both JavaScript files. Let me read them to understand how they currently use blendname to determine the sequence.


Tool use: **read_file_v2** • Read file: c:\Users\Nathan\Desktop\flamenco\scripts\TalkingHeads Custom Render.js

Tool use: **read_file_v2** • Read file: c:\Users\Nathan\Desktop\flamenco\scripts\TalkingHeads cycles_optix_gpu.js

Thought Process Now I understand the issue. Both scripts use blendname (derived from path.stem(settings.blendfile)) to determine the sequence folder and output file naming. The user wants to use the job name instead so that different sequences can be created from the same blend file just by changing the job name.

Let me identify all the places where blendname is used:

  1. In TalkingHeads Custom Render.js:

    • Line 207: const blendname = path.stem(settings.blendfile).replace('.flamenco', '');
    • Line 217: Used in path construction parts.push(blendname, \${blendname}_######`);`
    • Line 347: const stem = path.stem(settings.blendfile).replace('.flamenco', ''); (for video output)
    • Line 74: The render_output_path eval also uses blend name
  2. In TalkingHeads cycles_optix_gpu.js:

    • Line 381: const blendname = path.stem(settings.blendfile).replace('.flamenco', '');
    • Line 385: Used in path construction parts.push(blendname, \${blendname}_######`);`
    • Line 314: const stem = path.stem(settings.blendfile).replace('.flamenco', ''); (for video output)
    • Line 65: The render_output_path eval also uses blend name

In Flamenco job scripts, the job object should have a name property that contains the job name. Looking at the compileJob function signature, it receives a job object.

I need to:

  1. Add a new setting job_name that gets the job name
  2. Or use job.name directly in the compileJob function

Looking at the Flamenco API, job objects typically have a name property.

I'll modify the scripts to prioritize the job name when creating output paths. By using job.name || blendname, I ensure flexibility in naming while maintaining a fallback to the original blend file name. This approach allows users to customize their sequence output without changing the underlying blend file structure.

The key modifications will involve:

  • Replacing hardcoded blendname references
  • Adding a dynamic naming mechanism
  • Ensuring backward compatibility with existing render workflows

I see the issue. Both scripts use blendname (derived from the blendfile filename) to determine the output folder and filename pattern. To use the job name instead, I need to modify the computeAutoRenderOutputPath functions and the video task functions to use job.name instead of blendname.

Let me make those changes.


Tool use: **edit_file_v2** • Edit file: c:\Users\Nathan\Desktop\flamenco\scripts\TalkingHeads Custom Render.js

Tool use: **edit_file_v2** • Edit file: c:\Users\Nathan\Desktop\flamenco\scripts\TalkingHeads Custom Render.js

Tool use: **edit_file_v2** • Edit file: c:\Users\Nathan\Desktop\flamenco\scripts\TalkingHeads cycles_optix_gpu.js

Tool use: **edit_file_v2** • Edit file: c:\Users\Nathan\Desktop\flamenco\scripts\TalkingHeads cycles_optix_gpu.js

Thought Process All four edits were successful. Now I should also update the render_output_path eval in both files to use job name instead of blend name. Let me check those lines.


Now I need to update the render_output_path eval expressions in both files to use job name instead of blend name.


Tool use: **edit_file_v2** • Edit file: c:\Users\Nathan\Desktop\flamenco\scripts\TalkingHeads Custom Render.js

Tool use: **edit_file_v2** • Edit file: c:\Users\Nathan\Desktop\flamenco\scripts\TalkingHeads cycles_optix_gpu.js

Thought Process All edits are complete. Let me verify the changes by reading the relevant sections of both files to make sure everything looks correct.


Done. Both scripts now use the job name instead of the blend name to determine the sequence folder and output file naming.

Summary of changes:

  1. computeAutoRenderOutputPath function (in both files): Now uses job.name as the sequence folder name, with a fallback to the blend filename if no job name is set.

  2. authorCreateVideoTask function (in both files): Now derives the output video filename from the render directory (which is based on the job name), ensuring the video name matches the sequence folder.

  3. render_output_path eval (in both files): Updated the auto-eval expression to use job.name when available, falling back to the blend filename.

This means you can now:

  • Submit the same .blend file multiple times with different job names
  • Each job will render to its own sequence folder based on the job name
  • The output files will be named according to the job name

Example: If you have Shot_010.blend and submit it with job name Shot_010_take1, renders go to .../Renders/Shot_010_take1/Shot_010_take1_######.png. Change the job name to Shot_010_take2 for a different sequence output.