Import/export Physics between different characters

Hi!

I got a ragdoll setup that I’m pleased with, and I can smoothly import/export that setup in and out of different animscenes. Now, I also hoped that I would be able to use that same setup on a different (but very similar) character. They are both created with Advanced Skeleton, so the naming conventions should be identical between the two characters. Since they are so similar, and that only the geo and namespaces are different, I was hoping to use search and replace in order to get the same setup to work on my other character.

When importing physics, it appears to find some of the targets when I search-and-replace Winston for Donovan. However, Ragdoll doesn’t find all of them. What am I doing wrong here? It should be possible to do something like this, right?

Here’s a preview example of one of the targets Ragdoll can’t find:

|SK_T1_Winston_01_Rig|DeformationSystem|Root_M|Spine1_M|Chest1_M|Scapula_L|Shoulder_L

:donovan:|:donovan:SK_T1_Donovan_01_Rig|:donovan:DeformationSystem|:donovan:Root_M|:donovan:Spine1_M|:donovan:Chest1_M|:donovan:Scapula_L|:donovan:Shoulder_L

Thanks!

Also, if I messed something up early when setting this up - is it possible to somewhat salvage the setup and re-export it to make this work?

This should be possible, yes. The challenge in your case is the naming convention and lack of ability to use the Match By: Name option. Because you are matching by hierarchy, the hierarchy needs to match exactly, which can be tricky.

Are you able to alter the naming convention at all? Such that your controls have a different suffix, such as _ctl? That should root out the issue with using the Name option and should work better when transferring between characters.

If you aren’t able to control the auto-rigging process, then manually adding a suffix to your controls after the auto-rigger should work too.

Here is a script you could use to automatically add a suffix to selected controls.

from maya import cmds

suffix = "_ctl"
selection = cmds.ls(selection=True, long=True)

# Rename deepest controls first, to avoid paths
# from changing when parent is renamed.
selection = sorted(selection, key=lambda sel: sel.count("|"), reverse=True)

for control in selection:
    name = control.rsplit("|", 1)[-1]
    cmds.rename(control, name + suffix)

If this isn’t an option, let me know and I’ll try and think of something else!

Hi Markus,

Thank you for getting back to me!

Renaming the controls (and certain joints) did the trick. Your script was very helpful with that. This allowed me to export/import the physics to the same character with “Match By: Name”. It took some trial and error, but I could pinpoint troublesome joints/ctrls by toggling between Match by: Name/Hierarchy.

Hopefully this will allow me to transfer the setup between rigs, once I’ve added the same suffix to the other rigs. I haven’t tried that yet though - will update the thread later if it works!

Thanks!

1 Like

Follow up:

This method worked great, and I was able to transfer the setup between two different characters (as long as the ctrls/jnts names matched. Massive timesaver.

Thanks a bunch Marcus!

1 Like

Great news, thanks for following up!