Skip to content

Exported material color and emission color values are wrong #115

@LaBodilsen

Description

@LaBodilsen

Issue
When exporting an object from blender, the diffuse color value is set from the intensity viewport display color instead of the material base color, and the emission color is set from the viewport display color instead of the material emission color.

OS/Platform
Windows 10 Pro 1909 + Blender 2.8 + Godot 3.1.1.stable.official

Problem
as seen in: https://github.com/godotengine/collada-exporter/blob/master/io_scene_dae/export_dae.py

Emission color set to diffuse:
line 295

 # TODO: More accurate coloring, if possible
 self.writel(S_FX, 6, "<color>{}</color>".format(
      numarr_alpha(material.diffuse_color, material.emit)))
 self.writel(S_FX, 5, "</emission>")

Diffuse color set to diffuse_intensity
line 311

   self.writel(S_FX, 6, "<color>{}</color>".format(numarr_alpha(
     material.diffuse_color, material.diffuse_intensity)))
 self.writel(S_FX, 5, "</diffuse>")

Steps to reproduce

  1. Open blender default scene,
  2. Click the default cube, and then click the material tab
  3. Set base color to Red, and Viewport display color to blue.
  4. Export the scene with the Better Collada exporter.
  5. Import to godot, and see the material albedo color is set to blue but with slightly lower intensity, and the emission color is set to blue .

Suggestion to fix
I think the more correct export would be to set the diffuse color to the Base color of the material, and not set emission color to diffuse color from viewport display color, but instead to the emission color from the material.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions