aframevr / aframe

:a: Web framework for building virtual reality experiences.
https://aframe.io/
MIT License
16.69k stars 3.98k forks source link

Uncaught TypeError: Cannot set property 'needsUpdate' of undefined a-obj-model #2862

Closed BoryaMogila closed 7 years ago

BoryaMogila commented 7 years ago

three.js:21805 Uncaught TypeError: Cannot set property 'needsUpdate' of undefined at D (three.js:21805) at M (three.js:21398) at ae.renderBufferDirect (three.js:20243) at _ (three.js:21034) at ae.render (three.js:20771) at THREE.VREffect.render (VREffect.js:394) at HTMLElement.value (a-scene.js:475) at bind.js:12

It happened when I export .obj file from sketchUp with 'export ribs' parameter my code: `

                <a-sky color="#d12727">
                    <a-obj-model src="#chair-obj" mtl="#chair-mtl"  position="-2.7 -1.7 -8.61" rotation="0 110 0"  scale="0.001 0.001 0.001"></a-obj-model>
                </a-sky>
            </a-scene>

`

donmccurdy commented 7 years ago

Could you share an OBJ created from SketchUp in this way?

Might also be worth testing your model somewhere like https://clara.io/ or FBX Review to see if the problem is isolated to A-Frame or related to the model.

BoryaMogila commented 7 years ago

https://clara.io/view/58575872-c615-4f48-98a3-8efea64a142f/webgl drive-download-20170711T180312Z-001.zip At https://clara.io/ not load textures

donmccurdy commented 7 years ago

Sorry this probably isn't the answer you want, but Sketchup's exports seem to be very unreliable. There's a problem in the model, causing <a-obj-model/> to crash and causing Clara.io to fail to parse colors. I can fix that manually in Maya LT (here is a corrected file: first.zip) but in the future you may have better luck with tools like MagicaVoxel or https://www.tinkercad.com/, or by learning more advanced tools like Blender.

BoryaMogila commented 7 years ago

Hi, thank you very much.

zoic21 commented 6 years ago

Hi I hace the same issue with export from sweethome3d when I use obj and mtl, hre the line : c.lights&&(g=h,q.ambientLightColor.needsUpdate= if three.js (it give me the error Uncaught TypeError: Cannot set property 'needsUpdate' of undefined).

I can not find how to fix that....

kschzt commented 6 years ago

this commit in three.js fixes the bug: https://github.com/mrdoob/three.js/commit/b319b89f3551ec405b4efa3ee5845f29ff5b76df#diff-c95aa6af1ef517957bfbff6af39992f5

happens with eg. this obj from Google Poly: https://poly.google.com/view/eGI3RS52kJA because there is a path problem with the mtl file. the texture fails to load and the three.js Material gets corrupted, resulting in this error.

dmarcos commented 6 years ago

@kschzt Thanks for checking. Have you tried if the problem still reproduces with master that uses a newer version of THREE?

kschzt commented 6 years ago

For some reason I'm not able to get master to render correctly atm. The fix in three.js will ship in r90 from what I can tell.

kschzt commented 6 years ago

FWIW the best workaround to this for me is 0.7.1 with three.js r88 with the material.lights = false; patch applied manually.