<h5 dir="auto">Description of the problem</h5>
<p dir="auto">I export a scene by this python function from io_three</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exporter.export_scene(file_name, settings.no_animation)"><pre class="notranslate"><code class="notranslate">exporter.export_scene(file_name, settings.no_animation)
</code></pre></div>
<p dir="auto">Link to the blender scene <a href="https://github.com/giangm9/blender3js/blob/dev/exporter/tests/blend/rotation.blend">Link</a><br>
In blender scene looks like this<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/10234339/36784518-403dece6-1cb2-11e8-8bd4-b605598e25f5.png"><img src="https://user-images.githubusercontent.com/10234339/36784518-403dece6-1cb2-11e8-8bd4-b605598e25f5.png" alt="screenshot from 2018-02-28 18-06-38" style="max-width: 100%;"></a><br>
when I load the scene and render, my output is<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/10234339/36784551-660937e6-1cb2-11e8-9a11-822eda6d10ce.png"><img src="https://user-images.githubusercontent.com/10234339/36784551-660937e6-1cb2-11e8-9a11-822eda6d10ce.png" alt="screenshot from 2018-02-28 18-08-26" style="max-width: 100%;"></a><br>
as you can see that, the position is right, but the Yrotation ( maybe) is wrong<br>
Link to my project <a href="https://github.com/giangm9/blender3js">https://github.com/giangm9/blender3js</a></p>
<h5 dir="auto">Three.js version</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Dev</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> r90</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> r89</li>
</ul>
<h5 dir="auto">Browser</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Chrome</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Firefox</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Internet Explorer</li>
</ul>
<h5 dir="auto">OS</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> All of them</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Windows</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> macOS</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Linux</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Android</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> iOS<br>
Blender version</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> 2.76</li>
</ul>
<h5 dir="auto">Hardware Requirements (graphics card, VR Device, ...)</h5>
<h5 dir="auto">Description of the problem</h5>
<p dir="auto">Two different materials is being recognised as the same material here: </p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/mrdoob/three.js/blob/c94018cb475e1c357671138e78741b1a162e0bf9/src/renderers/webgl/WebGLPrograms.js#L218">three.js/src/renderers/webgl/WebGLPrograms.js</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 218
      in
      <a data-pjax="true" class="commit-tease-sha" href="/mrdoob/three.js/commit/c94018cb475e1c357671138e78741b1a162e0bf9">c94018c</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L218" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="218"></td>
          <td id="LC218" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">getProgramCode</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span> <span class="pl-s1">material</span><span class="pl-kos">,</span> <span class="pl-s1">parameters</span> <span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="let someString = 'a';
const materialA = new THREE.MeshBasicMaterial();
materialA.onBeforeCompile = function() {
  // do something with someString
}

someString = 'b';
const materialB = new THREE.MeshBasicMaterial();
materialB.onBeforeCompile = function() {
  // do something with someString
}"><pre class="notranslate"><span class="pl-k">let</span> <span class="pl-s1">someString</span> <span class="pl-c1">=</span> <span class="pl-s">'a'</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">materialA</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-c1">THREE</span><span class="pl-kos">.</span><span class="pl-c1">MeshBasicMaterial</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">materialA</span><span class="pl-kos">.</span><span class="pl-en">onBeforeCompile</span> <span class="pl-c1">=</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-c">// do something with someString</span>
<span class="pl-kos">}</span>

<span class="pl-s1">someString</span> <span class="pl-c1">=</span> <span class="pl-s">'b'</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">materialB</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-c1">THREE</span><span class="pl-kos">.</span><span class="pl-c1">MeshBasicMaterial</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">materialB</span><span class="pl-kos">.</span><span class="pl-en">onBeforeCompile</span> <span class="pl-c1">=</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-c">// do something with someString</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">The hash of those materials will be the same when using <a href="https://github.com/mrdoob/three.js/blob/c94018cb475e1c357671138e78741b1a162e0bf9/src/renderers/webgl/WebGLPrograms.js#L250"><code class="notranslate">onBeforeCompile.toString()</code></a> but they do different things because of different variable values.</p>
<p dir="auto">So the compiled version of <code class="notranslate">materialA</code> is equal to the compiled version of <code class="notranslate">materialB</code> when they are not equal.</p>
<h5 dir="auto">Three.js version</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Dev</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> r96</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ...</li>
</ul>
<h5 dir="auto">Browser</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Chrome</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Firefox</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Internet Explorer</li>
</ul>
<h5 dir="auto">OS</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Windows</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> macOS</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Linux</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Android</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> iOS</li>
</ul>
<h5 dir="auto">Hardware Requirements (graphics card, VR Device, ...)</h5>