diff options
Diffstat (limited to 'source/blender')
6 files changed, 16 insertions, 8 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c index 930ebb78b46..88515d849bc 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c @@ -109,7 +109,7 @@ static void reduce_stroke_points(bGPdata *gpd, const int points_num, const eBuildGpencil_Transition transition) { - if (points_num == 0) { + if ((points_num == 0) || (gps->points == NULL)) { clear_stroke(gpf, gps); return; } diff --git a/source/blender/imbuf/IMB_colormanagement.h b/source/blender/imbuf/IMB_colormanagement.h index 97030d44047..1f0ed4cafbe 100644 --- a/source/blender/imbuf/IMB_colormanagement.h +++ b/source/blender/imbuf/IMB_colormanagement.h @@ -54,6 +54,7 @@ bool IMB_colormanagement_space_is_scene_linear(struct ColorSpace *colorspace); bool IMB_colormanagement_space_is_srgb(struct ColorSpace *colorspace); bool IMB_colormanagement_space_name_is_data(const char *name); bool IMB_colormanagement_space_name_is_scene_linear(const char *name); +bool IMB_colormanagement_space_name_is_srgb(const char *name); /** * Convert a float RGB triplet to the correct luminance weighted average. diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c index 1613595148b..d2ede758023 100644 --- a/source/blender/imbuf/intern/colormanagement.c +++ b/source/blender/imbuf/intern/colormanagement.c @@ -1412,6 +1412,12 @@ bool IMB_colormanagement_space_name_is_scene_linear(const char *name) return (colorspace && IMB_colormanagement_space_is_scene_linear(colorspace)); } +bool IMB_colormanagement_space_name_is_srgb(const char *name) +{ + ColorSpace *colorspace = colormanage_colorspace_get_named(name); + return (colorspace && IMB_colormanagement_space_is_srgb(colorspace)); +} + const float *IMB_colormanagement_get_xyz_to_rgb() { return &imbuf_xyz_to_rgb[0][0]; diff --git a/source/blender/io/usd/CMakeLists.txt b/source/blender/io/usd/CMakeLists.txt index 7a7c95b29f9..1205ae74e6f 100644 --- a/source/blender/io/usd/CMakeLists.txt +++ b/source/blender/io/usd/CMakeLists.txt @@ -43,6 +43,7 @@ set(INC ../../bmesh ../../depsgraph ../../editors/include + ../../imbuf ../../makesdna ../../makesrna ../../windowmanager @@ -114,6 +115,7 @@ set(SRC set(LIB bf_blenkernel bf_blenlib + bf_imbuf bf_io_common ) diff --git a/source/blender/io/usd/intern/usd_writer_material.cc b/source/blender/io/usd/intern/usd_writer_material.cc index a24877a20bd..857896b9330 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; } diff --git a/source/blender/nodes/composite/nodes/node_composite_map_range.cc b/source/blender/nodes/composite/nodes/node_composite_map_range.cc index 9b88e99060c..e52c6d096b9 100644 --- a/source/blender/nodes/composite/nodes/node_composite_map_range.cc +++ b/source/blender/nodes/composite/nodes/node_composite_map_range.cc @@ -18,9 +18,9 @@ static void cmp_node_map_range_declare(NodeDeclarationBuilder &b) { b.add_input<decl::Float>(N_("Value")).default_value(1.0f).min(0.0f).max(1.0f); b.add_input<decl::Float>(N_("From Min")).default_value(0.0f).min(-10000.0f).max(10000.0f); - b.add_input<decl::Float>(N_("From Max")).default_value(0.0f).min(-10000.0f).max(10000.0f); + b.add_input<decl::Float>(N_("From Max")).default_value(1.0f).min(-10000.0f).max(10000.0f); b.add_input<decl::Float>(N_("To Min")).default_value(0.0f).min(-10000.0f).max(10000.0f); - b.add_input<decl::Float>(N_("To Max")).default_value(0.0f).min(-10000.0f).max(10000.0f); + b.add_input<decl::Float>(N_("To Max")).default_value(1.0f).min(-10000.0f).max(10000.0f); b.add_output<decl::Float>(N_("Value")); } |