|
@@ -2,7 +2,7 @@ import { diffArrayChange, mount, shallowWatchArray } from "@/utils";
|
|
|
import TaggingComponent from "@/components/path/list.vue";
|
|
|
import { Path as PathData, paths } from "@/store/path";
|
|
|
import { sdk, Path, SDK } from "../sdk";
|
|
|
-import { reactive, ref, watch, watchEffect } from "vue";
|
|
|
+import { nextTick, reactive, ref, watch, watchEffect } from "vue";
|
|
|
import { groupProxy } from "@/store/group";
|
|
|
import { isScenePlayRun, pauseScene, playScene } from "@/utils/full";
|
|
|
import { analysisPose, setPose } from ".";
|
|
@@ -50,7 +50,10 @@ export const playScenePath = async (
|
|
|
forceFull = false,
|
|
|
) => {
|
|
|
const node = getPathNode(path)
|
|
|
- if (!node) return Message.error('路径所在模型被删除,无法播放');;
|
|
|
+ if (!node) {
|
|
|
+ console.error('un', path.id)
|
|
|
+ return Message.error('路径所在模型被删除,无法播放');
|
|
|
+ }
|
|
|
|
|
|
showPathsStack.push(ref(false))
|
|
|
showPathStack.push(ref(path.id))
|
|
@@ -87,22 +90,14 @@ export const associationPaths = (sdk: SDK, el: HTMLDivElement) => {
|
|
|
return pathsNode
|
|
|
},
|
|
|
(nodes, oldNodes = []) => {
|
|
|
- const { added, deleted } = diffArrayChange<PathsNode>(
|
|
|
- nodes,
|
|
|
- oldNodes as PathsNode
|
|
|
- );
|
|
|
- for (const add of added) {
|
|
|
- if (add) {
|
|
|
- const path = paths.value.find((item) => item.id === add.id)!;
|
|
|
- pathNodes.set(path, add.node);
|
|
|
- }
|
|
|
- }
|
|
|
- for (const del of deleted) {
|
|
|
- if (del) {
|
|
|
- const path = paths.value.find((item) => item.id === del.id)!;
|
|
|
- pathNodes.delete(path);
|
|
|
- }
|
|
|
- }
|
|
|
+ watchEffect(() => {
|
|
|
+ pathNodes.clear()
|
|
|
+ nodes.forEach(node => {
|
|
|
+ const path = paths.value.find((item) => item.id === node.id)!;
|
|
|
+ pathNodes.set(path, node.node);
|
|
|
+ })
|
|
|
+ })
|
|
|
+ console.error(pathNodes)
|
|
|
},
|
|
|
{immediate: true}
|
|
|
);
|