diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-02-07 21:04:52 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-02-07 21:04:52 +0300 |
commit | 5bf477b14fe6f2093c3cb1752bffe55fac9cd563 (patch) | |
tree | e145707827c5adb8ff989d296fdec80cfb07037e /io_scene_gltf2/blender/exp/gltf2_blender_extract.py | |
parent | 9c7fb7e2ca052ca18fe24b69c040832882c00535 (diff) |
glTF importer: Fix vertex color import
glTF stores vertexcolor data in linear, blender in sRGB
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_extract.py')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_extract.py | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_extract.py b/io_scene_gltf2/blender/exp/gltf2_blender_extract.py index 88932e5b..fb3c714b 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_extract.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_extract.py @@ -21,6 +21,7 @@ from mathutils.geometry import tessellate_polygon from . import gltf2_blender_export_keys from ...io.com.gltf2_io_debug import print_console +from ...io.com.gltf2_io_color_management import color_srgb_to_scene_linear from io_scene_gltf2.blender.exp import gltf2_blender_gather_skins # @@ -113,19 +114,6 @@ def decompose_transition(matrix, context, export_settings): return translation, rotation, scale - -def color_srgb_to_scene_linear(c): - """ - Convert from sRGB to scene linear color space. - - Source: Cycles addon implementation, node_color.h. - """ - if c < 0.04045: - return 0.0 if c < 0.0 else c * (1.0 / 12.92) - else: - return pow((c + 0.055) * (1.0 / 1.055), 2.4) - - def extract_primitive_floor(a, indices, use_tangents): """Shift indices, that the first one starts with 0. It is assumed, that the indices are packed.""" attributes = { |