Parcourir la source

Merge pull request #9489 from Popov72/fix-nme-gradientcolor-code

NME: Fix code generated for the gradient block
sebavan il y a 4 ans
Parent
commit
485b7f400f

+ 1 - 0
dist/preview release/what's new.md

@@ -45,6 +45,7 @@
 - Fix an issue with keyboard control (re)attachment. ([#9411](https://github.com/BabylonJS/Babylon.js/issues/9411)) ([RaananW](https://github.com/RaananW))
 - Fix issue where PBRSpecularGlossiness materials were excluded from export [#9423](https://github.com/BabylonJS/Babylon.js/issues/9423)([Drigax](https://github.com/drigax))
 - Fix direct loading of a glTF string that has base64-encoded URI. ([bghgary](https://github.com/bghgary))
+- Fix the code generated for the NME gradient block ([Popov72](https://github.com/Popov72))
 - Fix ssao2RenderingPipeline for orthographic cameras ([Kesshi](https://github.com/Kesshi))
 
 ## Breaking changes

+ 2 - 0
src/Materials/Node/Blocks/gradientBlock.ts

@@ -183,6 +183,8 @@ export class GradientBlock extends NodeMaterialBlock {
     protected _dumpPropertiesCode() {
         var codeString = "";
 
+        codeString += `${this._codeVariableName}.colorSteps = [];\r\n`;
+
         for (var colorStep of this.colorSteps) {
             codeString += `${this._codeVariableName}.colorSteps.push(new BABYLON.GradientBlockColorStep(${colorStep.step}, new BABYLON.Color3(${colorStep.color.r}, ${colorStep.color.g}, ${colorStep.color.b})));\r\n`;
         }