Fix #103912: Node wrangler adds legacy mix nodes #104425

Merged
Jacques Lucke merged 1 commits from wannes.malfait/blender-addons:nw_legacy_mix_nodes into blender-v3.5-release 2023-02-20 12:15:08 +01:00
Showing only changes of commit 4aebaf414b - Show all commits

View File

@ -2020,7 +2020,7 @@ class NWMergeNodes(Operator, NWBase):
mode = 'MIX' mode = 'MIX'
if (merge_type != 'MATH' and merge_type != 'GEOMETRY') and tree_type == 'GEOMETRY': if (merge_type != 'MATH' and merge_type != 'GEOMETRY') and tree_type == 'GEOMETRY':
merge_type = 'AUTO' merge_type = 'AUTO'
# The MixRGB node and math nodes used for geometry nodes are of type 'ShaderNode' # The Mix node and math nodes used for geometry nodes are of type 'ShaderNode'
if (merge_type == 'MATH' or merge_type == 'MIX') and tree_type == 'GEOMETRY': if (merge_type == 'MATH' or merge_type == 'MIX') and tree_type == 'GEOMETRY':
node_type = 'ShaderNode' node_type = 'ShaderNode'
selected_mix = [] # entry = [index, loc] selected_mix = [] # entry = [index, loc]
@ -2119,8 +2119,13 @@ class NWMergeNodes(Operator, NWBase):
was_multi = False was_multi = False
for i in range(the_range): for i in range(the_range):
if nodes_list == selected_mix: if nodes_list == selected_mix:
add_type = node_type + 'MixRGB' mix_name = 'Mix'
if tree_type == 'COMPOSITING':
mix_name = 'MixRGB'
add_type = node_type + mix_name
add = nodes.new(add_type) add = nodes.new(add_type)
if tree_type != 'COMPOSITING':
add.data_type = 'RGBA'
add.blend_type = mode add.blend_type = mode
if mode != 'MIX': if mode != 'MIX':
add.inputs[0].default_value = 1.0 add.inputs[0].default_value = 1.0
@ -2128,6 +2133,9 @@ class NWMergeNodes(Operator, NWBase):
add.hide = do_hide add.hide = do_hide
if do_hide: if do_hide:
loc_y = loc_y - 50 loc_y = loc_y - 50
first = 6
second = 7
if tree_type == 'COMPOSITING':
first = 1 first = 1
second = 2 second = 2
add.width_hidden = 100.0 add.width_hidden = 100.0