[Bf-blender-cvs] [b14ad9114f1] master: Fix: Mix node did not set clamp result correctly in versioning code
Charlie Jolly
noreply at git.blender.org
Sun Oct 2 01:17:27 CEST 2022
Commit: b14ad9114f1d8fb5e1f9a0ef392d49b559a5388e
Author: Charlie Jolly
Date: Sun Oct 2 00:04:30 2022 +0100
Branches: master
https://developer.blender.org/rBb14ad9114f1d8fb5e1f9a0ef392d49b559a5388e
Fix: Mix node did not set clamp result correctly in versioning code
Files were incorrectly loaded without the Clamp Result option set.
Reported in BA by CarlG
===================================================================
M source/blender/blenloader/intern/versioning_300.cc
===================================================================
diff --git a/source/blender/blenloader/intern/versioning_300.cc b/source/blender/blenloader/intern/versioning_300.cc
index 2203cf0bc9b..373d68082a6 100644
--- a/source/blender/blenloader/intern/versioning_300.cc
+++ b/source/blender/blenloader/intern/versioning_300.cc
@@ -1757,7 +1757,7 @@ static void versioning_replace_legacy_mix_rgb_node(bNodeTree *ntree)
node->type = SH_NODE_MIX;
NodeShaderMix *data = (NodeShaderMix *)MEM_callocN(sizeof(NodeShaderMix), __func__);
data->blend_type = node->custom1;
- data->clamp_result = node->custom2;
+ data->clamp_result = (node->custom2 & SHD_MIXRGB_CLAMP) ? 1 : 0;
data->clamp_factor = 1;
data->data_type = SOCK_RGBA;
data->factor_mode = NODE_MIX_MODE_UNIFORM;
More information about the Bf-blender-cvs
mailing list