Browse Source

Merge pull request #94 from Jason0214/fix_color_gamma

Gamma correct vertex color, spatial material albedo and light color
Lu Jiacheng 6 years ago
parent
commit
4d7e37bb26
26 changed files with 66 additions and 136 deletions
  1. 7 0
      io_scene_godot/converters/animation/action.py
  2. 4 3
      io_scene_godot/converters/material.py
  3. 6 6
      io_scene_godot/converters/simple_nodes.py
  4. 8 0
      io_scene_godot/structures.py
  5. 4 15
      tests/reference_exports/action_animation/animation_object_transform.escn
  6. 4 15
      tests/reference_exports/action_animation/animation_rotation_euler.escn
  7. 2 13
      tests/reference_exports/action_animation/animation_shared_action.escn
  8. 1 1
      tests/reference_exports/action_animation/physics_animation.escn
  9. 0 20
      tests/reference_exports/armature/just_armature.escn
  10. 4 15
      tests/reference_exports/camera/animation_camera.escn
  11. 2 13
      tests/reference_exports/duplicate_name.escn
  12. 3 3
      tests/reference_exports/light/animation_various_lights.escn
  13. 2 2
      tests/reference_exports/light/just_point_lights.escn
  14. 8 8
      tests/reference_exports/light/just_spot_lights.escn
  15. 4 4
      tests/reference_exports/material/object_link_material.escn
  16. 2 2
      tests/reference_exports/material/simple_materials.escn
  17. 1 1
      tests/reference_exports/material_cycle/material_cycle.escn
  18. 2 13
      tests/reference_exports/scene_animation/animation_parented_objects.escn
  19. 2 2
      tests/reference_exports/shape_key/shapekey_with_multi_surface.escn
  20. BIN
      tests/test_scenes/action_animation/animation_object_transform.blend
  21. BIN
      tests/test_scenes/action_animation/animation_rotation_euler.blend
  22. BIN
      tests/test_scenes/action_animation/animation_shared_action.blend
  23. BIN
      tests/test_scenes/armature/just_armature.blend
  24. BIN
      tests/test_scenes/camera/animation_camera.blend
  25. BIN
      tests/test_scenes/duplicate_name.blend
  26. BIN
      tests/test_scenes/scene_animation/animation_parented_objects.blend

+ 7 - 0
io_scene_godot/converters/animation/action.py

@@ -291,6 +291,13 @@ def export_light_action(light_node, animation_player, blender_lamp,
                     action_strip.evaluate_fcurve(fcurve, frame)
                 )
 
+    for bl_attr, _, converter in light_node.attribute_conversion:
+        if (bl_attr in ('color', 'shadow_color') and
+                bl_attr in color_frame_values_map):
+            color_frame_values_map[bl_attr] = [
+                converter(x) for x in color_frame_values_map[bl_attr]
+            ]
+
     for attribute, frame_value_list in color_frame_values_map.items():
         if attribute == 'color':
             track_path = base_node_path.new_copy('light_color')

+ 4 - 3
io_scene_godot/converters/material.py

@@ -8,7 +8,8 @@ import logging
 import os
 import bpy
 from .material_node_tree.exporters import export_node_tree
-from ..structures import InternalResource, ExternalResource, ValidationError
+from ..structures import (
+    InternalResource, ExternalResource, gamma_correct, ValidationError)
 
 
 def export_image(escn_file, export_settings, image):
@@ -61,8 +62,8 @@ def generate_material_resource(escn_file, export_settings, material):
         return resource_id
 
     engine = bpy.context.scene.render.engine
-
     mat = None
+
     if engine == 'CYCLES' and material.node_tree is not None:
         mat = InternalResource("ShaderMaterial", material.name)
         try:
@@ -82,7 +83,7 @@ def generate_material_resource(escn_file, export_settings, material):
         mat['flags_vertex_lighting'] = material.use_vertex_color_light
         mat['flags_transparent'] = material.use_transparency
         mat['vertex_color_use_as_albedo'] = material.use_vertex_color_paint
-        mat['albedo_color'] = material.diffuse_color
+        mat['albedo_color'] = gamma_correct(material.diffuse_color)
         mat['subsurf_scatter_enabled'] = material.subsurface_scattering.use
     return escn_file.add_internal_resource(mat, material)
 

+ 6 - 6
io_scene_godot/converters/simple_nodes.py

@@ -5,9 +5,10 @@ Anything more complex should go in it's own file
 
 import math
 import logging
-import mathutils
-from ..structures import NodeTemplate, fix_directional_transform
-from .animation import (export_animation_data, AttributeConvertInfo)
+from ..structures import (
+    NodeTemplate, fix_directional_transform, gamma_correct
+)
+from .animation import export_animation_data, AttributeConvertInfo
 
 
 def export_empty_node(escn_file, export_settings, node, parent_gd_node):
