aframevr / aframe-inspector

:mag: Visual inspector tool for A-Frame. Hit *<ctrl> + <alt> + i* on any A-Frame scene.
https://aframe.io/aframe-inspector/examples/
MIT License
654 stars 201 forks source link

Export to .glb with embedded images. #553

Closed donmccurdy closed 6 years ago

donmccurdy commented 6 years ago

@fernandojsg I believe this PR fixes #547 and fixes #551, but due to #552 I am not sure how to test this locally.

fernandojsg commented 6 years ago

@donmccurdy after a quick pass I've just tried it and it "works" but the .glb file contains just [object Object]. I'll check the code to see what is going wrong.

But I don't get any error because of https://github.com/aframevr/aframe-inspector/issues/552 I can't reproduce it /cc @dmarcos @ngokevin any idea what could be causing it?

fernandojsg commented 6 years ago

@donmccurdy I believe one of the needed steps is to update GLTFExporter.js with an updated version from three.js that supports binary: true :D

donmccurdy commented 6 years ago

Ok, I think this is working now — updated GLTFExporter, marked inspector helpers (see https://github.com/aframevr/aframe-inspector/issues/523#issuecomment-384522834), and filtered them out while exporting.

arpu commented 6 years ago

i had some time to test this! and it works fine

fernandojsg commented 6 years ago

Yeah, thanks for remind me I forgot about this one! Thanks @donmccurdy and @arpu

arpu commented 6 years ago

@donmccurdy if i use map.wrapS = THREE.RepeatWrapping; map.wrapT = THREE.RepeatWrapping; map.repeat.x = 20; map.repeat.y = 20; and export the generated gltf model this is not applied to the exported model is this a known problem ?

donmccurdy commented 6 years ago

Texture repeat, rotation, and offset are not part of the core glTF spec, but require a very recent extension. The THREE.GLTFLoader implementation has not been merged yet (https://github.com/mrdoob/three.js/pull/13831), and no PR for THREE.GLTFExporter exists yet.

EDIT: The wrapS / wrapT part should already be supported, though: https://github.com/mrdoob/three.js/blob/dev/examples/js/exporters/GLTFExporter.js#L740-L741