0

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!

TheOrcaYT
  • 3
  • 2
  • 1
    If your 2 armatures have a different rest pose, you won't be able to swap the actions – moonboots Sep 07 '23 at 09:42
  • I already know that. That doesn't answer my question... – TheOrcaYT Sep 07 '23 at 10:07
  • 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 – moonboots Sep 07 '23 at 10:29
  • A thing that you could do is changing the default mesh pose so that it matches the default rest pose of your armature – moonboots Sep 07 '23 at 10:30
  • How can I do that if you say that? – TheOrcaYT Sep 07 '23 at 10:35
  • You mean how to align the mesh with an armature rest pose? You can use the Pose brush in Sculpt mode for example – moonboots Sep 07 '23 at 10:38
  • or you can use its current armature to align its shape to the other armature's rest pose, then apply the armature modifier – moonboots Sep 07 '23 at 10:42
  • Here's the thing, the bones go in a different direction from the animation if I re-shape the position of the bones. – TheOrcaYT Sep 07 '23 at 13:59
  • I'm not sure what you've tried, you have different problems here, you need to tell precisely which problem you want to fix, I may be wrong but I doubt iyou'll be able to swap the actions as the 2 armatures have a different rest pose and the actions are made for each armature – moonboots Sep 07 '23 at 14:13
  • I recently tried using a script from here https://blender.stackexchange.com/questions/74672/two-armature-two-rest-pose-fixing-animations, but all it did was overwrite the other rig to be the same as the other rig, along with the animation being overwritten. – TheOrcaYT Sep 07 '23 at 21:30
  • Please consider sharing your file so that we can try things out directly in your particular situation. Make a file with just the rigs and models (remove the textures for speedy download) and sent id on Blend-Exchange and [edit] your post to add the provided download link. – L0Lock Sep 09 '23 at 18:09
  • @L0Lock the download link is posted above – TheOrcaYT Sep 10 '23 at 23:41

1 Answers1

0

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}")

L0Lock
  • 15,965
  • 1
  • 20
  • 44