修复画布快速编辑还原生成器
直接点击生成图时还原原生成器对话框
非生成图直接点击只选中不打开生成器
快速编辑按钮和右键入口按素材元数据打开对应生成器
补齐资源元数据回填和入口边界测试
(cherry picked from commit 45e4b6e64a)
This commit is contained in:
@@ -649,9 +649,55 @@ function resolveGeneratedSourceDialogMode({
|
||||
if (sourceLayer.assetKind === 'character-animation') {
|
||||
return 'character-animation';
|
||||
}
|
||||
if (sourceLayer.sourceType === 'generated') {
|
||||
return 'generate';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function buildLayerGenerationPlaceholder(sourceLayer: CanvasLayer) {
|
||||
return {
|
||||
x: sourceLayer.x,
|
||||
y: sourceLayer.y,
|
||||
width: sourceLayer.width,
|
||||
height: sourceLayer.height,
|
||||
originalWidth: sourceLayer.originalWidth,
|
||||
originalHeight: sourceLayer.originalHeight,
|
||||
};
|
||||
}
|
||||
|
||||
export function createLayerGenerationDialogDraft({
|
||||
sourceLayer,
|
||||
canvasSize,
|
||||
viewport,
|
||||
sourceDialog,
|
||||
sourceAnimationLayer,
|
||||
}: Omit<SourceGenerationDialogDraftContext, 'mode'>): Omit<
|
||||
CanvasGenerationDialogState,
|
||||
'id'
|
||||
> | null {
|
||||
const draft = createSameSourceGenerationDialogDraft({
|
||||
sourceLayer,
|
||||
canvasSize,
|
||||
viewport,
|
||||
sourceDialog,
|
||||
sourceAnimationLayer,
|
||||
mode: 'redraw',
|
||||
});
|
||||
if (!draft) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
...draft,
|
||||
prompt: draft.prompt || sourceLayer.prompt?.trim() || '',
|
||||
imageModel: sourceDialog?.imageModel ?? sourceLayer.model ?? draft.imageModel,
|
||||
status: 'idle',
|
||||
composerOpen: true,
|
||||
generatedLayerId: sourceLayer.id,
|
||||
placeholder: buildLayerGenerationPlaceholder(sourceLayer),
|
||||
};
|
||||
}
|
||||
|
||||
function getSourceDraftPrompt({
|
||||
sourceLayer,
|
||||
mode,
|
||||
|
||||
Reference in New Issue
Block a user