Loop of Bones, each with a "Locked Track" Constraint, results in one bone bugging out #95466

Closed
opened 2022-02-03 11:50:18 +01:00 by Robert Schultz · 9 comments

System Information
Operating system:
Graphics card:

Blender Version
Broken: 3.01

I have an armature with several bones, with each bone having no parent. Each of these bones has a "Locked Track" constraint such that it is looking at the bone ahead of it, forming a loop. The bones also have the "follow path" constraint and are animated around some curve. What happens is that one of the bones always shows some strange behavior when time is moved forwards or backwards. Dragging the timeline back and forth results in it momentarily misaligning from pointing at the bone ahead of it, but then it realigns a split second later. However, if I then alt+scroll to move time, the bugged bone remains in it's misaligned state, at least until I drag the timeline again, and then it realigns.

On the python side of things, this buggy behavior carries over. Using bpy.context.scene.frame_set(), and then taking the bone's matrix data for export, gives the misaligned position/rotation. And it's only when I call bpy.context.scene.frame_set() a second time that it gives the correct aligned position/rotation.
So to be clear, this is what I have to do to go the next frame and not have it result in the wrong output:

bpy.context.scene.frame_set(frame_num)
bpy.context.scene.frame_set(frame_num)

Exact steps for others to reproduce the error
Here's a blender file with a simple set up of 6 bones animating around a circular bezier curve:
Looped Locked Track Bug Example.blend
I've named the problematic bone "Bugged Bone".

