Browse Source

Fix: Versioning for Floor, Custom Target Space

Custom Target Space hasn't been working for a long time
and it was for a really stupid reason. no one complained, I didn't know
I feel like  a dummy
anyhow the versioning code for Floor was also
missing an import
Joseph Brandenburg 1 month ago
parent
commit
2a130c3594
2 changed files with 7 additions and 7 deletions
  1. 4 3
      link_nodes.py
  2. 3 4
      versioning.py

+ 4 - 3
link_nodes.py

@@ -63,7 +63,7 @@ class MantisLinkNode(MantisNode):
         props_sockets = super().gen_property_socket_map()
         if (os := self.inputs.get("Owner Space")) and os.is_connected and os.links[0].from_node.node_type == 'XFORM':
             del props_sockets['owner_space']
-        if ts := self.inputs.get("Target_Space") and ts.is_connected and ts.links[0].from_node.node_type == 'XFORM':
+        if (ts := self.inputs.get("Target Space")) and ts.is_connected and ts.links[0].from_node.node_type == 'XFORM':
             del props_sockets['target_space']
         return props_sockets
 
@@ -77,7 +77,7 @@ class MantisLinkNode(MantisNode):
                 else:
                     c.space_object=xf
             if ts := self.inputs.get("Target_Space") and ts.is_connected and ts.links[0].from_node.node_type == 'XFORM':
-                c.owner_space='CUSTOM'
+                c.target_space='CUSTOM'
                 xf = self.inputs["Target_Space Space"].links[0].from_node.bGetObject(mode="OBJECT")
                 if isinstance(xf, Bone):
                     c.space_object=self.inputs["Target_Space Space"].links[0].from_node.bGetParentArmature(); c.space_subtarget=xf.name
@@ -885,8 +885,9 @@ class LinkShrinkWrap(MantisLinkNode):
             self.get_target_and_subtarget(c)
             if constraint_name := self.evaluate_input("Name"):
                 c.name = constraint_name
+            props_sockets = self.gen_property_socket_map()
+            print (props_sockets.keys())
             self.bObject.append(c)
             # self.set_custom_space() # this needs to be overridden for me TODO
-            props_sockets = self.gen_property_socket_map()
             evaluate_sockets(self, c, props_sockets)
         self.executed = True

+ 3 - 4
versioning.py

@@ -229,13 +229,12 @@ def up_0_12_25_replace_floor_offset_type(*args, **kwargs):
     current_sub_version = node.id_data.mantis_version[2]
     if  current_major_version > 0: return# major version must be 0
     if current_minor_version > 12: return# minor version must be 12 or less
-    if current_minor_version == 12 and current_sub_version > 24: return # sub version must be 8 or less
-    # I am having it do 8 or less because there was a bug in this function prior to 9
-    # sub version doesn't matter since any subversion of 11 should trigger this task
+    if current_minor_version == 12 and current_sub_version > 24: return 
+    from .utilities import get_socket_maps, do_relink
     socket_maps = get_socket_maps(node)
     prPurple(f"Fixing \"Offset\" socket in {node.name}")
     try:
-        offset = node.inputs("Offset")
+        offset = node.inputs["Offset"]
         node.inputs.remove(offset)
         s = node.inputs.new('FloatSocket', 'Offset',)
         node.inputs.move(len(node.inputs)-1, 2)