|
@@ -74,7 +74,7 @@ export const addAM = (data: AnimationModel): Promise<AnimationModel3D> => {
|
|
paths: {},
|
|
paths: {},
|
|
subtitles: {},
|
|
subtitles: {},
|
|
};
|
|
};
|
|
- const am = animationGroup.addAnimationModel(data);
|
|
|
|
|
|
+ const am = animationGroup.addAnimationModel({...data, quaAtPath: data.mat?.quaAtPath});
|
|
am.bus.on("loadDone", () => {
|
|
am.bus.on("loadDone", () => {
|
|
amMap[key].am = am;
|
|
amMap[key].am = am;
|
|
console.log("0.0", am);
|
|
console.log("0.0", am);
|
|
@@ -550,14 +550,12 @@ export const associationAnimation = (sdk: SDK, el: HTMLDivElement) => {
|
|
const am3d = amMap[getAMKey(am)];
|
|
const am3d = amMap[getAMKey(am)];
|
|
if (!am3d || !am3d.am) continue;
|
|
if (!am3d || !am3d.am) continue;
|
|
|
|
|
|
- am3d.am.setDefaultPose && am3d.am.setDefaultPose(am.mat || am3d.am.getModelPose())
|
|
|
|
- // const frame = am3d.am!.addFrame({
|
|
|
|
- // id: uuid(),
|
|
|
|
- // mat: am.mat || am3d.am.getModelPose(),
|
|
|
|
- // name: "global-frame",
|
|
|
|
- // time: 0,
|
|
|
|
- // });
|
|
|
|
- // am3d.globalFrame = frame;
|
|
|
|
|
|
+ const getMat = () => {
|
|
|
|
+ return (am.mat && 'position' in am.mat) ? am.mat : am3d.am!.getModelPose()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ am3d.am.setDefaultPose && am3d.am.setDefaultPose(getMat())
|
|
|
|
+
|
|
const mat = am.mat || am3d.am.getModelPose();
|
|
const mat = am.mat || am3d.am.getModelPose();
|
|
am3d.am.changePosition(mat.position!);
|
|
am3d.am.changePosition(mat.position!);
|
|
am3d.am.changeRotation(mat.rotation!);
|
|
am3d.am.changeRotation(mat.rotation!);
|
|
@@ -565,18 +563,12 @@ export const associationAnimation = (sdk: SDK, el: HTMLDivElement) => {
|
|
|
|
|
|
cleanupMap[getAMKey(am)] = mergeFuns(
|
|
cleanupMap[getAMKey(am)] = mergeFuns(
|
|
watchEffect(() => {
|
|
watchEffect(() => {
|
|
- // am.mat && frame.setMat(am.mat);
|
|
|
|
if (am.mat && am3d.am) {
|
|
if (am.mat && am3d.am) {
|
|
- am3d.am.setDefaultPose && am3d.am.setDefaultPose(am.mat)
|
|
|
|
- // console.log(am.mat)
|
|
|
|
- // am3d.am.changePosition(mat.position!)
|
|
|
|
- // am3d.am.changeRotation(mat.rotation!)
|
|
|
|
- // am3d.am.changeScale(mat.scale!)
|
|
|
|
|
|
+ am3d.am.setDefaultPose && am3d.am.setDefaultPose(getMat())
|
|
}
|
|
}
|
|
console.log("set-default-pose", am.mat);
|
|
console.log("set-default-pose", am.mat);
|
|
}),
|
|
}),
|
|
() => {
|
|
() => {
|
|
- // frame.destroy();
|
|
|
|
am3d.am?.addFrame;
|
|
am3d.am?.addFrame;
|
|
am3d.globalFrame = undefined;
|
|
am3d.globalFrame = undefined;
|
|
delete cleanupMap[getAMKey(am)];
|
|
delete cleanupMap[getAMKey(am)];
|