Browse Source

fix: rename sockets fails for property changes

this is because of the simple assumption that it actually renames
the sockets, but sometimes it just changes socket type or multi input
and in the future, who knows what else?
Joseph Brandenburg 3 tháng trước cách đây
mục cha
commit
f49a70b873
1 tập tin đã thay đổi với 2 bổ sung3 xóa
  1. 2 3
      __init__.py

+ 2 - 3
__init__.py

@@ -314,9 +314,8 @@ def do_version_update(node_tree):
                 s = n.inputs.new(new_bl_idname, new_name, identifier=new_name, use_multi_input=multi)
                 n.inputs.move(len(n.inputs)-1, socket_index)
                 socket_map = socket_maps[0]
-
-            socket_map[new_name] = socket_map[old_id]; del socket_map[old_id]
-
+            socket_map[new_name] = socket_map[old_id]
+            if new_name != old_id: del socket_map[old_id] # sometimes rename just changes the socket type or multi
             do_relink(n, s, socket_map)
         for bl_idname, task in versioning_node_tasks:
             if n.bl_idname in bl_idname: task(n)