bill vor 5 Monaten
Ursprung
Commit
026764618f
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 0 2
      src/sdk/association/animation.ts
  2. 4 2
      src/views/animation/index.vue

+ 0 - 2
src/sdk/association/animation.ts

@@ -348,12 +348,10 @@ export const associationAnimation = (sdk: SDK, el: HTMLDivElement) => {
   animationGroup = sdk.createAnimationGroup();
 
   watchEffect(() => {
-    console.error("发送setCurrentTime", currentTime.value);
     animationGroup.setCurrentTime(currentTime.value);
   });
 
   animationGroup.bus.on("currentTime", (time) => {
-    console.error("接收setCurrentTime", time);
     currentTime.value = time;
   });
 

+ 4 - 2
src/views/animation/index.vue

@@ -14,7 +14,7 @@
       @change-frame-action="(f) => (frameAction = f.action)"
       class="animation-right"
       v-model:activeAttrib="activeAttrib"
-      @add-frame="add('frames')"
+      @add-frame="add('frames', { duration: 0 })"
       @add-path="(preset) => add('paths', { reverse: false, ...preset })"
       @add-subtitle="add('subtitles', { content: '', background: '#fff' })"
       @add-action="(preset) => add('actions', preset)"
@@ -91,7 +91,6 @@ watchEffect((onCleanup) => {
   const am3d = amM.value.am;
   if (!am3d) return;
   const updateMat = () => {
-    console.log("update mat", frame.id);
     frame.mat = JSON.parse(JSON.stringify(am3d.getModelPose()));
   };
 
@@ -148,6 +147,8 @@ watch(activeAttrib, (_a, _b, onCleanup) => {
   const cur = focusAM.value![activeAttrib.value.key][activeAttrib.value.ndx];
   const updateFocus = () => {
     const rang = [cur.time, cur.time + (cur.duration || 0)];
+
+    console.log(rang, cur, cur.time);
     if (currentTime.value < rang[0] || currentTime.value > rang[1]) {
       activeAttrib.value = undefined;
     }
@@ -180,6 +181,7 @@ const add = <T extends Active["key"]>(
       ...preset,
     } as any);
     if (key === "frames") {
+      console.log(preset, item);
       asyncOper(
         focusAM.value!,
         (am3d) => (item.mat = JSON.parse(JSON.stringify(am3d.getModelPose())))