mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
fix default material
This commit is contained in:
@@ -107,6 +107,7 @@ let builtinResMgr = {
|
||||
// [defaultTextureCube._uuid]: defaultTextureCub
|
||||
[blackTexture._uuid]: blackTexture,
|
||||
[whiteTexture._uuid]: whiteTexture,
|
||||
[defaultMtl._uuid]: defaultMtl,
|
||||
[spriteMtl._uuid]: spriteMtl,
|
||||
[spriteFrame._uuid]:spriteFrame
|
||||
};
|
||||
|
||||
@@ -189,7 +189,7 @@ export class ModelComponent extends RenderableComponent {
|
||||
}
|
||||
|
||||
_updateModels(forceUpdate) {
|
||||
if (!this.enabled || !this.node._scene || (this._model && !forceUpdate)) {
|
||||
if (!this.enabled || !this.node._scene || !this._mesh || (this._model && !forceUpdate)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ export class ModelComponent extends RenderableComponent {
|
||||
for (let i = 0; i < meshCount; ++i) {
|
||||
let material = this.getSharedMaterial(i);
|
||||
let subMeshData = this._mesh.renderingMesh.getSubmesh(i);
|
||||
this._model.initSubModel(i, subMeshData, material);
|
||||
this._model.initSubModel(i, subMeshData, material || this._getBuiltinMaterial());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user