소스 검색

fix: unbound local error when updating group interface

Joseph Brandenburg 3 주 전
부모
커밋
3c0e191b5f
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      utilities.py

+ 3 - 1
utilities.py

@@ -271,6 +271,7 @@ def update_interface(interface, name, in_out, sock_type, parent_name):
 def relink_socket_map_add_socket(node, socket_collection, item, in_out=None,):
     from bpy.app import version as bpy_version
     if not in_out: in_out=item.in_out
+    multi=False
     if hasattr(item, 'is_array'):
         multi = item.is_array
     if node.bl_idname in ['MantisSchemaGroup'] and item.parent and item.parent.name == 'Array':
@@ -282,7 +283,8 @@ def relink_socket_map_add_socket(node, socket_collection, item, in_out=None,):
         s = socket_add_workaround_for_4_5_0_LTS(item, socket_collection, multi)
     else:
         s = socket_collection.new(type=item.bl_socket_idname, name=item.name, identifier=item.identifier,  use_multi_input=multi)
-    if hasattr(s, 'default_value'):
+    if hasattr(s, 'default_value') and hasattr(s, 'valid_interface_type') and \
+          s.valid_interface_type == True:
         from bpy.types import bpy_prop_array
         from mathutils import Vector
         default_value = 'REPORT BUG ON GITLAB' # default to bug string