From 02f5afaecf4e210809380abf76a77359f8b63eb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=A3=AE=E6=96=8C?= Date: Wed, 24 Nov 2021 15:40:50 +0800 Subject: [PATCH] v3.4 fix fbx edit animation clip bugs (#9700) * fix fbx edit animation clip bugs * update commends * fix fps update Co-authored-by: yanOO1497 --- editor/inspector/assets/fbx/animation.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/editor/inspector/assets/fbx/animation.js b/editor/inspector/assets/fbx/animation.js index a7de10c6e5..7584d007c8 100644 --- a/editor/inspector/assets/fbx/animation.js +++ b/editor/inspector/assets/fbx/animation.js @@ -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;