**System Information** Operating system: Graphics card: **Blender Version** Broken: 3.01 I have an armature with several bones, with each bone having no parent. Each of these bones has a "Locked Track" constraint such that it is looking at the bone ahead of it, forming a loop. The bones also have the "follow path" constraint and are animated around some curve. What happens is that one of the bones always shows some strange behavior when time is moved forwards or backwards. Dragging the timeline back and forth results in it momentarily misaligning from pointing at the bone ahead of it, but then it realigns a split second later. However, if I then alt+scroll to move time, the bugged bone remains in it's misaligned state, at least until I drag the timeline again, and then it realigns. On the python side of things, this buggy behavior carries over. Using bpy.context.scene.frame_set(), and then taking the bone's matrix data for export, gives the misaligned position/rotation. And it's only when I call bpy.context.scene.frame_set() a second time that it gives the correct aligned position/rotation. So to be clear, this is what I have to do to go the next frame and not have it result in the wrong output: ``` bpy.context.scene.frame_set(frame_num) bpy.context.scene.frame_set(frame_num) ``` **Exact steps for others to reproduce the error** Here's a blender file with a simple set up of 6 bones animating around a circular bezier curve: [Looped Locked Track Bug Example.blend](https://archive.blender.org/developer/F12843454/Looped_Locked_Track_Bug_Example.blend) I've named the problematic bone "Bugged Bone".
Author

Added subscriber: @Robert-Schultz

Added subscriber: @Robert-Schultz
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Archived'

Changed status from 'Needs Triage' to: 'Archived'
Member

This is a dependecy cycle:

Dependency cycle detected:
  OBArmature With Bugged Bone/Bugged Bone/BONE_CONSTRAINTS() depends on
  OBArmature With Bugged Bone/Bone1/BONE_DONE() via 'Locked Track'
  OBArmature With Bugged Bone/Bone1/BONE_READY() via 'Ready -> Done'
  OBArmature With Bugged Bone/Bone1/BONE_CONSTRAINTS() via 'Constraints -> Ready'
  OBArmature With Bugged Bone/Bone2/BONE_DONE() via 'Locked Track'
  OBArmature With Bugged Bone/Bone2/BONE_READY() via 'Ready -> Done'
  OBArmature With Bugged Bone/Bone2/BONE_CONSTRAINTS() via 'Constraints -> Ready'
  OBArmature With Bugged Bone/Bone3/BONE_DONE() via 'Locked Track'
  OBArmature With Bugged Bone/Bone3/BONE_READY() via 'Ready -> Done'
  OBArmature With Bugged Bone/Bone3/BONE_CONSTRAINTS() via 'Constraints -> Ready'
  OBArmature With Bugged Bone/Bone4/BONE_DONE() via 'Locked Track'
  OBArmature With Bugged Bone/Bone4/BONE_READY() via 'Ready -> Done'
  OBArmature With Bugged Bone/Bone4/BONE_CONSTRAINTS() via 'Constraints -> Ready'
  OBArmature With Bugged Bone/Bone5/BONE_DONE() via 'Locked Track'
  OBArmature With Bugged Bone/Bone5/BONE_READY() via 'Ready -> Done'
  OBArmature With Bugged Bone/Bone5/BONE_CONSTRAINTS() via 'Constraints -> Ready'
  OBArmature With Bugged Bone/Bugged Bone/BONE_DONE() via 'Locked Track'
  OBArmature With Bugged Bone/Bugged Bone/BONE_READY() via 'Ready -> Done'
  OBArmature With Bugged Bone/Bugged Bone/BONE_CONSTRAINTS() via 'Constraints -> Ready'
Detected 1 dependency cycles

So in essence that bugged bone cannot be evaluated properly because its transform depends on itself...
Those dependency cycles usually show in symptoms like you described : one-frame delays, weird behavior when hopping to startframe etc.

Dependency cycles are not bugs though, please come up with another way to rig this.
Will close.

This is a dependecy cycle: ``` Dependency cycle detected: OBArmature With Bugged Bone/Bugged Bone/BONE_CONSTRAINTS() depends on OBArmature With Bugged Bone/Bone1/BONE_DONE() via 'Locked Track' OBArmature With Bugged Bone/Bone1/BONE_READY() via 'Ready -> Done' OBArmature With Bugged Bone/Bone1/BONE_CONSTRAINTS() via 'Constraints -> Ready' OBArmature With Bugged Bone/Bone2/BONE_DONE() via 'Locked Track' OBArmature With Bugged Bone/Bone2/BONE_READY() via 'Ready -> Done' OBArmature With Bugged Bone/Bone2/BONE_CONSTRAINTS() via 'Constraints -> Ready' OBArmature With Bugged Bone/Bone3/BONE_DONE() via 'Locked Track' OBArmature With Bugged Bone/Bone3/BONE_READY() via 'Ready -> Done' OBArmature With Bugged Bone/Bone3/BONE_CONSTRAINTS() via 'Constraints -> Ready' OBArmature With Bugged Bone/Bone4/BONE_DONE() via 'Locked Track' OBArmature With Bugged Bone/Bone4/BONE_READY() via 'Ready -> Done' OBArmature With Bugged Bone/Bone4/BONE_CONSTRAINTS() via 'Constraints -> Ready' OBArmature With Bugged Bone/Bone5/BONE_DONE() via 'Locked Track' OBArmature With Bugged Bone/Bone5/BONE_READY() via 'Ready -> Done' OBArmature With Bugged Bone/Bone5/BONE_CONSTRAINTS() via 'Constraints -> Ready' OBArmature With Bugged Bone/Bugged Bone/BONE_DONE() via 'Locked Track' OBArmature With Bugged Bone/Bugged Bone/BONE_READY() via 'Ready -> Done' OBArmature With Bugged Bone/Bugged Bone/BONE_CONSTRAINTS() via 'Constraints -> Ready' Detected 1 dependency cycles ``` So in essence that bugged bone cannot be evaluated properly because its transform depends on itself... Those dependency cycles usually show in symptoms like you described : one-frame delays, weird behavior when hopping to startframe etc. Dependency cycles are not bugs though, please come up with another way to rig this. Will close.
Author

But I can arrive at the correct solution by doing:

bpy.context.scene.frame_set(frame_num)
bpy.context.scene.frame_set(frame_num)

Seems unnecessary to shut down this issue so readily, when the solution is right there.

I think what I'm arguing is that that this shouldn't be considered a dependency cycle, even if whatever you've posted there says it is. Call that a false positive or whatever.

At each frame each bone is rotated to "look at" the position of the bone ahead of it, so there shouldn't be any problems, no? Like the rotation of bone_1 depends on the position of bone_2, and so on down the line, so where exactly is the cycle in dependency?

But I can arrive at the correct solution by doing: ``` bpy.context.scene.frame_set(frame_num) bpy.context.scene.frame_set(frame_num) ``` Seems unnecessary to shut down this issue so readily, when the solution is right there. I think what I'm arguing is that that this shouldn't be considered a dependency cycle, even if whatever you've posted there says it is. Call that a false positive or whatever. At each frame each bone is rotated to "look at" the position of the bone ahead of it, so there shouldn't be any problems, no? Like the *rotation* of bone_1 depends on the *position* of bone_2, and so on down the line, so where exactly is the cycle in dependency?
Member

This is because you are evaluating twice then (which gets rid of the one-frame delay).
It is not suitable to evaluate twice generally (since this would ruin performance).

This is because you are evaluating twice then (which gets rid of the one-frame delay). It is not suitable to evaluate twice generally (since this would ruin performance).
Author

Right, but what I'm getting at is the existence of some underlying shortcut or optimization, not that Blender should literally do my work-around.

Right, but what I'm getting at is the existence of some underlying shortcut or optimization, not that Blender should *literally* do my work-around.
Member

In #95466#1300913, @Robert-Schultz wrote:
I think what I'm arguing is that that this shouldn't be considered a dependency cycle, even if whatever you've posted there says it is. Call that a false positive or whatever.

At each frame each bone is rotated to "look at" the position of the bone ahead of it, so there shouldn't be any problems, no? Like the rotation of bone_1 depends on the position of bone_2, and so on down the line, so where exactly is the cycle in dependency?

In this particular case, yes, rotation is dependent on position (and in your particular case this could solve properly because position is not actually constrained), but the dependency graph is not fine-grained enough to distinguish translations and rotations. So there are other constraint-setups which indeed would be unsolvable (when position would also be affected in the chain).

In #95466#1300940, @Robert-Schultz wrote:
Right, but what I'm getting at is the existence of some underlying shortcut or optimization, not that Blender should literally do my work-around.

Not sure I understand. You are requesting the optimization if I read this correctly? If the dependency graph would be more fine-grained this could indeed be optimized, but this would then really be a feature request (and not a bug in the current behavior)

> In #95466#1300913, @Robert-Schultz wrote: > I think what I'm arguing is that that this shouldn't be considered a dependency cycle, even if whatever you've posted there says it is. Call that a false positive or whatever. > > At each frame each bone is rotated to "look at" the position of the bone ahead of it, so there shouldn't be any problems, no? Like the *rotation* of bone_1 depends on the *position* of bone_2, and so on down the line, so where exactly is the cycle in dependency? In this particular case, yes, rotation is dependent on position (and in your particular case this *could* solve properly because position is not actually constrained), but the dependency graph is not fine-grained enough to distinguish translations and rotations. So there are other constraint-setups which indeed would be unsolvable (when position would also be affected in the chain). > In #95466#1300940, @Robert-Schultz wrote: > Right, but what I'm getting at is the existence of some underlying shortcut or optimization, not that Blender should *literally* do my work-around. Not sure I understand. You are requesting the optimization if I read this correctly? If the dependency graph would be more fine-grained this could indeed be optimized, but this would then really be a feature request (and not a bug in the current behavior)
Author

I am satisfied, thank you for your response and time, good luck!

I am satisfied, thank you for your response and time, good luck!
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#95466
No description provided.