Hey Marcus,
thank you for the heads up about the extract markers tool.
Anyway I would like giving you a background of the situation: basically we have some shots where there are from 40 to 200 rigs (it depends from the shot) and all those are driven by the ragdoll system; so after a quick test by our artists, we would like to send that scene in farm in order (as I already said in the previous post) to speed up the simulation and baking processes.
We’ve already developed a simple batch script where we use the ragdoll api/interactive/recording modules to reproducing what the Record Simulation does:

but seems like every time we run a different type of record in batch, something just go wrong, and if we run the same code in maya (interactive mode) everything it’s just fine and we are able to run a record and bake the recorded simulation on rigs controls.
For example what you said about the Extract Marker it was working for us since we were trying to bake controls with the maya command cmds.bakeResults… on that time the process seems like frozen and it won’t continue (again this issue appears only in batch mode).
I’ve also noticed that sometimes maya session just crash when we try to api.deleteAllPhysics after ragdoll system has been simulated and transferred to the rigs (I’m not sure if this will help you).
And related to this if we commented out the delete function, the script seems working fine without any crash but after we open up the saved scene with the simulated ragdoll physics those ones just go crazy and explode during the playback.
Here the related script we would like to use:
# Standard modules
import sys
import os
import traceback
# External modules
import maya.standalone
from maya import cmds
from sys import argv
maya.standalone.initialize(name="python")
def main(maya_scene_filepath, ragdoll_solver, frame_start, frame_end, final_scene_path):
""" Main function to export .abc animation cache.
Raises:
RuntimeError: if export .abc fails
"""
try:
cmds.loadPlugin('ragdoll')
from ragdoll import api, interactive, recording
from ragdoll.vendor import cmdx
print('')
print('# ---> Opening maya scene - {}'.format(maya_scene_filepath))
cmds.file(maya_scene_filepath, open=True, force=True)
cmds.playbackOptions(edit=True, maxTime=frame_start, minTime=frame_end)
# api.recordPhysics(solver=ragdoll_solver, opts={'start_time': frame_start, 'end_time': frame_end})
# api.recordPhysics(solver=ragdoll_solver, opts={'startTime': frame_start, 'endTime': frame_end, 'includeKinematic': True})
# interactive.extract_markers(ragdoll_solver, {'markersExtractAndAttach':True})
# interactive.record_markers(ragdoll_solver)
print('')
print('# ---> Setting current time to {}...'.format(frame_start))
cmds.currentTime(frame_start, edit=True)
print('')
print('# ---> Selecting the Ragdool Solver node...')
cmds.select('|ragdoll_grp|rSolver|rSolverShape')
api.recordPhysics(solver='|ragdoll_grp|rSolver|rSolverShape', opts={'start_time': frame_start, 'end_time': frame_end})
# cmds.select(clear=True)
print('')
print('# ---> Deleting all Ragdoll Physics nodes...')
# api.deleteAllPhysics()
print('# ---> Saving the scene: {} ...'.format(maya_scene_filepath))
# file_manager.save_file(maya_scene_filepath)
cmds.file(rename=maya_scene_filepath)
cmds.file(save=True, type='mayaAscii')
print('# ---> Done...')
return True
except:
traceback.print_exc()
raise RuntimeError
if __name__ == "__main__":
maya_scene_filepath = sys.argv[1]
ragdoll_solver = sys.argv[2]
frame_start = int(sys.argv[3])
frame_end = int(sys.argv[4])
final_scene_path = sys.argv[5]
main(maya_scene_filepath, ragdoll_solver, frame_start, frame_end, final_scene_path)
maya.standalone.uninitialize()
One more question… what do you mean with Marker Untargeted? Should we pass all the markers DagObject to the extract_markers function? Because as far as I can see from the ragdoll’s python scripts, it needs just the solver and then everything will be extracted.
Thanks in advance for you help.