增加模型库无工艺数据播放提示
This commit is contained in:
@@ -629,6 +629,10 @@ function bindProcessPlaceholder(operations: PreviewOperation[]) {
|
||||
});
|
||||
|
||||
document.querySelector<HTMLButtonElement>("#previewPlayBtn")?.addEventListener("click", () => {
|
||||
if (operations.length === 0) {
|
||||
notify("当前模型暂无工艺数据");
|
||||
return;
|
||||
}
|
||||
const operation = getSelectedOperation(operations);
|
||||
updateStatus(operation);
|
||||
if (!operation) {
|
||||
@@ -639,7 +643,7 @@ function bindProcessPlaceholder(operations: PreviewOperation[]) {
|
||||
notifyError(`工艺播放数据解析失败:${operation.parseError}`);
|
||||
return;
|
||||
}
|
||||
if (!operation.parsedCraftPlayData) {
|
||||
if (!operation.parsedCraftPlayData || operation.parsedCraftPlayData.OPERATION.frames.length === 0) {
|
||||
notify("当前工艺暂无播放数据");
|
||||
return;
|
||||
}
|
||||
@@ -653,10 +657,14 @@ function bindProcessPlaceholder(operations: PreviewOperation[]) {
|
||||
}
|
||||
|
||||
function startPreviewPlayback(operation: PreviewOperation) {
|
||||
if (!runtime?.context.modelObject || !operation.parsedCraftPlayData) {
|
||||
if (!runtime?.context.modelObject) {
|
||||
notify("模型还未加载完成");
|
||||
return;
|
||||
}
|
||||
if (!operation.parsedCraftPlayData || operation.parsedCraftPlayData.OPERATION.frames.length === 0) {
|
||||
notify("当前工艺暂无播放数据");
|
||||
return;
|
||||
}
|
||||
|
||||
if (previewPlayback.isPlaying && previewPlayback.operation === operation) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user