浏览代码

Fix morphtarget block

David Catuhe 5 年之前
父节点
当前提交
f20858f628
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 1 1
      src/Materials/Node/Blocks/Vertex/morphTargetsBlock.ts
  2. 3 1
      src/Materials/Node/nodeMaterial.ts

+ 1 - 1
src/Materials/Node/Blocks/Vertex/morphTargetsBlock.ts

@@ -197,7 +197,7 @@ export class MorphTargetsBlock extends NodeMaterialBlock {
 
             if (hasUVs) {
                 injectionCode += `#ifdef MORPHTARGETS_UV\r\n`;
-                injectionCode += `${uvOutput.associatedVariableName}.xyz += (uv_${index} - ${uv.associatedVariableName}.xyz) * morphTargetInfluences[${index}];\r\n`;
+                injectionCode += `${uvOutput.associatedVariableName}.xy += (uv_${index} - ${uv.associatedVariableName}.xy) * morphTargetInfluences[${index}];\r\n`;
                 injectionCode += `#endif\r\n`;
             }
 

+ 3 - 1
src/Materials/Node/nodeMaterial.ts

@@ -893,7 +893,9 @@ export class NodeMaterial extends PushMaterial {
     public getActiveTextures(): BaseTexture[] {
         var activeTextures = super.getActiveTextures();
 
-        activeTextures.push(...this._sharedData.textureBlocks.filter((tb) => tb.texture).map((tb) => tb.texture!));
+        if (this._sharedData) {
+            activeTextures.push(...this._sharedData.textureBlocks.filter((tb) => tb.texture).map((tb) => tb.texture!));
+        }
 
         return activeTextures;
     }