# Node Material Editor doesn't properly generate code for Trigonometry Blocks

**URL:** <https://forum.babylonjs.com/t/node-material-editor-doesnt-properly-generate-code-for-trigonometry-blocks/6760>\
**Category:** Bugs\
**Created:** [November 3, 2019, 1:17am UTC](https://forum.babylonjs.com/t/node-material-editor-doesnt-properly-generate-code-for-trigonometry-blocks/6760 "2019-11-03T01:17:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mentalnote](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@mentalnote](https://forum.babylonjs.com/u/mentalnote)\
**Post date:** [November 3, 2019, 1:17am UTC](https://forum.babylonjs.com/t/node-material-editor-doesnt-properly-generate-code-for-trigonometry-blocks/6760/1 "2019-11-03T01:17:17Z")

</div>

Hi,  
I seem to have run afoul of a bug with code generation for trigonometry blocks in the node material editor.

With an example material here: [Babylon.js Node Material Editor](https://nme.babylonjs.com/#YL3M94) using the ceiling node, we can see a result in the editor preview which is what we would expect.

If I then “Generate Code” with this material and dump that into a playground we instead get this result [Babylon.js Playground](https://www.babylonjs-playground.com/#SPWWI4)

It seems that when code for trigonometry blocks are generated, it doesn’t set the “operation” property for the block.

Looking through the source code it would seem to me that the fix for this is to implement the \_dumpPropertiesCode function for the TrigonometryBlock class, something to the tune of:

```auto
TrigonometryBlock.prototype._dumpPropertiesCode = function() {
        var codeString = this._codeVariableName + ".operation = " + this.operation + ";\r\n";
        return codeString;
    }

```

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [November 4, 2019, 4:43pm UTC](https://forum.babylonjs.com/t/node-material-editor-doesnt-properly-generate-code-for-trigonometry-blocks/6760/2 "2019-11-04T16:43:53Z")

</div>

> [@mentalnote](#):
>
> \_dumpPropertiesCode = function() { var codeString = this.\_codeVariableName + ".operation = " + this.operation + “;\r\n”; re

You are totally right! I’ll add this missing code 🙂

Thanks a ton and welcome!
