Sfoglia il codice sorgente

Fix morphtarget block

David Catuhe 5 anni fa
parent
commit
f20858f628

+ 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;
     }