Procházet zdrojové kódy

Fix: hide/mute caused TypeError when not Bool

Blender really should be casting them implicitly here but it wasn't, so I hacked in an explicit cast. I'm not in love with this solution.
Joseph Brandenburg před 8 měsíci
rodič
revize
1681be94b2
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      node_container_common.py

+ 3 - 1
node_container_common.py

@@ -480,7 +480,9 @@ def evaluate_sockets(nc, c, props_sockets):
             else:                    # 'mute' is better than 'enabled'
                 # UGLY HACK          # because it is available in older
                 if (prop == 'mute'): # Blenders.
-                    safe_setattr(c, prop, not nc.evaluate_input(sock))
+                    safe_setattr(c, prop, not bool(nc.evaluate_input(sock)))
+                elif (prop == 'hide'): # this will not cast it for me, annoying.
+                    safe_setattr(c, prop, bool(nc.evaluate_input(sock)))
                 else:
                     try:
                         # prRed(c.name, nc, prop, nc.evaluate_input(sock) )