0
$\begingroup$

I gather transformation matrices from different frames from an existing animation, these look different from different frames so it should be getting different matrices.

0 1 <Matrix 4x4 (-0.2682, 0.0946, 0.9587, 0.0826) ( 0.9129, -0.2929, 0.2843, -0.0179) ( 0.3077, 0.9515, -0.0078, 1.1148) ( 0.0000, 0.0000, 0.0000, 1.0000)>

0 2 <Matrix 4x4 (-0.2897, -0.0161, 0.9570, 0.0955) ( 0.9472, -0.1484, 0.2843, -0.0579) ( 0.1374, 0.9888, 0.0582, 1.2448) ( 0.0000, 0.0000, 0.0000, 1.0000)> 14 1 <Matrix 4x4 (-0.3268, 0.0632, 0.9430, 0.0797) ( 0.9379, -0.1011, 0.3318, 0.0645) ( 0.1163, 0.9929, -0.0262, 1.1392) ( 0.0000, 0.0000, 0.0000, 1.0000)>

14 2 <Matrix 4x4 (-0.3418, -0.0561, 0.9381, 0.0884) ( 0.9380, 0.0413, 0.3443, 0.0507) (-0.0581, 0.9976, 0.0385, 1.2749) ( 0.0000, 0.0000, 0.0000, 1.0000)>

the first number is the frame and the second is the bone. Same bone at different frames have different values. These are used to transform another skeleton at in a loop that alters the timeline and inserts keyframes. But even after keys are on the bones the skeleton doesn't move when animation is played.

for frameIndex, frame in enumerate(sourceKeys):
        bpy.context.scene.frame_set(frame)
        for boneIndex, bone in enumerate(sourceBoneNameList):
        
         Here I alter the bones



        targetPoseBoneList[boneIndex].keyframe_insert(data_path="location", frame=frame)
            
        targetPoseBoneList[boneIndex].keyframe_insert(data_path="rotation_quaternion", 
        frame=frame)

The bones have keys when I look in pose mode but they don't show when I look at the skeleton object.

UPDATE Here are two images, the first I key locrotscale on all bones, in the second i have moved the head bone and repeat the same thing. But when going through the timeline nothing changes?

skeleton

skeleton

$\endgroup$
3
  • $\begingroup$ Without knowing what the enumerate is actually returning, I would guess that your calls to keyframe_insert are using frame when they need to use a frame number, maybe frameIndex. If that's not it your problem is likely in the code that you omitted and replaced with "Here I alter the bones". There's no way to help you without knowing the type of sourceKeys and what goes on in the missing code. $\endgroup$ Jun 13, 2022 at 0:23
  • $\begingroup$ I'm thinking I am keying the wrong thing, right now they end up on the posebones but nothing is shown in the skeleton. $\endgroup$
    – Emil
    Jun 13, 2022 at 10:30
  • $\begingroup$ I tried moving the bones and keying manually now but I get the same result, nothing happens when I play the animation despite there being keys on different frames and the bones being in different places. $\endgroup$
    – Emil
    Jun 13, 2022 at 11:06

1 Answer 1

0
$\begingroup$

I have to use pose mode instead of edit mode instead somehow.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .