v3.4 fix fbx edit animation clip bugs (#9700)

* fix fbx edit animation clip bugs

* update commends

* fix fps update

Co-authored-by: yanOO1497 <yuanyuan1497@foxmail.com>
This commit is contained in:
黄森斌
2021-11-24 15:40:50 +08:00
committed by GitHub
parent 5f1d50edfd
commit 02f5afaecf
+10 -5
View File
@@ -427,11 +427,11 @@ const Elements = {
line.appendChild(name);
const time = document.createElement('div');
time.setAttribute('class', 'time');
time.innerHTML = panel.animationTimeShowType === 'time' ? subAnim.from.toFixed(2) : Math.round(subAnim.from * panel.rawClipInfo.fps);
time.innerHTML = panel.animationTimeShowType === 'time' ? subAnim.from.toFixed(2) : Math.round(subAnim.from * (subAnim.fps || panel.rawClipInfo.fps));
line.appendChild(time);
const timeEnd = document.createElement('div');
timeEnd.setAttribute('class', 'time end');
timeEnd.innerHTML = panel.animationTimeShowType === 'time' ? subAnim.to.toFixed(2) : Math.round(subAnim.to * panel.rawClipInfo.fps);
timeEnd.innerHTML = panel.animationTimeShowType === 'time' ? subAnim.to.toFixed(2) : Math.round(subAnim.to * (subAnim.fps || panel.rawClipInfo.fps));
line.appendChild(timeEnd);
});
@@ -818,12 +818,17 @@ exports.methods = {
panel.$.clipFrames.innerText = maxFrames;
panel.$.clipFPS.value = fps;
panel.$.clipFrom.setAttribute('max', endFrames);
panel.$.clipFrom.value = startFrames;
// TODO: hack for bug at 3d-tasks#10113. Because the new value would be limited in min and max, should firstly remove min and max.
panel.$.clipFrom.max = null;
panel.$.clipTo.min = null;
panel.$.clipTo.max = null;
panel.$.clipFrom.value = startFrames;
panel.$.clipFrom.setAttribute('max', endFrames);
panel.$.clipTo.value = endFrames;
panel.$.clipTo.setAttribute('min', startFrames);
panel.$.clipTo.setAttribute('max', maxFrames);
panel.$.clipTo.value = endFrames;
panel.$.wrapMode.value = panel.currentClipInfo.wrapMode;
panel.$.speed.value = panel.currentClipInfo.speed || 1;