修复反序列化场景是,把specular误当作数值的bug。

This commit is contained in:
tengge1 2019-09-28 20:21:38 +08:00
parent b219eb4ff6
commit ef8da64ff6
3 changed files with 6 additions and 2 deletions

View File

@ -14,6 +14,8 @@ Supported Languages: 中文 / [繁體中文](README-tw.md) / [English](README-en
3. 角色管理:添加角色、编辑角色、删除角色、查找角色。
4. 用户管理:添加用户、编辑用户、删除用户、查找用户。
5. `DataGrid`控件大幅度优化每页显示条数设置跳转第一页、前一页、后一页、最后一页当前页和总页数刷新按钮每页条数和总记录数展示加载数据显示LoadMask。
6. 修复非高光材质切换高光材质报错的bug。
7. 修复反序列化场景是,把`specular`误当作数值的bug。
## v0.3.3更新

View File

@ -547,7 +547,8 @@ class MaterialComponent extends React.Component {
editor.execute(new SetMaterialColorCommand(object, 'emissive', emissive));
}
if (material.specular !== undefined && `#${material.specular}` !== specular) {
// bug: specularspecular
if (material.specular !== undefined && `#${material.specular.getHexString()}` !== specular && specular !== null) {
editor.execute(new SetMaterialValueCommand(object, 'specular', specular));
}

View File

@ -127,7 +127,8 @@ MaterialSerializer.prototype.fromJSON = function (json, parent, server) {
obj.emissiveMap = json.emissiveMap == null ? null : (new TexturesSerializer()).fromJSON(json.emissiveMap, undefined, server);
if (json.specular !== undefined) {
obj.specular = json.specular;
// bug: json.specular是颜色值。
obj.specular = new THREE.Color(json.specular);
}
if (json.specularMap !== undefined) {
obj.specularMap = (new TexturesSerializer()).toJSON(json.specularMap);