Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2022-05-20 17:41:51 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-05-20 18:07:37 +0300
commitbf352df27a6f85d73bc0d6417f50fd62958cfb6e (patch)
tree9b8c7b15cf0678b53cd0858f015fb9aa3a1f5d79 /source/blender/io/usd/intern
parentd4cdae29c10768ec23c13aa585978dfeaf55baa6 (diff)
Fix wrong USD image color space export with non-default OpenColorIO config
The names of color spaces in OpenColorIO configs can be arbitrary, so don't use hardcoded names from our default config.
Diffstat (limited to 'source/blender/io/usd/intern')
-rw-r--r--source/blender/io/usd/intern/usd_writer_material.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/io/usd/intern/usd_writer_material.cc b/source/blender/io/usd/intern/usd_writer_material.cc
index 1bfc0e50f69..dd795e4f922 100644
--- a/source/blender/io/usd/intern/usd_writer_material.cc
+++ b/source/blender/io/usd/intern/usd_writer_material.cc
@@ -10,6 +10,8 @@
#include "BKE_main.h"
#include "BKE_node.h"
+#include "IMB_colormanagement.h"
+
#include "BLI_fileops.h"
#include "BLI_linklist.h"
#include "BLI_listbase.h"
@@ -414,13 +416,10 @@ static pxr::TfToken get_node_tex_image_color_space(bNode *node)
Image *ima = reinterpret_cast<Image *>(node->id);
- if (strcmp(ima->colorspace_settings.name, "Raw") == 0) {
- return usdtokens::raw;
- }
- if (strcmp(ima->colorspace_settings.name, "Non-Color") == 0) {
+ if (IMB_colormanagement_space_name_is_data(ima->colorspace_settings.name)) {
return usdtokens::raw;
}
- if (strcmp(ima->colorspace_settings.name, "sRGB") == 0) {
+ if (IMB_colormanagement_space_name_is_srgb(ima->colorspace_settings.name)) {
return usdtokens::sRGB;
}