You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 28, 2019. It is now read-only.
I am trying to test out creating animated objects in Blender and exporting them to GLTF to use in WebVR scenes, but I am having two problems with the export. I created a simple spinning cube by adding an animation to the default cube and setting up a simple colored material. When I export this to GLTF and try to load it into a Three.js test web-page, the cube does not have its material applied and does not spin. If I add another object to the scene (say a plane), the cube will spin but is still not textured. When I examine the GLTF files, I see animation tags in both cases... but I do not see material tags in either case.
I do not know if I am setting things up wrong in Blender, the export, or if my JavaScript is wrong. I am attaching the GLTF and Blender files for both cases as well as the HTML file for the test harness.
@pweingar — testing your model here, I do see the animation: https://gltf-viewer.donmccurdy.com/. You may need to use a more recent version of THREE.GLTF2Loader (which in turn may require the dev branch of three.js...) or wait for r86.
Regarding the material, see the discussion here: #8. At minimum, you will probably want to set one of the experimental "common materials" options before export.
I am closing this issue, as it is not an issue with the Blender glTF 2.0 exporter:
A glTF 2.0 scene is valid, even it does not have any material assigned.
Only PBR Metallic Roughness material is in core now. To use and export PBR, please use the Blender node group: https://github.com/KhronosGroup/glTF-Blender-Exporter/tree/master/pbr_node
Of course, your renderer does need to support PBR.
As Don mentioned, you can enable the experimental common materials export. The export works fine and is just mentioned experimental, as the extension is not 100% finalized: KhronosGroup/glTF#947
What happened in your case:
You are using Blender Render and with the default export settings, no material is exported, as the material is not PBR and/or the experimental common materials is enabled.
In gltF 2.0, if no material is specified, a default material is used: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#default-material
I tried the dev branch of Three.js yesterday afternoon, and it did indeed fix my animation problem. I'll give the PBR material a try next. Thanks for your assistance.
I am trying to test out creating animated objects in Blender and exporting them to GLTF to use in WebVR scenes, but I am having two problems with the export. I created a simple spinning cube by adding an animation to the default cube and setting up a simple colored material. When I export this to GLTF and try to load it into a Three.js test web-page, the cube does not have its material applied and does not spin. If I add another object to the scene (say a plane), the cube will spin but is still not textured. When I examine the GLTF files, I see animation tags in both cases... but I do not see material tags in either case.
I do not know if I am setting things up wrong in Blender, the export, or if my JavaScript is wrong. I am attaching the GLTF and Blender files for both cases as well as the HTML file for the test harness.
SpinCube.zip
The text was updated successfully, but these errors were encountered: