Page MenuHome

Spline IK `joint_bindings` parameter is broken
Closed, ResolvedPublicBUG


System Information
Operating system: Linux-5.4.0-48-generic-x86_64-with-debian-bullseye-sid 64 Bits
Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 450.80.02

Blender Version
Broken: version: 2.92.0 Alpha, branch: master
Worked: (Seems to work in 2.79, is broken in 2.90.1. I assume 2.80 is where it broke)

Short description of error
The Spline IK constraint has a parameter, joint_bindings that tells the constraint where along the curve to place the joints.
However, this parameter is undefined or at least empty until the user applies the pose.
If the user attempts to access the parameter before the pose is applied, there will be an IndexError. (Alternatively, the parameter can be set from Python and it will then behave normally).
If the user makes Blender re-calculate these bindings (by changing the chain_length parameter through the constraint for example), and attempts to assign or read the property by index, there will be a Crash To Desktop.
(I've never heard of anyone using this feature. The manual doesn't even say how; I'm only using it because I am trying to fix a bug in Spline IK and it was useful for testing an idea.)

Exact steps for others to reproduce the error

  • Open attached file (there is a bone with Spline IK constraint)
  • Go to python console
  • Type C.active_pose_bone.constraints[0].joint_bindings[:] (Note that the result is an empty tuple - Bug! If you query the first index, there will be an index error).
  • Apply the pose with Ctrl-A "Apply Pose as Rest Pose".
  • Attempt to query the property again: C.active_pose_bone.constraints[0].joint_bindings[:]. It will produce correct results (in my example, it should be [1.0, 0.0]).

Steps for Crash To Desktop

  • In the Bone Constraints Panel, change the chain length back and forth.
  • Attempt to query the property again: C.active_pose_bone.constraints[0].joint_bindings[0]

(An aside: it would be nice to change this property to be reversed in order, it's annoying to list(reverse(new_bindings)) when setting it!)
Thanks 😃

Event Timeline

Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Confirmed.Dec 2 2020, 3:18 PM
Germano Cavalcante (mano-wii) updated the task description. (Show Details)
Germano Cavalcante (mano-wii) changed the subtype of this task from "Report" to "Bug".

Thanks for the report. I can confirm.

Thanks for confirming -- I might fix this one in the process of fixing T81704, since I have to touch the joint binding code to fix that one, too. I'll try to remember to poke if it's out of my depth.