Derive external timeline duration from sections
This commit is contained in:
@@ -11589,14 +11589,10 @@ app.registerExtension({
|
||||
return null;
|
||||
}
|
||||
|
||||
const rawDuration =
|
||||
self._resolveNodeLinkedValue(timelineNode, "duration", { decimals: 3 }) ??
|
||||
parseFloat(self._readNodeWidgetValue(timelineNode, "duration") || 0);
|
||||
const duration = Math.max(0.1, Number.isFinite(rawDuration) ? rawDuration : 5.0);
|
||||
|
||||
const sectionSetNode = self._findLinkedOriginNode(timelineNode, "section_set");
|
||||
const setClass = sectionSetNode?.comfyClass || sectionSetNode?.type || "";
|
||||
const sections = [];
|
||||
let duration = 0;
|
||||
if (sectionSetNode && setClass === "TimelineSectionSetCS") {
|
||||
for (let i = 1; i <= 5; i++) {
|
||||
const sectionNode = self._findLinkedOriginNode(sectionSetNode, `section_${i}`);
|
||||
@@ -11610,6 +11606,7 @@ app.registerExtension({
|
||||
self._resolveNodeLinkedValue(sectionNode, "duration", { decimals: 3 }) ??
|
||||
parseFloat(self._readNodeWidgetValue(sectionNode, "duration") || 0);
|
||||
const sectionDuration = Math.max(0.1, Number.isFinite(rawSectionDuration) ? rawSectionDuration : 1.0);
|
||||
duration += sectionDuration;
|
||||
const imageSource = self._extractLinkedImageSource(sectionNode, "image");
|
||||
sections.push({
|
||||
text,
|
||||
@@ -11620,7 +11617,7 @@ app.registerExtension({
|
||||
}
|
||||
}
|
||||
|
||||
return { duration, sections };
|
||||
return { duration: Math.max(0.1, duration), sections };
|
||||
};
|
||||
this._syncTimelineFromLink = function () {
|
||||
const payload = self._buildExternalTimelinePayload();
|
||||
|
||||
Reference in New Issue
Block a user