Browse Source

fix: node update broken due

this one was because I was trying to use dict-getters on node sockets.
I have no idea why I ever thought that was a good idea, it was
probably just an accident
anyhow I changed it to getattr.
I don't know how this section of code ever worked. I'm amazed that it did
Joseph Brandenburg 6 months ago
parent
commit
8c33eb0c91
1 changed files with 5 additions and 2 deletions
  1. 5 2
      utilities.py

+ 5 - 2
utilities.py

@@ -96,10 +96,13 @@ def get_socket_maps(node):
                 map[sock.identifier]=[ getattr(l, link) for l in sock.links ]
             elif hasattr(sock, "default_value"):
                 try:
-                    val = sock["default_value"]
+                    val = getattr(sock, 'default_value')
+                    from bpy import types
+                    if isinstance(val, types.bpy_struct):
+                        print (val)
                     if val is None:
                         raise RuntimeError(f"ERROR: Could not get socket data for socket of type: {sock.bl_idname}")
-                    map[sock.identifier]=sock["default_value"]
+                    map[sock.identifier]=val
                 except KeyError: # The node socket is not initialized yet.
                     return None
             else: