Rig>Deform:Curve bones>Segment 32 (ease in 0 ease out0) ..max rotation causes this segmented bone stop rotating and flips #39491

Closed
opened 2014-03-28 19:51:26 +01:00 by yellow foxz · 11 comments

System Information
Operating system and graphics card
win 7 64bits, intel default graphic
Blender Version
Broken: (example: 2.69.7 4b206af, see splash screen)
broken very ;atest blender 2.70 official released

Short description of error
download this file..i have created.>>Bug_Deform.blend
Exact steps for others to reproduce the error
download file above....hard to explain !

**System Information** Operating system and graphics card win 7 64bits, intel default graphic **Blender Version** Broken: (example: 2.69.7 4b206af, see splash screen) broken very ;atest blender 2.70 official released **Short description of error** download this file..i have created.>>[Bug_Deform.blend](https://archive.blender.org/developer/F83256/Bug_Deform.blend) **Exact steps for others to reproduce the error** download file above....hard to explain !
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @yellowfoxz

Added subscriber: @yellowfoxz
Bastien Montagne was assigned by Sergey Sharybin 2014-04-10 19:18:02 +02:00

Added subscriber: @Sergey

Added subscriber: @Sergey

Another bone issues. Mind having a look? :)

Another bone issues. Mind having a look? :)

Added subscriber: @JoshuaLeung

Added subscriber: @JoshuaLeung

So, that small patch seems to fix that glitch (yet another '-180° to 180° gap' one).

P52: #39491

diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 3920f59..5f4beab 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -506,7 +506,7 @@ void b_bone_spline_setup(bPoseChannel *pchan, int rest, Mat4 result_array[MAX_BB
 			invert_m3_m3(imat3, mat3);
 			mul_m3_m3m3(mat3, result, imat3); /* the matrix transforming vec_roll to desired roll */
 
-			roll1 = (float)atan2(mat3- [x]- [x], mat3- [x][2]);
+			roll1 = angle_compat_rad((float)atan2(mat3- [x]- [x], mat3- [x]- [x]), pchan->prev_roll1);
 		}
 	}
 	else {
@@ -544,14 +544,14 @@ void b_bone_spline_setup(bPoseChannel *pchan, int rest, Mat4 result_array[MAX_BB
 		invert_m3_m3(imat3, mat3);
 		mul_m3_m3m3(mat3, imat3, result); /* the matrix transforming vec_roll to desired roll */
 
-		roll2 = (float)atan2(mat3- [x]- [x], mat3- [x][2]);
+		roll2 = angle_compat_rad((float)atan2(mat3- [x]- [x], mat3- [x]- [x]), pchan->prev_roll2);
 
 		/* and only now negate handle */
 		mul_v3_fl(h2, -hlength2);
 	}
 	else {
 		h2- [x] = 0.0f; h2- [x] = -hlength2; h2- [x] = 0.0f;
-		roll2 = 0.0;
+		roll2 = 0.0f;
 	}
 
 	/* make curve */
@@ -578,6 +578,9 @@ void b_bone_spline_setup(bPoseChannel *pchan, int rest, Mat4 result_array[MAX_BB
 			mul_serie_m4(result_array- [x].mat, iscalemat, result_array- [x].mat, scalemat, NULL, NULL, NULL, NULL, NULL);
 		}
 	}
+
+	pchan->prev_roll1 = roll1;
+	pchan->prev_roll2 = roll2;
 }
 
 /* ************ Armature Deform ******************* */
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index dab825c..026f75c 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -239,6 +239,10 @@ typedef struct bPoseChannel {
 	float ikrotweight;              /* weight of joint rotation constraint */
 	float iklinweight;              /* weight of joint stretch constraint */
 
+	/* For handling BBones. */
+	float prev_roll1;
+	float prev_roll2;
+
 	void        *temp;              /* use for outliner */
 } bPoseChannel;
 

Now, I’m not quite sure about it… Piling bbones + IK + other constraints leads us to lands of hyper-complications. Joshua, thoughts here?

So, that small patch seems to fix that glitch (yet another '-180° to 180° gap' one). [P52: #39491](https://archive.blender.org/developer/P52.txt) ```diff diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 3920f59..5f4beab 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -506,7 +506,7 @@ void b_bone_spline_setup(bPoseChannel *pchan, int rest, Mat4 result_array[MAX_BB invert_m3_m3(imat3, mat3); mul_m3_m3m3(mat3, result, imat3); /* the matrix transforming vec_roll to desired roll */ - roll1 = (float)atan2(mat3- [x]- [x], mat3- [x][2]); + roll1 = angle_compat_rad((float)atan2(mat3- [x]- [x], mat3- [x]- [x]), pchan->prev_roll1); } } else { @@ -544,14 +544,14 @@ void b_bone_spline_setup(bPoseChannel *pchan, int rest, Mat4 result_array[MAX_BB invert_m3_m3(imat3, mat3); mul_m3_m3m3(mat3, imat3, result); /* the matrix transforming vec_roll to desired roll */ - roll2 = (float)atan2(mat3- [x]- [x], mat3- [x][2]); + roll2 = angle_compat_rad((float)atan2(mat3- [x]- [x], mat3- [x]- [x]), pchan->prev_roll2); /* and only now negate handle */ mul_v3_fl(h2, -hlength2); } else { h2- [x] = 0.0f; h2- [x] = -hlength2; h2- [x] = 0.0f; - roll2 = 0.0; + roll2 = 0.0f; } /* make curve */ @@ -578,6 +578,9 @@ void b_bone_spline_setup(bPoseChannel *pchan, int rest, Mat4 result_array[MAX_BB mul_serie_m4(result_array- [x].mat, iscalemat, result_array- [x].mat, scalemat, NULL, NULL, NULL, NULL, NULL); } } + + pchan->prev_roll1 = roll1; + pchan->prev_roll2 = roll2; } /* ************ Armature Deform ******************* */ diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index dab825c..026f75c 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -239,6 +239,10 @@ typedef struct bPoseChannel { float ikrotweight; /* weight of joint rotation constraint */ float iklinweight; /* weight of joint stretch constraint */ + /* For handling BBones. */ + float prev_roll1; + float prev_roll2; + void *temp; /* use for outliner */ } bPoseChannel; ``` Now, I’m not quite sure about it… Piling bbones + IK + other constraints leads us to lands of hyper-complications. Joshua, thoughts here?

Added subscriber: @ideasman42

Added subscriber: @ideasman42

@mont29: relying on the previous roll seems risky, it means you can't reliably jump to a frame and be sure the pose state will the the same as when played from the beginning.

@mont29: relying on the previous roll seems risky, it means you can't reliably jump to a frame and be sure the pose state will the the same as when played from the beginning.

Yes… TBH, I would be tempted to close this as "known limitation"/TODO… Rotation handling in current constraints is really week anyway.

Yes… TBH, I would be tempted to close this as "known limitation"/TODO… Rotation handling in current constraints is really week anyway.

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

Closing as TODO (see http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Animation#Armature), pretty sure we can’t fix this in a correct way with current code…

Closing as TODO (see http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Animation#Armature), pretty sure we can’t fix this in a correct way with current code…
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
4 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#39491
No description provided.