glTF-Blender-IO: Diffuse BSDF and use_nodes=False are not supported.

Describe the bug

Materials colors are not exported

Taking this file

Cow.blend.zip

Exporting with the old exporter I get this

Screen Shot 2019-06-27 at 18 46 27

With the current export (cloned from the repo) I get this

Screen Shot 2019-06-27 at 18 46 52

To Reproduce Steps to reproduce the behavior:

  1. Download the attached file, unzip, double click the .blend file
  2. File->Export->glTF 2.0
  3. Export
  4. Load in a viewer

Expected behavior

There are material colors

Checking the gltf data the old exporter has this

    "materials" : [
        {
            "name" : "Black",
            "pbrMetallicRoughness" : {
                "baseColorFactor" : [
                    0.02327823673603291,
                    0.02327823673603291,
                    0.02327823673603291,
                    1.0
                ],
                "metallicFactor" : 0.0
            }
        },
        {
            "name" : "Pink",
            "pbrMetallicRoughness" : {
                "baseColorFactor" : [
                    0.640000066757203,
                    0.1408390542989828,
                    0.1733517791830268,
                    1.0
                ],
                "metallicFactor" : 0.0
            }
        },
        {
            "name" : "White",
            "pbrMetallicRoughness" : {
                "baseColorFactor" : [
                    0.6400000190734865,
                    0.6400000190734865,
                    0.6400000190734865,
                    1.0
                ],
                "metallicFactor" : 0.0
            }
        }
    ],

the new exporter only this

    "materials" : [
        {
            "name" : "White",
            "pbrMetallicRoughness" : {}
        },
        {
            "name" : "Black",
            "pbrMetallicRoughness" : {}
        },
        {
            "name" : "Pink",
            "pbrMetallicRoughness" : {}
        }
    ],

yes, export materials was checked

Version

  • OS: macOS
  • Blender Version 2.79

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

@samanthajo2 @kocsis1david In blender, use_node is most of the time enable by default. You provided only .blend file, so I don’t know what file format you imported, and I can’t check what happpen at import level.

The aim of an exporter is not to export exactly what was imported, but to export what is inside Blender. If use_node is not checked, and render in blender, you will not see the same render than if use_node is checked. Exporter should take this into account to export was use can see when he renders. ( of course modulo specification of the file format, that can’t handle everything done in blender)

The title talks about Diffuse BSDFs, but the Cow.blend file only uses use_nodes=False. I filed #1148 to fix use_nodes=False.

If Diffuse BSDF needs to be exported, I think a separate issue should be filed with an example .blend.

Let’s keep this open to track that Diffuse BSDF and use_nodes=False are not supported.

This exporter was rewritten — involving a very, very large number of changes — for Blender 2.80, and support for Blender 2.80-standard settings is currently higher priority. But supporting Diffuse BSDF and use_nodes=False again would be nice, if it’s not a major change from the current material export.

For more detail on what we support, and recommended settings, see https://docs.blender.org/manual/en/2.80/addons/io_scene_gltf2.html.