Эх сурвалжийг харах

Fix: restore Bone Hide in Blender <4.5

my fix for >=5.0 broke things, oops
Joseph Brandenburg 1 сар өмнө
parent
commit
33336dc39f
2 өөрчлөгдсөн 4 нэмэгдсэн , 14 устгасан
  1. 1 1
      node_common.py
  2. 3 13
      xForm_nodes.py

+ 1 - 1
node_common.py

@@ -293,7 +293,7 @@ def finish_driver(mantis_node, b_object, driver_item, prop):
             # NOTE: VERSIONING in Blender 5.0 we have to use pose bone for this, too.
             if bpy_version <= (5,0,0) and prop  == 'hide': # older blendders, we need the bone
                 bone_col = mantis_node.bGetParentArmature().data.bones
-            if prop  == 'show_wire': # TODO check if the bug that forced the above affects this
+            elif prop  == 'show_wire': # TODO check if the bug that forced the above affects this
                 bone_col = mantis_node.bGetParentArmature().data.bones
             else:
                 bone_col = mantis_node.bGetParentArmature().pose.bones

+ 3 - 13
xForm_nodes.py

@@ -456,13 +456,6 @@ class xFormBone(xFormNode):
         if rotation_mode == "AUTO": rotation_mode = "XYZ"
         pb.rotation_mode = rotation_mode
         pb.id_properties_clear()
-        # these are kept around unless explicitly deleted.
-        # from .utilities import get_ui_node
-        # np = get_ui_node(self.signature, self.base_tree)
-        driver = None
-        do_prints=False
-
-        # custom properties
         self.setup_custom_props(pb, "Custom Properties")
 
         if (pb.is_in_ik_chain):
@@ -520,10 +513,10 @@ class xFormBone(xFormNode):
             'custom_shape_translation'    : ("Custom Object Translation",  (0.0,0.0,0.0) ),
             'custom_shape_rotation_euler' : ("Custom Object Rotation",  (0.0,0.0,0.0) ),
             'use_custom_shape_bone_size'  : ("Custom Object Scale to Bone Length",  True,),
-            # in 5.0.0 and newer I have to do pose bone also. Irritating.
-            # it doesn't hurt to do it in all versions.
-            'hide'                        : ("Hide", False),
         }
+        # in 5.0.0 and newer I have to do pose bone, this is an error in < 5.0
+        if bpy_version >=(5,0,0):
+            props_sockets['hide'] = ("Hide", False)
 
         evaluate_sockets(self, pb, props_sockets)
 
@@ -535,9 +528,6 @@ class xFormBone(xFormNode):
         }
         evaluate_sockets(self, pb.bone, props_sockets)
 
-
-        if (driver):
-            pass
         # whatever I was doing there.... was stupid. CLEAN UP TODO
         # this is the right thing to do.
         finish_drivers(self)