Log In
New Account
Home My Page Projects Blender 2.x BF release
Summary Activity Tracker SCM Files

Blender 2.6 Bug Tracker: Browse

[#31843] Inserting of visual keys broken

Date:
2012-06-16 14:10
Priority:
3
State:
Closed
Submitted by:
Tobias Oelgarte (niabot)
Assigned to:
Joshua Leung (aligorith)
Category:
Animation system
Status:
Fixed / Closed
Relates to:
Duplicates:
Patches:
 
Summary:
Inserting of visual keys broken
Detailed description
Inserting visual keys like "Insert Visual Rotation" is entirely broken or gives strange results.

I appended an simple example file. Go to frame 20 and insert the "Visual Rotation" (I -> visual rot). I have q=(1.0,0,0,0) as the result, which means "no rotation" or that the constraint is ignored. Instead it should have the same rotation as the target bone which is q=(0.707,0.5,0,-0.5).

Followup

Message
  • Date: 2012-06-16 14:12
  • Sender: Tobias Oelgarte
  • PS: This applies to other variations like visual loc, locrot, etc. as well.
  • Date: 2012-06-18 08:54
  • Sender: Joshua Leung
  • Committed a fix a few days ago for the part of the problems here - Damped Track constraint was not considered for Visual Keying.

    As for whether this stuff is actually working or not anymore, I can't remember whether I eventually applied a fix which would've reverted it back to one of the original methods used. In any case, I'm close to just dismissing this as "will not fix" and putting this into a deep dark corner somewhere for when there's nothing better to be working on.
  • Date: 2012-06-18 12:55
  • Sender: Tobias Oelgarte
  • That would be sad because it is essential for IK/FK blending or for constrained/unconstrained blending. Recently i wrote a very simple python script that can do exactly that. It computes the local delta transformation (relative to the bone itself) between the bones rest pose and it's current pose with animation data and constraints applied. Shouldn't be so hard to extract the keying information from this matrix and to store it inside the bone itself.

    def visualPose(armatureName, boneName):
    bone = bpy.data.armatures[armatureName].bones[boneName]
    bone_ml = bone.matrix_local
    bone_pose = bpy.data.objects[armatureName].pose.bones[boneName]
    bone_pose_m = bone_pose.matrix

    if bone.parent:
    parent = bone.parent
    parent_ml = parent.matrix_local
    parent_pose = bone_pose.parent
    parent_pose_m = parent_pose.matrix

    object_diff = parent_ml.inverted() * bone_ml
    pose_diff = parent_pose_m.inverted() * bone_pose_m
    local_diff = object_diff.inverted() * pose_diff
    else:
    local_diff = bone_ml.inverted() * bone_pose_m
    return local_diff

  • Date: 2012-06-18 13:52
  • Sender: Sergey Sharybin
  • Joshua, what's your verdict here?
  • Date: 2013-03-07 16:06
  • Sender: Josef Meier
  • I found something:

    In \editors\animation\keyframing.c line 717 is a local redefinition of the variable tmat. In my opinion it has to be removed.

    else if (ptr->type == &RNA_PoseBone) {
    Object *ob = (Object *)ptr->id.data; /* we assume that this is always set, and is an object */
    bPoseChannel *pchan = (bPoseChannel *)ptr->data;
    // local redefinition of tmat: wrong float tmat[4][4];


    I tried it and now visual rotation is stored correctly (in my opinion) :-)

    But I'm no specialist. The solution seems to be so simple. Maybe someone can aknowledge that.
  • Date: 2013-03-07 18:19
  • Sender: Josef Meier
  • Index: keyframing.c
    ===================================================================
    --- keyframing.c (revision 55088)
    +++ keyframing.c (working copy)
    @@ -714,7 +714,6 @@
    else if (ptr->type == &RNA_PoseBone) {
    Object *ob = (Object *)ptr->id.data; /* we assume that this is always set, and is an object */
    bPoseChannel *pchan = (bPoseChannel *)ptr->data;
    - float tmat[4][4];

    /* Although it is not strictly required for this particular space conversion,
    * arg1 must not be null, as there is a null check for the other conversions to
  • Date: 2013-03-08 00:30
  • Sender: Joshua Leung
  • Hi Josef,

    Thanks for the patch (and finding the cause of the bug)! It's funny how these kind of small things can sometimes have such a big impact.

    Fix committed to svn (r.55103)

    Cheers,
    Joshua
 

Attached Files:

Name Date Download
visual-bug.blend 2012-06-16 14:10 Download

Changes:

Field Old Value Date By
status_idOpen2013-03-08 00:30aligorith
close_dateNone2013-03-08 00:30aligorith
StatusInvestigate2013-03-08 00:30aligorith
assigned_tonone2012-06-18 13:52nazgul
StatusNew2012-06-18 08:54aligorith
File Added21134: visual-bug.blend2012-06-16 14:10niabot

Changes:

Blender 2.x BF release: Blender 2.6 Bug Tracker
   [#34394] When Visual Keying is selected animating the rotation of a Bone does not save (Relation: Relates to)