Browse Source

Fix: PointerProperty socket data lost when grouping

caused by callus disregard for accessing the data from Python.
it was only causing a problem in EnumCurveSocket, but I did the fix for it and EnumMetaRigSocket.
I tested to ensure it worked either way.
probably I have some special code for MetaRigSocket importing, that's OK.
Joseph Brandenburg 7 months ago
parent
commit
80e42fde71
1 changed files with 12 additions and 2 deletions
  1. 12 2
      socket_definitions.py

+ 12 - 2
socket_definitions.py

@@ -996,7 +996,12 @@ class EnumMetaRigSocket(MantisSocket):
             return self.search_prop.name
         return ""
     
-    default_value  : StringProperty(name = "", get=get_default_value)
+    def set_default_value(self, value):
+        if ob:= bpy.data.objects.get(value):
+            if ob.type == 'ARMATURE':
+                self.search_prop=ob
+    
+    default_value  : StringProperty(name = "", get=get_default_value, set=set_default_value)
     
     color_simple = cString
     color : bpy.props.FloatVectorProperty(default=cString, size=4)
@@ -1034,7 +1039,12 @@ class EnumCurveSocket(MantisSocket):
             return self.search_prop.name
         return ""
     
-    default_value  : StringProperty(name = "", get=get_default_value)
+    def set_default_value(self, value):
+        if ob:= bpy.data.objects.get(value):
+            if ob.type == 'CURVE':
+                self.search_prop=ob
+    
+    default_value  : StringProperty(name = "", get=get_default_value, set=set_default_value)
     
     color_simple = cString
     color : bpy.props.FloatVectorProperty(default=cString, size=4)