@@ -78,8 +79,8 @@ class LightNode(NodeTemplate):
             'use_specular', 'light_specular', lambda x: 1.0 if x else 0.0
         ),
         AttributeConvertInfo('energy', 'light_energy', lambda x: x),
-        AttributeConvertInfo('color', 'light_color', mathutils.Color),
-        AttributeConvertInfo('shadow_color', 'shadow_color', mathutils.Color),
+        AttributeConvertInfo('color', 'light_color', gamma_correct),
+        AttributeConvertInfo('shadow_color', 'shadow_color', gamma_correct),
     ]
     _omni_attr_conv = [
         AttributeConvertInfo('distance', 'omni_range', lambda x: x),
@@ -124,7 +125,6 @@ def export_lamp_node(escn_file, export_settings, node, parent_gd_node):
 
     elif light.type == "SPOT":
         light_node = LightNode(node.name, 'SpotLight', parent_gd_node)
-
         if not light.use_sphere:
             logging.warning(
                 "Ranged light without sphere enabled: %s", node.name

+ 8 - 0
io_scene_godot/structures.py

@@ -384,6 +384,14 @@ def fix_bone_attachment_location(attachment_obj, location_vec):
     return vec
 
 
+def gamma_correct(color):
+    """Apply sRGB color space gamma correction to the given color"""
+    # note that here use a widely mentioned sRGB approximation gamma = 2.2
+    # it is good enough, the exact gamma of sRGB can be find at
+    # https://en.wikipedia.org/wiki/SRGB
+    return mathutils.Color(tuple([x ** (1 / 2.2) for x in color]))
+
+
 # ------------------ Implicit Conversions of Blender Types --------------------
 def mat4_to_string(mtx):
     """Converts a matrix to a "Transform" string that can be parsed by Godot"""

+ 4 - 15
tests/reference_exports/action_animation/animation_object_transform.escn

@@ -1,20 +1,9 @@
 [gd_scene load_steps=1 format=2]
 
-[sub_resource id=1 type="SpatialMaterial"]
-
-resource_name = "Material"
-flags_unshaded = false
-flags_vertex_lighting = false
-flags_transparent = false
-vertex_color_use_as_albedo = false
-albedo_color = Color(0.8, 0.8, 0.8, 1.0)
-subsurf_scatter_enabled = false
-
-[sub_resource id=2 type="ArrayMesh"]
+[sub_resource id=1 type="ArrayMesh"]
 
 resource_name = "Cube"
 surfaces/0 = {
-	"material":SubResource(1),
 	"primitive":4,
 	"arrays":[
 		Vector3Array(1.0, -1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 0.999999, 1.0, 1.0, 1.0, 1.0, -0.999999, 1.0, 1.0, -0.999999, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 0.999999, 1.0, 1.0, -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -0.999999, 1.0, -1.0, 1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 0.999999, 1.0, 1.0, 1.0, 1.0, -0.999999, 0.999999, 1.0, 1.0, 1.0, -1.0, 1.0, 0.999999, 1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0),
@@ -30,7 +19,7 @@ surfaces/0 = {
 	"morph_arrays":[]
 }
 
-[sub_resource id=3 type="Animation"]
+[sub_resource id=2 type="Animation"]
 
 resource_name = "CubeAction"
 step = 0.1
@@ -44,11 +33,11 @@ tracks/0/keys = [0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0
 
 [node name="Cube" type="MeshInstance" parent="."]
 
-mesh = SubResource(2)
+mesh = SubResource(1)
 visible = true
 transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0)
 
 [node name="AnimationPlayer" type="AnimationPlayer" parent="Cube"]
 
 root_node = NodePath("..:")
-anims/CubeAction = SubResource(3)
+anims/CubeAction = SubResource(2)

+ 4 - 15
tests/reference_exports/action_animation/animation_rotation_euler.escn

@@ -1,20 +1,9 @@
 [gd_scene load_steps=1 format=2]
 
-[sub_resource id=1 type="SpatialMaterial"]
-
-resource_name = "Material"
-flags_unshaded = false
-flags_vertex_lighting = false
-flags_transparent = false
-vertex_color_use_as_albedo = false
-albedo_color = Color(0.8, 0.8, 0.8, 1.0)
-subsurf_scatter_enabled = false
-
-[sub_resource id=2 type="ArrayMesh"]
+[sub_resource id=1 type="ArrayMesh"]
 
 resource_name = "Cube"
 surfaces/0 = {
-	"material":SubResource(1),
 	"primitive":4,
 	"arrays":[
 		Vector3Array(1.0, -1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 0.999999, 1.0, 1.0, 1.0, 1.0, -0.999999, 1.0, 1.0, -0.999999, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 0.999999, 1.0, 1.0, -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -0.999999, 1.0, -1.0, 1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 0.999999, 1.0, 1.0, 1.0, 1.0, -0.999999, 0.999999, 1.0, 1.0, 1.0, -1.0, 1.0, 0.999999, 1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0),
@@ -30,7 +19,7 @@ surfaces/0 = {
 	"morph_arrays":[]
 }
 
-[sub_resource id=3 type="Animation"]
+[sub_resource id=2 type="Animation"]
 
 resource_name = "CubeAction"
 step = 0.1
@@ -44,11 +33,11 @@ tracks/0/keys = [0.0, 1.0, -0.284979, 2.62876, -2.59493, 0.0, 0.0, 0.0, 1.0, 1.0
 
 [node name="Cube" type="MeshInstance" parent="."]
 
-mesh = SubResource(2)
+mesh = SubResource(1)
 visible = true
 transform = Transform(0.416415, 0.901424, 0.118463, -0.695175, 0.231712, 0.680472, 0.585944, -0.365711, 0.723136, -0.284979, 2.62876, -2.59493)
 
 [node name="AnimationPlayer" type="AnimationPlayer" parent="Cube"]
 
 root_node = NodePath("..:")
-anims/CubeAction = SubResource(3)
+anims/CubeAction = SubResource(2)

File diff suppressed because it is too large
+ 2 - 13
tests/reference_exports/action_animation/animation_shared_action.escn


+ 1 - 1
tests/reference_exports/action_animation/physics_animation.escn

@@ -12,7 +12,7 @@ flags_unshaded = false
 flags_vertex_lighting = false
 flags_transparent = false
 vertex_color_use_as_albedo = false
-albedo_color = Color(0.8, 0.8, 0.8, 1.0)
+albedo_color = Color(0.903545, 0.903545, 0.903545, 1.0)
 subsurf_scatter_enabled = false
 
 [sub_resource id=3 type="ArrayMesh"]

+ 0 - 20
tests/reference_exports/armature/just_armature.escn

@@ -31,23 +31,3 @@ bones/3/rest = Transform(0.0, 0.0, -1.0, 1.0, -4.37114e-08, 0.0, -4.37114e-08, -
 bones/3/pose = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0)
 bones/3/enabled = true
 bones/3/bound_children = []
-
-[node name="Lamp" type="OmniLight" parent="."]
-
-light_specular = 1.0
-light_energy = 1.0
-light_color = Color(1.0, 1.0, 1.0, 1.0)
-shadow_color = Color(0.0, 0.0, 0.0, 1.0)
-omni_range = 30.0
-transform = Transform(-0.290865, -0.771101, 0.566393, -0.0551891, 0.604525, 0.794672, -0.955171, 0.199883, -0.218391, 4.07625, 5.90386, -1.00545)
-shadow_enabled = true
-light_negative = false
-
-[node name="Camera" type="Camera" parent="."]
-
-far = 100.0
-near = 0.1
-size = 7.31429
-projection = 0
-fov = 49.1343
-transform = Transform(0.685921, -0.324014, 0.651558, 0.0, 0.895396, 0.445271, -0.727676, -0.305421, 0.61417, 7.48113, 5.34367, 6.50764)

+ 4 - 15
tests/reference_exports/camera/animation_camera.escn

@@ -1,20 +1,9 @@
 [gd_scene load_steps=1 format=2]
 
-[sub_resource id=1 type="SpatialMaterial"]
-
-resource_name = "Material"
-flags_unshaded = false
-flags_vertex_lighting = false
-flags_transparent = false
-vertex_color_use_as_albedo = false
-albedo_color = Color(0.8, 0.8, 0.8, 1.0)
-subsurf_scatter_enabled = false
-
-[sub_resource id=2 type="ArrayMesh"]
+[sub_resource id=1 type="ArrayMesh"]
 
 resource_name = "Cube"
 surfaces/0 = {
-	"material":SubResource(1),
 	"primitive":4,
 	"arrays":[
 		Vector3Array(1.0, -1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 0.999999, 1.0, 1.0, 1.0, 1.0, -0.999999, 1.0, 1.0, -0.999999, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 0.999999, 1.0, 1.0, -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -0.999999, 1.0, -1.0, 1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 0.999999, 1.0, 1.0, 1.0, 1.0, -0.999999, 0.999999, 1.0, 1.0, 1.0, -1.0, 1.0, 0.999999, 1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0),
@@ -30,7 +19,7 @@ surfaces/0 = {
 	"morph_arrays":[]
 }
 
-[sub_resource id=3 type="Animation"]
+[sub_resource id=2 type="Animation"]
 
 resource_name = "CameraAction"
 step = 0.1
@@ -85,7 +74,7 @@ tracks/4/keys = {
 
 [node name="Cube" type="MeshInstance" parent="."]
 
-mesh = SubResource(2)
+mesh = SubResource(1)
 visible = true
 transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0)
 
@@ -101,4 +90,4 @@ transform = Transform(0.685921, -0.324014, 0.651558, 0.0, 0.895396, 0.445271, -0
 [node name="AnimationPlayer" type="AnimationPlayer" parent="Camera"]
 
 root_node = NodePath("..:")
-anims/CameraAction = SubResource(3)
+anims/CameraAction = SubResource(2)

+ 2 - 13
tests/reference_exports/duplicate_name.escn

@@ -38,21 +38,10 @@ surfaces/0 = {
 	"morph_arrays":[]
 }
 
-[sub_resource id=3 type="SpatialMaterial"]
-
-resource_name = "Material"
-flags_unshaded = false
-flags_vertex_lighting = false
-flags_transparent = false
-vertex_color_use_as_albedo = false
-albedo_color = Color(0.8, 0.8, 0.8, 1.0)
-subsurf_scatter_enabled = false
-
-[sub_resource id=4 type="ArrayMesh"]
+[sub_resource id=3 type="ArrayMesh"]
 
 resource_name = "Cube"
 surfaces/0 = {
-	"material":SubResource(3),
 	"primitive":4,
 	"arrays":[
 		Vector3Array(1.0, -1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 0.999999, 1.0, 1.0, 1.0, 1.0, -0.999999, 1.0, 1.0, -0.999999, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 0.999999, 1.0, 1.0, -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -0.999999, 1.0, -1.0, 1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 0.999999, 1.0, 1.0, 1.0, 1.0, -0.999999, 0.999999, 1.0, 1.0, 1.0, -1.0, 1.0, 0.999999, 1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0),
@@ -84,6 +73,6 @@ transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.13324, 0.30
 
 [node name="Cube002" type="MeshInstance" parent="."]
 
-mesh = SubResource(4)
+mesh = SubResource(3)
 visible = true
 transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0)

+ 3 - 3
tests/reference_exports/light/animation_various_lights.escn

@@ -65,7 +65,7 @@ tracks/1/keys = {
 	"times":PoolRealArray(0.0, 0.0416667, 0.0833333, 0.125, 0.166667, 0.208333, 0.25, 0.291667, 0.333333, 0.375, 0.416667, 0.458333, 0.5, 0.541667, 0.583333, 0.625, 0.666667, 0.708333, 0.75, 0.791667, 0.833333, 0.875, 0.916667, 0.958333, 1.0, 1.04167, 1.08333, 1.125, 1.16667, 1.20833, 1.25, 1.29167, 1.33333, 1.375, 1.41667, 1.45833, 1.5, 1.54167, 1.58333, 1.625, 1.66667, 1.91667),
 	"transitions":PoolRealArray(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
 	"update":0,
-	"values":[Color(0.0, 0.0, 0.0, 1.0), Color(0.00197254, 0.00197254, 0.00197254, 1.0), Color(0.00790906, 0.00790906, 0.00790906, 1.0), Color(0.0175615, 0.0175615, 0.0175615, 1.0), Color(0.0301865, 0.0301865, 0.0301865, 1.0), Color(0.0444885, 0.0444885, 0.0444885, 1.0), Color(0.0587905, 0.0587905, 0.0587905, 1.0), Color(0.0714154, 0.0714154, 0.0714154, 1.0), Color(0.0810679, 0.0810679, 0.0810679, 1.0), Color(0.0870044, 0.0870044, 0.0870044, 1.0), Color(0.0889769, 0.0889769, 0.0889769, 1.0), Color(0.0889769, 0.0873904, 0.0875582, 1.0), Color(0.0889769, 0.0826156, 0.0832886, 1.0), Color(0.0889768, 0.074852, 0.0763463, 1.0), Color(0.0889768, 0.0646977, 0.0672662, 1.0), Color(0.0889767, 0.0531944, 0.0569799, 1.0), Color(0.0889766, 0.0416912, 0.0466936, 1.0), Color(0.0889765, 0.0315368, 0.0376135, 1.0), Color(0.0889764, 0.0237733, 0.0306712, 1.0), Color(0.0889764, 0.0189985, 0.0264015, 1.0), Color(0.0889764, 0.0174119, 0.0249828, 1.0), Color(0.092455, 0.0179768, 0.0344664, 1.0), Color(0.102924, 0.019677, 0.0630078, 1.0), Color(0.119947, 0.0224414, 0.109415, 1.0), Color(0.142211, 0.026057, 0.170113, 1.0), Color(0.167433, 0.030153, 0.238874, 1.0), Color(0.192655, 0.034249, 0.307634, 1.0), Color(0.21492, 0.0378646, 0.368332, 1.0), Color(0.231942, 0.040629, 0.414739, 1.0), Color(0.242412, 0.0423292, 0.443281, 1.0), Color(0.24589, 0.0428941, 0.452764, 1.0), Color(0.19434, 0.03505, 0.36489, 1.0), Color(0.0839803, 0.0182646, 0.17685, 1.0), Color(0.0322791, 0.0104205, 0.0889757, 1.0), Color(0.032099, 0.0124122, 0.101517, 1.0), Color(0.0319616, 0.0182088, 0.138016, 1.0), Color(0.0318738, 0.0265418, 0.190485, 1.0), Color(0.0318311, 0.0348748, 0.242955, 1.0), Color(0.0318175, 0.0406714, 0.279454, 1.0), Color(0.0318159, 0.0426631, 0.291995, 1.0), Color(0.0318159, 0.0426631, 0.291995, 1.0), Color(0.0318159, 0.0426631, 0.291995, 1.0)]
+	"values":[Color(0.0, 0.0, 0.0, 1.0), Color(0.0589476, 0.0589476, 0.0589476, 1.0), Color(0.110816, 0.110816, 0.110816, 1.0), Color(0.159248, 0.159248, 0.159248, 1.0), Color(0.203707, 0.203707, 0.203707, 1.0), Color(0.242978, 0.242978, 0.242978, 1.0), Color(0.2758, 0.2758, 0.2758, 1.0), Color(0.301298, 0.301298, 0.301298, 1.0), Color(0.31917, 0.31917, 0.31917, 1.0), Color(0.329589, 0.329589, 0.329589, 1.0), Color(0.332965, 0.332965, 0.332965, 1.0), Color(0.332965, 0.330253, 0.330541, 1.0), Color(0.332965, 0.321926, 0.323115, 1.0), Color(0.332965, 0.307804, 0.310582, 1.0), Color(0.332965, 0.288068, 0.293211, 1.0), Color(0.332965, 0.263541, 0.271906, 1.0), Color(0.332965, 0.235911, 0.24838, 1.0), Color(0.332964, 0.2078, 0.225128, 1.0), Color(0.332964, 0.18275, 0.205187, 1.0), Color(0.332964, 0.165044, 0.191672, 1.0), Color(0.332964, 0.15863, 0.18692, 1.0), Color(0.33882, 0.160949, 0.216361, 1.0), Color(0.35575, 0.167698, 0.284623, 1.0), Color(0.38138, 0.178023, 0.365777, 1.0), Color(0.412069, 0.190531, 0.447028, 1.0), Color(0.443814, 0.203604, 0.521614, 1.0), Color(0.473043, 0.21574, 0.585179, 1.0), Color(0.497152, 0.22581, 0.635092, 1.0), Color(0.514679, 0.233159, 0.670288, 1.0), Color(0.525112, 0.237545, 0.690875, 1.0), Color(0.528523, 0.238981, 0.697555, 1.0), Color(0.474919, 0.218019, 0.632387, 1.0), Color(0.324332, 0.162115, 0.45499, 1.0), Color(0.210009, 0.125615, 0.332963, 1.0), Color(0.209475, 0.136009, 0.35353, 1.0), Color(0.209067, 0.16189, 0.406498, 1.0), Color(0.208806, 0.192134, 0.470614, 1.0), Color(0.208679, 0.217523, 0.525646, 1.0), Color(0.208638, 0.23327, 0.560174, 1.0), Color(0.208633, 0.238395, 0.571464, 1.0), Color(0.208633, 0.238395, 0.571464, 1.0), Color(0.208633, 0.238395, 0.571464, 1.0)]
 }
 
 [sub_resource id=5 type="ArrayMesh"]
@@ -114,7 +114,7 @@ tracks/0/keys = {
 	"times":PoolRealArray(0.0416667, 0.0833333, 0.125, 0.166667, 0.208333, 0.25, 0.291667, 0.333333, 0.375, 0.416667, 0.458333, 0.5, 0.541667, 0.583333, 0.625, 0.666667, 0.708333, 0.75, 0.791667, 0.833333, 0.875, 0.916667, 0.958333, 1.0, 1.04167, 1.08333, 1.125, 1.16667, 1.20833, 1.25),
 	"transitions":PoolRealArray(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
 	"update":0,
-	"values":[Color(1.0, 0.0544861, 0.0468638, 1.0), Color(1.0, 0.060269, 0.0465212, 1.0), Color(1.0, 0.0784506, 0.0454935, 1.0), Color(1.0, 0.109634, 0.0438432, 1.0), Color(1.0, 0.152991, 0.0417439, 1.0), Color(1.0, 0.205826, 0.0394789, 1.0), Color(1.0, 0.263983, 0.0373796, 1.0), Color(1.0, 0.323046, 0.0357294, 1.0), Color(1.0, 0.379493, 0.0347016, 1.0), Color(1.0, 0.431146, 0.0343591, 1.0), Color(1.0, 0.485406, 0.0344888, 1.0), Color(1.0, 0.549939, 0.0348965, 1.0), Color(1.0, 0.622855, 0.0355998, 1.0), Color(1.0, 0.700569, 0.036593, 1.0), Color(1.0, 0.777864, 0.0378374, 1.0), Color(1.0, 0.848752, 0.0392615, 1.0), Color(1.0, 0.907889, 0.0407755, 1.0), Color(1.0, 0.951738, 0.0422938, 1.0), Color(1.0, 0.97886, 0.0437505, 1.0), Color(1.0, 0.989468, 0.0451042, 1.0), Color(0.984839, 0.992027, 0.0465551, 1.0), Color(0.939209, 0.994273, 0.0483044, 1.0), Color(0.865018, 0.99615, 0.0502985, 1.0), Color(0.76798, 0.997623, 0.0524349, 1.0), Color(0.658051, 0.998684, 0.054564, 1.0), Color(0.548122, 0.99937, 0.0565134, 1.0), Color(0.451084, 0.999756, 0.058129, 1.0), Color(0.376892, 0.999935, 0.0593081, 1.0), Color(0.331263, 0.999993, 0.0600084, 1.0), Color(0.316101, 1.0, 0.0602354, 1.0)]
+	"values":[Color(1.0, 0.266431, 0.248791, 1.0), Color(1.0, 0.278931, 0.247963, 1.0), Color(1.0, 0.314444, 0.245458, 1.0), Color(1.0, 0.366111, 0.24137, 1.0), Color(1.0, 0.425984, 0.236046, 1.0), Color(1.0, 0.487477, 0.230136, 1.0), Color(1.0, 0.545859, 0.22449, 1.0), Color(1.0, 0.598327, 0.21993, 1.0), Color(1.0, 0.643767, 0.217031, 1.0), Color(1.0, 0.682213, 0.216055, 1.0), Color(1.0, 0.71998, 0.216425, 1.0), Color(1.0, 0.762011, 0.217585, 1.0), Color(1.0, 0.80638, 0.219567, 1.0), Color(1.0, 0.850649, 0.222331, 1.0), Color(1.0, 0.892094, 0.225736, 1.0), Color(1.0, 0.92817, 0.229559, 1.0), Color(1.0, 0.957027, 0.233541, 1.0), Color(1.0, 0.977767, 0.237455, 1.0), Color(1.0, 0.990335, 0.241138, 1.0), Color(1.0, 0.995199, 0.244501, 1.0), Color(0.99308, 0.996368, 0.248045, 1.0), Color(0.971895, 0.997393, 0.252239, 1.0), Color(0.936214, 0.998248, 0.25692, 1.0), Color(0.886924, 0.998919, 0.261824, 1.0), Color(0.826781, 0.999401, 0.266604, 1.0), Color(0.760865, 0.999714, 0.270892, 1.0), Color(0.696376, 0.999889, 0.274385, 1.0), Color(0.641758, 0.99997, 0.276901, 1.0), Color(0.605197, 0.999997, 0.278383, 1.0), Color(0.592445, 1.0, 0.278861, 1.0)]
 }
 
 [sub_resource id=8 type="ArrayMesh"]
@@ -226,7 +226,7 @@ anims/SpotAction = SubResource(6)
 
 light_specular = 1.0
 light_energy = 1.0
-light_color = Color(1.0, 0.0544861, 0.0468638, 1.0)
+light_color = Color(1.0, 0.266431, 0.248791, 1.0)
 shadow_color = Color(0.0, 0.0, 0.0, 1.0)
 omni_range = 1.0
 transform = Transform(-0.290865, -0.771101, 0.566393, -0.0551891, 0.604525, 0.794672, -0.955171, 0.199883, -0.218391, 5.25185, 0.215087, 5.49347)

+ 2 - 2
tests/reference_exports/light/just_point_lights.escn

@@ -63,7 +63,7 @@ surfaces/0 = {
 
 light_specular = 1.0
 light_energy = 1.0
-light_color = Color(0.674415, 0.00033786, 1.0, 1.0)
+light_color = Color(0.836064, 0.0264334, 1.0, 1.0)
 shadow_color = Color(0.0, 0.0, 0.0, 1.0)
 omni_range = 5.0
 transform = Transform(1.0, 0.0, 0.0, 0.0, -4.37114e-08, 1.0, 0.0, -1.0, -4.37114e-08, 0.0, 0.4, 1.0)
@@ -86,7 +86,7 @@ transform = Transform(0.3, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.3, -2.0, 0.0, 0.
 
 light_specular = 1.0
 light_energy = 1.0
-light_color = Color(0.0, 1.0, 0.00242467, 1.0)
+light_color = Color(0.0, 1.0, 0.064745, 1.0)
 shadow_color = Color(0.0, 0.0, 0.0, 1.0)
 omni_range = 5.0
 transform = Transform(1.0, 0.0, 0.0, 0.0, -4.37114e-08, 1.0, 0.0, -1.0, -4.37114e-08, -2.0, 0.4, 1.0)

+ 8 - 8
tests/reference_exports/light/just_spot_lights.escn

@@ -63,7 +63,7 @@ surfaces/0 = {
 
 light_specular = 1.0
 light_energy = 5.0
-light_color = Color(0.0, 1.0, 0.796991, 1.0)
+light_color = Color(0.0, 1.0, 0.901999, 1.0)
 shadow_color = Color(0.0, 0.0, 0.0, 1.0)
 spot_angle = 10.0
 spot_angle_attenuation = 20.0
@@ -76,7 +76,7 @@ light_negative = false
 
 light_specular = 1.0
 light_energy = 5.0
-light_color = Color(0.0, 1.0, 0.796991, 1.0)
+light_color = Color(0.0, 1.0, 0.901999, 1.0)
 shadow_color = Color(0.0, 0.0, 0.0, 1.0)
 spot_angle = 10.0
 spot_angle_attenuation = 0.19802
@@ -89,7 +89,7 @@ light_negative = false
 
 light_specular = 1.0
 light_energy = 1.0
-light_color = Color(0.0, 1.0, 0.796991, 1.0)
+light_color = Color(0.0, 1.0, 0.901999, 1.0)
 shadow_color = Color(0.0, 0.0, 0.0, 1.0)
 spot_angle = 10.0
 spot_angle_attenuation = 0.19802
@@ -102,7 +102,7 @@ light_negative = false
 
 light_specular = 1.0
 light_energy = 1.0
-light_color = Color(0.0, 1.0, 0.796991, 1.0)
+light_color = Color(0.0, 1.0, 0.901999, 1.0)
 shadow_color = Color(0.0, 0.0, 0.0, 1.0)
 spot_angle = 10.0
 spot_angle_attenuation = 20.0
@@ -115,7 +115,7 @@ light_negative = false
 
 light_specular = 1.0
 light_energy = 1.0
-light_color = Color(0.0, 1.0, 0.796991, 1.0)
+light_color = Color(0.0, 1.0, 0.901999, 1.0)
 shadow_color = Color(0.0, 0.0, 0.0, 1.0)
 spot_angle = 60.0
 spot_angle_attenuation = 1.25
@@ -128,7 +128,7 @@ light_negative = false
 
 light_specular = 1.0
 light_energy = 1.0
-light_color = Color(0.00993437, 1.0, 0.0, 1.0)
+light_color = Color(0.122916, 1.0, 0.0, 1.0)
 shadow_color = Color(0.0, 0.0, 0.0, 1.0)
 spot_angle = 10.0
 spot_angle_attenuation = 1.25
@@ -153,7 +153,7 @@ transform = Transform(0.3, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.3, -4.0, 0.0, 0.
 
 light_specular = 1.0
 light_energy = 1.0
-light_color = Color(0.990355, 0.0, 1.0, 1.0)
+light_color = Color(0.995604, 0.0, 1.0, 1.0)
 shadow_color = Color(0.0, 0.0, 0.0, 1.0)
 spot_angle = 37.5
 spot_angle_attenuation = 1.25
@@ -166,7 +166,7 @@ light_negative = false
 
 light_specular = 1.0
 light_energy = 1.0
-light_color = Color(0.0, 0.340107, 1.0, 1.0)
+light_color = Color(0.0, 0.612489, 1.0, 1.0)
 shadow_color = Color(0.0, 0.0, 0.0, 1.0)
 spot_angle = 37.5
 spot_angle_attenuation = 1.25

+ 4 - 4
tests/reference_exports/material/object_link_material.escn

@@ -7,7 +7,7 @@ flags_unshaded = false
 flags_vertex_lighting = false
 flags_transparent = false
 vertex_color_use_as_albedo = false
-albedo_color = Color(0.0394116, 0.058329, 0.8, 1.0)
+albedo_color = Color(0.229957, 0.274814, 0.903545, 1.0)
 subsurf_scatter_enabled = false
 
 [sub_resource id=2 type="SpatialMaterial"]
@@ -17,7 +17,7 @@ flags_unshaded = false
 flags_vertex_lighting = false
 flags_transparent = false
 vertex_color_use_as_albedo = false
-albedo_color = Color(0.8, 0.8, 0.8, 1.0)
+albedo_color = Color(0.903545, 0.903545, 0.903545, 1.0)
 subsurf_scatter_enabled = false
 
 [sub_resource id=3 type="ArrayMesh"]
@@ -63,7 +63,7 @@ flags_unshaded = false
 flags_vertex_lighting = false
 flags_transparent = false
 vertex_color_use_as_albedo = false
-albedo_color = Color(0.8, 0.0201475, 0.0444397, 1.0)
+albedo_color = Color(0.903545, 0.169508, 0.242857, 1.0)
 subsurf_scatter_enabled = false
 
 [sub_resource id=5 type="SpatialMaterial"]
@@ -73,7 +73,7 @@ flags_unshaded = false
 flags_vertex_lighting = false
 flags_transparent = false
 vertex_color_use_as_albedo = false
-albedo_color = Color(0.00971971, 0.8, 0.0132156, 1.0)
+albedo_color = Color(0.121702, 0.903545, 0.139942, 1.0)
 subsurf_scatter_enabled = false
 [node type="Spatial" name="Scene"]
 

+ 2 - 2
tests/reference_exports/material/simple_materials.escn

@@ -7,7 +7,7 @@ flags_unshaded = false
 flags_vertex_lighting = false
 flags_transparent = false
 vertex_color_use_as_albedo = false
-albedo_color = Color(0.0130053, 0.8, 0.0, 1.0)
+albedo_color = Color(0.138926, 0.903545, 0.0, 1.0)
 subsurf_scatter_enabled = false
 
 [sub_resource id=2 type="SpatialMaterial"]
@@ -17,7 +17,7 @@ flags_unshaded = false
 flags_vertex_lighting = false
 flags_transparent = false
 vertex_color_use_as_albedo = false
-albedo_color = Color(0.8, 0.8, 0.8, 1.0)
+albedo_color = Color(0.903545, 0.903545, 0.903545, 1.0)
 subsurf_scatter_enabled = false
 
 [sub_resource id=3 type="ArrayMesh"]

+ 1 - 1
tests/reference_exports/material_cycle/material_cycle.escn

@@ -1012,7 +1012,7 @@ flags_unshaded = false
 flags_vertex_lighting = false
 flags_transparent = false
 vertex_color_use_as_albedo = false
-albedo_color = Color(0.49, 0.49, 0.49, 1.0)
+albedo_color = Color(0.723069, 0.723069, 0.723069, 1.0)
 subsurf_scatter_enabled = false
 
 [sub_resource id=40 type="ArrayMesh"]

File diff suppressed because it is too large
+ 2 - 13
tests/reference_exports/scene_animation/animation_parented_objects.escn


+ 2 - 2
tests/reference_exports/shape_key/shapekey_with_multi_surface.escn

@@ -7,7 +7,7 @@ flags_unshaded = false
 flags_vertex_lighting = false
 flags_transparent = false
 vertex_color_use_as_albedo = false
-albedo_color = Color(0.143281, 0.435513, 0.8, 1.0)
+albedo_color = Color(0.413475, 0.685345, 0.903545, 1.0)
 subsurf_scatter_enabled = false
 
 [sub_resource id=2 type="SpatialMaterial"]
@@ -17,7 +17,7 @@ flags_unshaded = false
 flags_vertex_lighting = false
 flags_transparent = false
 vertex_color_use_as_albedo = false
-albedo_color = Color(0.108666, 0.8, 0.0534792, 1.0)
+albedo_color = Color(0.364638, 0.903545, 0.264181, 1.0)
 subsurf_scatter_enabled = false
 
 [sub_resource id=3 type="ArrayMesh"]

BIN
tests/test_scenes/action_animation/animation_object_transform.blend


BIN
tests/test_scenes/action_animation/animation_rotation_euler.blend


BIN
tests/test_scenes/action_animation/animation_shared_action.blend


BIN
tests/test_scenes/armature/just_armature.blend


BIN
tests/test_scenes/camera/animation_camera.blend


BIN
tests/test_scenes/duplicate_name.blend


BIN
tests/test_scenes/scene_animation/animation_parented_objects.blend


Some files were not shown because too many files changed in this diff