update flamscripts with new render seqzip workflow
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -46,18 +46,6 @@ const JOB_TYPE = {
|
|||||||
},
|
},
|
||||||
description: "Base path where renders are stored, typically the project's Renders folder. If empty, derived automatically."
|
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",
|
key: "use_submodule",
|
||||||
label: "Use Submodule",
|
label: "Use Submodule",
|
||||||
@@ -84,7 +72,7 @@ const JOB_TYPE = {
|
|||||||
type: "string",
|
type: "string",
|
||||||
subtype: "file_path",
|
subtype: "file_path",
|
||||||
editable: false,
|
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"
|
description: "Final file path of where render output will be saved"
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -165,10 +153,6 @@ function compileJob(job) {
|
|||||||
if (projectRoot) settings.render_output_root = path.join(projectRoot, 'Renders');
|
if (projectRoot) settings.render_output_root = path.join(projectRoot, 'Renders');
|
||||||
else settings.render_output_root = path.join(path.dirname(settings.blendfile), '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);
|
const recomposed = computeAutoRenderOutputPath(job);
|
||||||
if (recomposed) settings.render_output_path = recomposed;
|
if (recomposed) settings.render_output_path = recomposed;
|
||||||
} catch (e) {
|
} 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) {
|
function computeAutoRenderOutputPath(job) {
|
||||||
const settings = job.settings || {};
|
const settings = job.settings || {};
|
||||||
if (!settings.blendfile) return null;
|
if (!settings.blendfile) return null;
|
||||||
@@ -220,26 +204,17 @@ function computeAutoRenderOutputPath(job) {
|
|||||||
renderRoot = path.join(path.dirname(settings.blendfile), 'Renders');
|
renderRoot = path.join(path.dirname(settings.blendfile), 'Renders');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resolve daily path
|
const blendname = path.stem(settings.blendfile).replace('.flamenco', '');
|
||||||
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', '');
|
|
||||||
|
|
||||||
print('AutoPath: blendfile=', settings.blendfile);
|
print('AutoPath: blendfile=', settings.blendfile);
|
||||||
print('AutoPath: projectRoot=', projectRoot);
|
print('AutoPath: projectRoot=', projectRoot);
|
||||||
print('AutoPath: renderRoot=', renderRoot);
|
print('AutoPath: renderRoot=', renderRoot);
|
||||||
print('AutoPath: submodule=', submodule);
|
print('AutoPath: submodule=', submodule);
|
||||||
print('AutoPath: daily=', daily);
|
print('AutoPath: blendname=', blendname);
|
||||||
print('AutoPath: jobname=', jobname);
|
|
||||||
|
|
||||||
const parts = [renderRoot];
|
const parts = [renderRoot];
|
||||||
if (submodule) parts.push(submodule);
|
if (submodule) parts.push(submodule);
|
||||||
parts.push(daily, jobname, `${jobname}_######`);
|
parts.push(blendname, `${blendname}_######`);
|
||||||
const finalPath = path.join.apply(path, parts);
|
const finalPath = path.join.apply(path, parts);
|
||||||
print('AutoPath: finalPath=', finalPath);
|
print('AutoPath: finalPath=', finalPath);
|
||||||
return finalPath;
|
return finalPath;
|
||||||
@@ -296,14 +271,6 @@ function detectSubmodule(settings) {
|
|||||||
return detectSubmoduleFromBlendfile(bf);
|
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.
|
// Do field replacement on the render output path.
|
||||||
function renderOutputPath(job) {
|
function renderOutputPath(job) {
|
||||||
let path = job.settings.render_output_path;
|
let path = job.settings.render_output_path;
|
||||||
|
|||||||
@@ -37,16 +37,6 @@ const JOB_TYPE = {
|
|||||||
description:
|
description:
|
||||||
"Base path where renders are stored, typically the project's Renders folder. If empty, derived automatically.",
|
"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',
|
key: 'use_submodule',
|
||||||
label: 'Use Submodule',
|
label: 'Use Submodule',
|
||||||
@@ -71,7 +61,8 @@ const JOB_TYPE = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
subtype: 'file_path',
|
subtype: 'file_path',
|
||||||
editable: false,
|
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',
|
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');
|
if (projectRoot) settings.render_output_root = path.join(projectRoot, 'Renders');
|
||||||
else settings.render_output_root = path.join(path.dirname(settings.blendfile), '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);
|
const recomposed = computeAutoRenderOutputPath(job);
|
||||||
if (recomposed) settings.render_output_path = recomposed;
|
if (recomposed) settings.render_output_path = recomposed;
|
||||||
} catch (e) {
|
} 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) {
|
function computeAutoRenderOutputPath(job) {
|
||||||
const settings = job.settings || {};
|
const settings = job.settings || {};
|
||||||
if (!settings.blendfile) return null;
|
if (!settings.blendfile) return null;
|
||||||
@@ -391,19 +378,11 @@ function computeAutoRenderOutputPath(job) {
|
|||||||
} else {
|
} else {
|
||||||
renderRoot = path.join(path.dirname(settings.blendfile), 'Renders');
|
renderRoot = path.join(path.dirname(settings.blendfile), 'Renders');
|
||||||
}
|
}
|
||||||
// Resolve daily path
|
const blendname = path.stem(settings.blendfile).replace('.flamenco', '');
|
||||||
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 parts = [renderRoot];
|
const parts = [renderRoot];
|
||||||
if (submodule) parts.push(submodule);
|
if (submodule) parts.push(submodule);
|
||||||
parts.push(daily, jobname, `${jobname}_######`);
|
parts.push(blendname, `${blendname}_######`);
|
||||||
return path.join.apply(path, parts);
|
return path.join.apply(path, parts);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -454,11 +433,3 @@ function detectSubmodule(settings) {
|
|||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
return detectSubmoduleFromBlendfile(bf);
|
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)}`;
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user