fix(canvas): 分镜生成上下文 - 忽略未绑定资产的角色设计工作流

This commit is contained in:
ddCat
2026-08-26 22:38:07 +08:00
parent c79e984bc3
commit 1ccbbc5a7b
2 changed files with 69 additions and 1 deletions

View File

@@ -22,7 +22,10 @@ export function resolveStoryboardGenerationContext(nodes: CanvasNodeData[]): Sto
const stylePresetId = String(styleNode?.metadata?.stylePresetId || "").trim();
if (!styleNode || !stylePrompt || !stylePresetId) throw new Error("请先设置项目画风,再生成分镜");
const characterNodes = nodes.filter((node) => node.metadata?.workflowKind === "character");
// `workflowKind=character` is also used by standalone character-design
// image workflows. Only nodes linked to a project character asset are
// storyboard character cards and therefore participate in this check.
const characterNodes = nodes.filter((node) => node.metadata?.workflowKind === "character" && node.metadata?.characterAssetId?.trim());
const invalidCharacter = characterNodes.find((node) => !node.metadata?.characterAssetId?.trim() || !node.metadata?.characterVersionId?.trim() || !(node.metadata?.characterName || node.title).trim());
if (invalidCharacter) throw new Error(`角色卡“${invalidCharacter.metadata?.characterName || invalidCharacter.title || "未命名角色"}”版本未同步,请刷新角色资产后再生成分镜`);