godotengine / godotengine/collada-exporter

Exported material color and emission color values are wrong

Open
#115 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
438
Forks
135
PR merge metrics
No merged PRs in 30d

Description

**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, "{}".format(
numarr_alpha(material.diffuse_color, material.emit)))
self.writel(S_FX, 5, "")
```

**Diffuse color set to diffuse_intensity**
line 311
```
self.writel(S_FX, 6, "{}".format(numarr_alpha(
material.diffuse_color, material.diffuse_intensity)))
self.writel(S_FX, 5, "")
```
**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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Inspect io_scene_dae/export_dae.py around lines 295 and 311, then reproduce the report with Blender's default cube using different material and viewport colors. Verify the exported COLLADA material uses the material base color for diffuse and the material emission color for emission, rather than the viewport display color.

Written by the indexing model from the issue text.

Assessment

Tech stack
blender, python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.