|
@@ -45,12 +45,13 @@ import {
|
|
initAnimationActions,
|
|
initAnimationActions,
|
|
initialAnimationModels,
|
|
initialAnimationModels,
|
|
} from "@/store/animation";
|
|
} from "@/store/animation";
|
|
-import { nextTick, reactive, ref, watch } from "vue";
|
|
|
|
|
|
+import { computed, nextTick, reactive, ref, watch, watchEffect } from "vue";
|
|
import { Active } from "./type";
|
|
import { Active } from "./type";
|
|
import { getAddTLItemAttr } from "@/components/drawing-time-line/check";
|
|
import { getAddTLItemAttr } from "@/components/drawing-time-line/check";
|
|
import { Message } from "bill/expose-common";
|
|
import { Message } from "bill/expose-common";
|
|
import { uuid } from "@/components/drawing/hook";
|
|
import { uuid } from "@/components/drawing/hook";
|
|
import { title } from "./type";
|
|
import { title } from "./type";
|
|
|
|
+import { amMap, getAMKey } from "@/sdk/association/animation";
|
|
|
|
|
|
enterEdit(() => router.back());
|
|
enterEdit(() => router.back());
|
|
initialAnimationModels();
|
|
initialAnimationModels();
|
|
@@ -63,6 +64,32 @@ const currentTime = ref(0);
|
|
const follow = ref(false);
|
|
const follow = ref(false);
|
|
const frameAction = ref<string>();
|
|
const frameAction = ref<string>();
|
|
|
|
|
|
|
|
+const amM = computed(() => focusAM.value && amMap[getAMKey(focusAM.value)]);
|
|
|
|
+
|
|
|
|
+watchEffect((onCleanup) => {
|
|
|
|
+ if (!amM.value || activeAttrib.value?.key !== "frames") return;
|
|
|
|
+ const frame = focusAM.value!.frames[activeAttrib.value.ndx];
|
|
|
|
+ const am3d = amM.value.am;
|
|
|
|
+ if (!am3d) return;
|
|
|
|
+
|
|
|
|
+ am3d.bus.on("transformChanged", (mat) => {
|
|
|
|
+ frame.mat = JSON.parse(JSON.stringify(mat));
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ switch (frameAction.value) {
|
|
|
|
+ case "translate":
|
|
|
|
+ am3d.enterMoveMode();
|
|
|
|
+ break;
|
|
|
|
+ case "rotate":
|
|
|
|
+ am3d.enterRotateMode();
|
|
|
|
+ break;
|
|
|
|
+ case "scale":
|
|
|
|
+ am3d.enterScaleMode();
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ onCleanup(() => am3d.leaveTransform());
|
|
|
|
+});
|
|
|
|
+
|
|
const updateFocus = (am?: AnimationModel) => {
|
|
const updateFocus = (am?: AnimationModel) => {
|
|
activeAttrib.value = undefined;
|
|
activeAttrib.value = undefined;
|
|
focusAM.value = am;
|
|
focusAM.value = am;
|
|
@@ -113,8 +140,8 @@ const add = <T extends Active["key"]>(
|
|
};
|
|
};
|
|
|
|
|
|
const changeSelect = ({ select, unSelect }: Record<string, AnimationModel[]>) => {
|
|
const changeSelect = ({ select, unSelect }: Record<string, AnimationModel[]>) => {
|
|
- console.log("select", select);
|
|
|
|
- console.log("unSelect", unSelect);
|
|
|
|
|
|
+ select.forEach((item) => amMap[getAMKey(item)].am?.changeShow(true));
|
|
|
|
+ unSelect.forEach((item) => amMap[getAMKey(item)].am?.changeShow(false));
|
|
};
|
|
};
|
|
|
|
|
|
const deleteAm = (am: AnimationModel) => {
|
|
const deleteAm = (am: AnimationModel) => {
|