diff --git a/editor/i18n/en/assets.js b/editor/i18n/en/assets.js index d2393bfd1bc..9a1afdd863d 100644 --- a/editor/i18n/en/assets.js +++ b/editor/i18n/en/assets.js @@ -196,6 +196,10 @@ module.exports = { "Warning: WebGL 1.0 platform doesn't support 'Repeat' filter for non-power-of-two textures(runtime fallback to 'Clamp'), effectively disabling features like the 'tilingOffset' property in many materials.", filterDiffenent: 'Filter settings do not match the configuration in {atlasFile} and may not take effect.', }, + scaleFactor: { + name: 'Scale Factor', + title:'Adjust model size', + }, fbx: { browse: 'Change Target', model: 'Model', diff --git a/editor/i18n/zh/assets.js b/editor/i18n/zh/assets.js index edf9f8acf94..d56f74bc945 100644 --- a/editor/i18n/zh/assets.js +++ b/editor/i18n/zh/assets.js @@ -196,6 +196,10 @@ module.exports = { '警告:WebGL 1.0 平台不支持非 2 次幂贴图的 Repeat 过滤模式,运行时会自动改为 Clamp 模式,这会使材质的 tilingOffset 等属性完全失效。', filterDiffenent: 'Filter 设置与 {atlasFile} 中的配置不符,可能无法生效。', }, + scaleFactor: { + name: '缩放因子', + title: '调整模型导入大小', + }, fbx: { browse: '更换贴图', model: '模型', diff --git a/editor/inspector/assets/fbx/model.js b/editor/inspector/assets/fbx/model.js index 770af79969d..2bb6aec588a 100644 --- a/editor/inspector/assets/fbx/model.js +++ b/editor/inspector/assets/fbx/model.js @@ -4,6 +4,11 @@ const { updateElementReadonly, updateElementInvalid, getPropValue, setPropValue exports.template = /* html */`
+ + + + + @@ -241,6 +246,7 @@ exports.$ = { tangentsSelect: '.tangents-select', morphNormalsSelect: '.morphNormals-select', skipValidationCheckbox: '.skipValidation-checkbox', + scaleFactorSlider: '.scaleFactor-slider', disableMeshSplitCheckbox: '.disableMeshSplit-checkbox', allowMeshDataAccessCheckbox: '.allowMeshDataAccess-checkbox', addVertexColorCheckbox: '.addVertexColor-checkbox', @@ -376,6 +382,23 @@ const Elements = { updateElementReadonly.call(panel, panel.$.skipValidationCheckbox); }, }, + scaleFactor: { + ready() { + const panel = this; + panel.$.scaleFactorSlider.addEventListener('change', panel.setProp.bind(panel, 'scaleFactor', 'number')); + panel.$.scaleFactorSlider.addEventListener('confirm', () => { + panel.dispatch('snapshot'); + }); + }, + update() { + const panel = this; + + panel.$.scaleFactorSlider.value = getPropValue.call(panel, panel.meta.userData, 1, 'scaleFactor'); + + updateElementInvalid.call(panel, panel.$.scaleFactorSlider, 'scaleFactor'); + updateElementReadonly.call(panel, panel.$.scaleFactorSlider); + }, + }, disableMeshSplit: { ready() { const panel = this;