Restore character names on Prompt Builder compile lines.
Character lines again use Name: description with outfit and facing features; set names and framing labels stay uncopied. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+18
-10
@@ -53,9 +53,9 @@ export type PromptSequenceFeature = {
|
||||
|
||||
export type PromptSequenceCharacter = {
|
||||
id: string
|
||||
/** Label only — never copied into the prompt. */
|
||||
/** Copied into the prompt as "Name: …" when the character is on and facing is not out. */
|
||||
name: string
|
||||
/** Base description; always included when in frame (facing !== out). */
|
||||
/** Base description; included with the name when in frame (facing !== out). */
|
||||
description: string
|
||||
features: PromptSequenceFeature[]
|
||||
outfits: PromptSequenceOutfit[]
|
||||
@@ -283,7 +283,8 @@ export type CompiledCharacterFacing = {
|
||||
|
||||
/**
|
||||
* Compile one character for a camera facing.
|
||||
* Name is never copied. Facing "out" emits nothing.
|
||||
* Name is copied ("Name: description"). Facing "out" emits nothing.
|
||||
* Feature text appends after the description, before the outfit.
|
||||
*/
|
||||
export function compileCharacterForFacing(
|
||||
character: {
|
||||
@@ -318,15 +319,18 @@ export function compileCharacterForFacing(
|
||||
return { text: '', omittedFeatures, ignoredBangs }
|
||||
}
|
||||
|
||||
const parts: string[] = []
|
||||
const base = stripBangs(String(character?.description || ''))
|
||||
if (base) parts.push(base)
|
||||
const name = stripBangs(String(character?.name || ''))
|
||||
const description = stripBangs(String(character?.description || ''))
|
||||
let head = ''
|
||||
if (name && description) head = `${name}: ${description}`
|
||||
else head = name || description
|
||||
|
||||
const featureParts: string[] = []
|
||||
for (const feature of features) {
|
||||
if (!feature?.enabled) continue
|
||||
const cleaned = stripBangs(String(feature.text || ''))
|
||||
if (isFeatureVisibleForFacing(feature, facing)) {
|
||||
if (cleaned) parts.push(cleaned)
|
||||
if (cleaned) featureParts.push(cleaned)
|
||||
} else {
|
||||
omittedFeatures.push({
|
||||
id: String(feature.id || newId()),
|
||||
@@ -336,10 +340,14 @@ export function compileCharacterForFacing(
|
||||
}
|
||||
}
|
||||
|
||||
let text = parts.join(', ')
|
||||
let text = head
|
||||
if (featureParts.length) {
|
||||
const featureText = featureParts.join(', ')
|
||||
text = text ? `${text}, ${featureText}` : featureText
|
||||
}
|
||||
const outfitText = stripBangs(outfitPromptText(outfit))
|
||||
if (outfitText) {
|
||||
text = text ? `${text}. Outfit: ${outfitText}` : outfitText
|
||||
text = text ? `${text}. Outfit: ${outfitText}` : `Outfit: ${outfitText}`
|
||||
}
|
||||
return { text, omittedFeatures, ignoredBangs }
|
||||
}
|
||||
@@ -389,7 +397,7 @@ export function cloneSceneForNext(previous: PromptSequenceScene, nextIndex: numb
|
||||
}
|
||||
|
||||
/**
|
||||
* Legacy helper: base description (+ optional outfit). Name is never copied.
|
||||
* Legacy helper for name/description/outfit (+ optional facing features).
|
||||
* Prefer compileCharacterForFacing for feature-aware compile.
|
||||
*/
|
||||
export function formatCharacterLine(
|
||||
|
||||
Reference in New Issue
Block a user