0
$\begingroup$

This may be hard to explain, but I've had this problem for quite a long time now.

I have 2 rigs, and what do they have in common? They're the same exact rig, but here is where the problem lies. When I switch the run animation to the walk animation, the walk animation moves weirdly. This is because both rigs have a different rest pose. Here's another thing, they were exported from C4D. So, I am not sure if it's a setting that is affecting the armature settings. Also, the mesh is also affected with the armature to be shaped as the rest pose of the rigs, so there is no T-pose on those meshes on the rigs.

You can see on the forth photo that I am in edit mode, and that its rest pose.

I do have the rig with it's original T-pose, so I don't know that is needed for this case. But if anyone can help me find a solution to this, that would be great because I have other rigs that have the same problem.

enter image description here

enter image description here

enter image description here

enter image description here

UPDATE: IT WORKED! The new constraint method below turned out to work as intended than the Copy Global Transform! Just follow the instructions, after doing the script, export as FBX, re-import the FBX,find and link the animation that works perfectly on the rig that has the T-pose, delete the other rigs except the one with the T-Pose, delete the unwanted animations, repeat for other animations, and that's it!

$\endgroup$
12
  • 1
    $\begingroup$ If your 2 armatures have a different rest pose, you won't be able to swap the actions $\endgroup$
    – moonboots
    Sep 7, 2023 at 9:42
  • $\begingroup$ I already know that. That doesn't answer my question... $\endgroup$
    – TheOrcaYT
    Sep 7, 2023 at 10:07
  • $\begingroup$ You also say that the mesh is not aligned with the armature, but even if you fix that by changing the armature or the mesh default pose, it won't fix the fact that you can't swap the actions $\endgroup$
    – moonboots
    Sep 7, 2023 at 10:29
  • $\begingroup$ A thing that you could do is changing the default mesh pose so that it matches the default rest pose of your armature $\endgroup$
    – moonboots
    Sep 7, 2023 at 10:30
  • $\begingroup$ How can I do that if you say that? $\endgroup$
    – TheOrcaYT
    Sep 7, 2023 at 10:35

1 Answer 1

0
$\begingroup$

Two methods I know: Copy Global Transform addon, and Constraints.

Copy Global Transform

(doesn't seem to work in your case, but could in others)

If the armatures have the same bone names and dimensions, you could try using the Copy Global Transform addon.

It is shipped with Blender, you just need to enable it via the menu Edit > Preferences > Addons tab

enter image description here

The addon's UI will be located in the viewport > Sidebar > Animation tab > Global Transform panel

enter image description here

Then, select both rigs in object mode, ↹ Tab into pose mode, and select all the bones of one rig. Copy the pose. Then select the other rig's bones and paste using the addon's panel. Hopefully it pastes the pose correctly, and you can repeat for each frame.

Constraints

In the armature you want to copy the animation in, you could select each bone one by one in pose mode and add a Copy Transform constraint targeting the source armature's same bone.

Then, you can use Pose > Animation > Bake Action with visual keying and clear constraints ON:

enter image description here

Adding constraints to each bone can be time-consuming, so here's a script that does it for you.

Select the armature you want to copy the animation to, and ↹ Tab into Pose Mode. You just have to paste the following script in the Script editor, make sure to write the name of the armature you want to copy from in the ARMATURE_SOURCE variable lines 4 between the simple quotes at the end. Here I used 'Armature'.

Then run the script with ⎇ AltP.

import bpy

# Get references to the 'Armature' and 'TPose' armatures
ARMATURE_SOURCE = bpy.data.objects['Armature']
ARMATURE_TARGET = bpy.context.active_object

# Initialize a count for bones with no equivalents
no_equivalent_count = 0

# Loop through all bones in 'ARMATURE_TARGET' armature
for bone in ARMATURE_TARGET.pose.bones:
    # Check if there's a bone with the same name in 'ARMATURE_SOURCE'
    if bone.name in ARMATURE_SOURCE.pose.bones:
        # Remove all constraints from the bone to avoid redundance and potential issues:
        for constraint in bone.constraints:
            bone.constraints.remove(constraint)
        
        # Create a Copy Transforms constraint and set the target bone
        constraint = bone.constraints.new(type='COPY_TRANSFORMS')
        constraint.target = ARMATURE_SOURCE
        constraint.subtarget = bone.name  # Use the same bone name as the target
        print(f"Constrained '{bone.name}' to its equivalent in '{ARMATURE_SOURCE.name}'.")
    else:
        # If no equivalent bone is found, print a message and increment the count
        print(f"No equivalent bone found for '{bone.name}' in '{ARMATURE_SOURCE.name}'.")
        no_equivalent_count += 1

# Print the count of bones with no equivalents
if no_equivalent_count <= 1:
    print(f"Number of bones with no equivalents: {no_equivalent_count}")

$\endgroup$
1
  • 1
    $\begingroup$ This constraint method did the trick! Thanks @L0Lock! $\endgroup$
    – TheOrcaYT
    Sep 13, 2023 at 6:49

You must log in to answer this question.

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