update flamscripts with new render seqzip workflow

This commit is contained in:
Nathan
2025-11-06 11:02:01 -07:00
parent 153c1d4a1e
commit 712c1215ed
3 changed files with 1047 additions and 79 deletions

View File

@@ -46,18 +46,6 @@ const JOB_TYPE = {
},
description: "Base path where renders are stored, typically the project's Renders folder. If empty, derived automatically."
},
{
key: "daily_path",
type: "string",
required: false,
visible: "submission",
eval: "__import__('datetime').datetime.now().strftime('daily_%y%m%d')",
evalInfo: {
showLinkButton: true,
description: "Auto-fill with today's daily folder name"
},
description: "Daily folder name under the render root, e.g. 'daily_250813'. If empty, auto-fills to today's date."
},
{
key: "use_submodule",
label: "Use Submodule",
@@ -79,14 +67,14 @@ const JOB_TYPE = {
},
description: "Optional submodule under Renders (e.g. 'Waterspider B'). If empty, omitted."
},
{
key: "render_output_path",
type: "string",
subtype: "file_path",
editable: false,
eval: "str(Path(abspath(settings.render_output_root or '//'), ((str(settings.submodule or '').strip()) if (settings.use_submodule and str(settings.submodule or '').strip()) else ((__import__('os').path.basename(__import__('os').path.dirname(bpy.data.filepath))) if settings.use_submodule else '')), (settings.daily_path or __import__('datetime').datetime.now().strftime('daily_%y%m%d')), jobname, jobname + '_######'))",
description: "Final file path of where render output will be saved"
},
{
key: "render_output_path",
type: "string",
subtype: "file_path",
editable: false,
eval: "((lambda Path, abspath, os_path, settings_obj, blend: str(Path(abspath(settings_obj.render_output_root or '//')) / (((str(settings_obj.submodule or '').strip()) if (settings_obj.use_submodule and str(settings_obj.submodule or '').strip()) else ((os_path.basename(os_path.dirname(bpy.data.filepath))) if settings_obj.use_submodule else ''))) / blend / (blend + '_######')))(__import__('pathlib').Path, __import__('os').path.abspath, __import__('os').path, settings, __import__('os').path.splitext(__import__('os').path.basename(bpy.data.filepath))[0]))",
description: "Final file path of where render output will be saved"
},
// Automatically evaluated settings:
{
@@ -165,10 +153,6 @@ function compileJob(job) {
if (projectRoot) settings.render_output_root = path.join(projectRoot, 'Renders');
else settings.render_output_root = path.join(path.dirname(settings.blendfile), 'Renders');
}
if (!settings.daily_path || String(settings.daily_path).trim() === '') {
const createdDate = job && job.created ? new Date(job.created) : new Date();
settings.daily_path = formatDailyYYMMDD(createdDate);
}
const recomposed = computeAutoRenderOutputPath(job);
if (recomposed) settings.render_output_path = recomposed;
} catch (e) {
@@ -200,7 +184,7 @@ function compileJob(job) {
}
}
// Derive project root, submodule, and daily path from the blendfile path.
// Derive project root and submodule from the blendfile path.
function computeAutoRenderOutputPath(job) {
const settings = job.settings || {};
if (!settings.blendfile) return null;
@@ -220,26 +204,17 @@ function computeAutoRenderOutputPath(job) {
renderRoot = path.join(path.dirname(settings.blendfile), 'Renders');
}
// Resolve daily path
let daily = null;
if (settings.daily_path && ("" + settings.daily_path).trim()) {
daily = ("" + settings.daily_path).trim();
} else {
const createdDate = job && job.created ? new Date(job.created) : new Date();
daily = formatDailyYYMMDD(createdDate);
}
const jobname = (job && job.name) ? job.name : path.stem(settings.blendfile).replace('.flamenco', '');
const blendname = path.stem(settings.blendfile).replace('.flamenco', '');
print('AutoPath: blendfile=', settings.blendfile);
print('AutoPath: projectRoot=', projectRoot);
print('AutoPath: renderRoot=', renderRoot);
print('AutoPath: submodule=', submodule);
print('AutoPath: daily=', daily);
print('AutoPath: jobname=', jobname);
print('AutoPath: blendname=', blendname);
const parts = [renderRoot];
if (submodule) parts.push(submodule);
parts.push(daily, jobname, `${jobname}_######`);
parts.push(blendname, `${blendname}_######`);
const finalPath = path.join.apply(path, parts);
print('AutoPath: finalPath=', finalPath);
return finalPath;
@@ -296,14 +271,6 @@ function detectSubmodule(settings) {
return detectSubmoduleFromBlendfile(bf);
}
function formatDailyYYMMDD(dateObj) {
const pad2 = (n) => (n < 10 ? '0' + n : '' + n);
const yy = (dateObj.getFullYear() % 100);
const mm = dateObj.getMonth() + 1;
const dd = dateObj.getDate();
return `daily_${pad2(yy)}${pad2(mm)}${pad2(dd)}`;
}
// Do field replacement on the render output path.
function renderOutputPath(job) {
let path = job.settings.render_output_path;

View File

@@ -37,16 +37,6 @@ const JOB_TYPE = {
description:
"Base path where renders are stored, typically the project's Renders folder. If empty, derived automatically.",
},
{
key: 'daily_path',
type: 'string',
required: false,
visible: 'submission',
eval: "__import__('datetime').datetime.now().strftime('daily_%y%m%d')",
evalInfo: { showLinkButton: true, description: "Auto-fill with today's daily folder name" },
description:
"Daily folder name under the render root, e.g. 'daily_250813'. If empty, auto-fills to today's date.",
},
{
key: 'use_submodule',
label: 'Use Submodule',
@@ -71,7 +61,8 @@ const JOB_TYPE = {
type: 'string',
subtype: 'file_path',
editable: false,
eval: "str(Path(abspath(settings.render_output_root or '//'), ((str(settings.submodule or '').strip()) if (settings.use_submodule and str(settings.submodule or '').strip()) else ((__import__('os').path.basename(__import__('os').path.dirname(bpy.data.filepath))) if settings.use_submodule else '')), (settings.daily_path or __import__('datetime').datetime.now().strftime('daily_%y%m%d')), jobname, jobname + '_######'))",
eval:
"((lambda Path, abspath, os_path, settings_obj, blend: str(Path(abspath(settings_obj.render_output_root or '//')) / (((str(settings_obj.submodule or '').strip()) if (settings_obj.use_submodule and str(settings_obj.submodule or '').strip()) else ((os_path.basename(os_path.dirname(bpy.data.filepath))) if settings_obj.use_submodule else ''))) / blend / (blend + '_######')))(__import__('pathlib').Path, __import__('os').path.abspath, __import__('os').path, settings, __import__('os').path.splitext(__import__('os').path.basename(bpy.data.filepath))[0]))",
description: 'Final file path of where render output will be saved',
},
@@ -180,10 +171,6 @@ function compileJob(job) {
if (projectRoot) settings.render_output_root = path.join(projectRoot, 'Renders');
else settings.render_output_root = path.join(path.dirname(settings.blendfile), 'Renders');
}
if (!settings.daily_path || String(settings.daily_path).trim() === '') {
const createdDate = job && job.created ? new Date(job.created) : new Date();
settings.daily_path = formatDailyYYMMDD(createdDate);
}
const recomposed = computeAutoRenderOutputPath(job);
if (recomposed) settings.render_output_path = recomposed;
} catch (e) {
@@ -374,7 +361,7 @@ function cleanupJobSettings(settings) {
}
}
// Derive project root, submodule, and daily path from the blendfile path.
// Derive project root and submodule from the blendfile path.
function computeAutoRenderOutputPath(job) {
const settings = job.settings || {};
if (!settings.blendfile) return null;
@@ -391,19 +378,11 @@ function computeAutoRenderOutputPath(job) {
} else {
renderRoot = path.join(path.dirname(settings.blendfile), 'Renders');
}
// Resolve daily path
let daily = null;
if (settings.daily_path && ("" + settings.daily_path).trim()) {
daily = ("" + settings.daily_path).trim();
} else {
const createdDate = job && job.created ? new Date(job.created) : new Date();
daily = formatDailyYYMMDD(createdDate);
}
const jobname = job && job.name ? job.name : path.stem(settings.blendfile).replace('.flamenco', '');
const blendname = path.stem(settings.blendfile).replace('.flamenco', '');
const parts = [renderRoot];
if (submodule) parts.push(submodule);
parts.push(daily, jobname, `${jobname}_######`);
parts.push(blendname, `${blendname}_######`);
return path.join.apply(path, parts);
}
@@ -454,11 +433,3 @@ function detectSubmodule(settings) {
} catch (_) {}
return detectSubmoduleFromBlendfile(bf);
}
function formatDailyYYMMDD(dateObj) {
const pad2 = (n) => (n < 10 ? '0' + n : '' + n);
const yy = dateObj.getFullYear() % 100;
const mm = dateObj.getMonth() + 1;
const dd = dateObj.getDate();
return `daily_${pad2(yy)}${pad2(mm)}${pad2(dd)}`;
}