Explorar el Código

Fix 2 Bugs with Custom Parameters
update error for Bool Parameter and operator not showing
up to remove property until at least two properties exist

Joseph Brandenburg hace 1 año
padre
commit
16f2f568aa
Se han modificado 3 ficheros con 9 adiciones y 2 borrados
  1. 1 0
      socket_definitions.py
  2. 7 1
      xForm_containers.py
  3. 1 1
      xForm_definitions.py

+ 1 - 0
socket_definitions.py

@@ -214,6 +214,7 @@ def default_update(socket, context, do_execute=True):
                 node_tree.execute_tree(context)
             except Exception as e:
                 prRed("Automatic Tree Execution failed because of %s" % e)
+                prRed(e.with_traceback())
 
 
 def update_socket(self, context,):

+ 7 - 1
xForm_containers.py

@@ -492,7 +492,7 @@ class xFormBone:
                             soft_min = inp.soft_min,
                             soft_max = inp.soft_max,)
                             
-                for num_type in ['Int', 'Bool']:
+                for num_type in ['Int']:
                     # for some reason the types don't cast implicitly
                     if num_type in inp.bl_idname:
                         ui_data.update(
@@ -500,6 +500,12 @@ class xFormBone:
                             max = int(inp.max),
                             soft_min = int(inp.soft_min),
                             soft_max = int(inp.soft_max),)
+                for bool_type in ['Bool']:
+                    # for some reason the types don't cast implicitly
+                    if bool_type in inp.bl_idname:
+                        # prPurple(ui_data.update.__text_signature__)
+                        # prPurple(ui_data.update.__doc__)
+                        ui_data.update() # TODO I can't figure out what the update function expects because it isn't documented
                 # Doesn't seem to work?
                 #pb.property_overridable_library_set("["+name+"]", True)
         # Set up IK settings, these belong to the pose bone.

+ 1 - 1
xForm_definitions.py

@@ -146,7 +146,7 @@ class xFormBoneNode(Node, xFormNode):
     def draw_buttons(self, context, layout):
         layout.operator("mantis.add_custom_property", text='+Add Custom Parameter')
         # layout.label(text="Edit Parameter ... not implemented")
-        if (len(self.inputs) > self.socket_count):
+        if (len(self.inputs) >= self.socket_count):
             layout.operator("mantis.remove_custom_property", text='-Remove Custom Parameter')
         else:
             layout.label(text="")