Issue sending simulation in batch mode

I’ve had a look, and have a few observations.

  1. It appears you are on Maya 2022.0, which means you are struck by the bug which prevents you from deleting markers. Simply not deleting them will circumvent this, although this version of Maya likely has a number of other issues so I would suggest moving to 2022.1 or above.
  2. The version of Ragdoll is 2022.11.20, we cannot support versions other than the currently latest version

I wasn’t able to open the file with 40 referenced characters, but I was able to open the original file and noticed that the default Import Physics option of Match By: Name struggles to find matching names in this rig, similar to this issue:

If you use Import Physics, try the alternative Match By: Hierarchy instead, that seemed to do the trick.

Otherwise you may end up with errors like these when recording, because it tries to retarget onto the wrong controls.

UnboundLocalError: local variable 'connections' referenced before assignment

Apart from that, I was unable to reproduce the issue. Here’s a reproducible of what works on this end, can you confirm? I assigned a few markers and made a new .rag file to import into the animation scene, which is how I believe you have also done since there was no physics in the rig file. Let me know otherwise.

bear.zip (48.5 KB)

import os
from maya import standalone
standalone.initialize()

from maya import cmds
cmds.file(new=True, force=True)

rigfname = "/path/to/chr_buddybuddy_eva_rig_v014.ma"
cmds.file(rigfname, reference=True, namespace="_")

cmds.loadPlugin("ragdoll")
from ragdoll import api
ragfname = "/path/to/bear.rag"
api.reinterpretPhysics(ragfname, opts={"matchBy": api.MatchByHierarchy})

# To create some interesting motion
con = api.create_pin_constraint("rMarker_c_head_01_bind_jnt")
cmds.setAttr(con + ".linearStiffness", 0.05)  # Translate Stiffnessv

solver = cmds.ls(type="rdSolver")[0]
api.recordPhysics(solver, opts={"startTime": 0, "endTime": 20})

api.deleteAllPhysics()

outfname = os.path.dirname(rigfname)
outfname = os.path.join(outfname, "newScene.ma")
cmds.file(rename=outfname)
cmds.file(save=True, type="mayaAscii")

print("Successfully saved simulated file @ %s" % outfname)