|
@@ -20,7 +20,9 @@ import {
|
|
|
FuseModels,
|
|
|
} from "@/store";
|
|
|
import { currentLayout, RoutesName } from "@/router";
|
|
|
-import { isUnSet, unSet } from "@/utils/unset";
|
|
|
+import { unsetFactory } from "@/utils/unset";
|
|
|
+
|
|
|
+const us = unsetFactory()
|
|
|
|
|
|
// -----------------模型关联--------------------
|
|
|
|
|
@@ -116,13 +118,13 @@ const setModels = (sdk: SDK, models: FuseModels, oldModels: FuseModels) => {
|
|
|
|
|
|
if (deepIsRevise(update, transform)) {
|
|
|
console.error('change', item)
|
|
|
- unSet(() => Object.assign(item, transform));
|
|
|
+ us.unSet(() => Object.assign(item, transform));
|
|
|
}
|
|
|
}, 16);
|
|
|
});
|
|
|
|
|
|
sceneModel.bus.on("changeSelect", (select) => {
|
|
|
- unSet(() => {
|
|
|
+ us.unSet(() => {
|
|
|
// if (custom.showMode === "fuse") {
|
|
|
if (custom.currentModel === item && !select) {
|
|
|
custom.currentModel = null;
|
|
@@ -258,23 +260,25 @@ export const associationModels = (sdk: SDK) => {
|
|
|
const modelShow = getFuseModelShowVariable(item);
|
|
|
watch(
|
|
|
() => item.bottom,
|
|
|
- () => isUnSet || getSceneModel(item)?.changeBottom(item.bottom)
|
|
|
+ () => us.isUnSet || getSceneModel(item)?.changeBottom(item.bottom)
|
|
|
// { immediate: true }
|
|
|
);
|
|
|
watch(
|
|
|
() => item.opacity,
|
|
|
- () => isUnSet || getSceneModel(item)?.changeOpacity(item.opacity)
|
|
|
+ () => us.isUnSet || getSceneModel(item)?.changeOpacity(item.opacity)
|
|
|
// { immediate: true }
|
|
|
);
|
|
|
watch(
|
|
|
() => item.scale,
|
|
|
- () => isUnSet || getSceneModel(item)?.changeScale(item.scale)
|
|
|
+ () => {
|
|
|
+ us.isUnSet || getSceneModel(item)?.changeScale(item.scale)
|
|
|
+ }
|
|
|
// { immediate: true }
|
|
|
);
|
|
|
watch(
|
|
|
() => item.position,
|
|
|
() => {
|
|
|
- if (!isUnSet) {
|
|
|
+ if (!us.isUnSet) {
|
|
|
console.log('position', item.raw.modelTitle, toRaw(item.position))
|
|
|
getSceneModel(item)?.changePosition(item.position);
|
|
|
}
|
|
@@ -284,7 +288,7 @@ export const associationModels = (sdk: SDK) => {
|
|
|
watch(
|
|
|
() => item.rotation,
|
|
|
() => {
|
|
|
- if (!isUnSet) {
|
|
|
+ if (!us.isUnSet) {
|
|
|
console.log('rotation', item.raw.modelTitle, toRaw(item.rotation))
|
|
|
getSceneModel(item)?.changeRotation(toRaw(item.rotation));
|
|
|
}
|
|
@@ -295,7 +299,7 @@ export const associationModels = (sdk: SDK) => {
|
|
|
() => modelShow.value,
|
|
|
() => {
|
|
|
const sceneModel = getSceneModel(item);
|
|
|
- if (!isUnSet && sceneModel) {
|
|
|
+ if (!us.isUnSet && sceneModel) {
|
|
|
sceneModel.changeSelect(false);
|
|
|
sceneModel.changeShow(modelShow.value);
|
|
|
}
|