Error When Recording

Howdy! One of my animators got a new error when trying to record their ragdoll. The recording process appeared to go as normal- it ran through the animation twice, caching as it went. But when it ended a new rSolver anim layer wasn’t created, and this error popped up:

Traceback (most recent call last):
  File "C:\Users\animator\Documents\maya\modules\Ragdoll-2024_07_01\scripts\ragdoll\interactive.py", line 159, in format_exception_wrapper
    return func(*args, **kwargs)
  File "C:\Users\animator\Documents\maya\modules\Ragdoll-2024_07_01\scripts\ragdoll\interactive.py", line 2264, in record_markers
    result = _constraint_record_markers(solver, **opts)
  File "C:\Users\animator\Documents\maya\modules\Ragdoll-2024_07_01\scripts\ragdoll\interactive.py", line 2303, in _constraint_record_markers
    for step, progress in instance.record():
  File "C:\Users\animator\Documents\maya\modules\Ragdoll-2024_07_01\scripts\ragdoll\recording.py", line 355, in record
    marker_to_joint = _generate_kinematic_hierarchy(self._solver)
  File "C:\Users\animator\Documents\maya\modules\Ragdoll-2024_07_01\scripts\ragdoll\recording.py", line 1158, in _generate_kinematic_hierarchy
    recurse(mod, root)
  File "C:\Users\animator\Documents\maya\modules\Ragdoll-2024_07_01\scripts\ragdoll\recording.py", line 1142, in recurse
    recurse(mod, child, marker)
  File "C:\Users\animator\Documents\maya\modules\Ragdoll-2024_07_01\scripts\ragdoll\recording.py", line 1142, in recurse
    recurse(mod, child, marker)
  File "C:\Users\animator\Documents\maya\modules\Ragdoll-2024_07_01\scripts\ragdoll\recording.py", line 1142, in recurse
    recurse(mod, child, marker)
  [Previous line repeated 2 more times]
  File "C:\Users\animator\Documents\maya\modules\Ragdoll-2024_07_01\scripts\ragdoll\recording.py", line 1123, in recurse
    if not _is_enabled(marker):
  File "C:\Users\animator\Documents\maya\modules\Ragdoll-2024_07_01\scripts\ragdoll\recording.py", line 1099, in _is_enabled
    return cmds.ragdollInfo(str(marker), enabled=True, query=True)
  File "<string>", line 2, in ragdollInfo
RuntimeError: Maya command error

Their recording settings were:
-Record range: playback range
-Euler
-From Start
-Additive
-Record to layer True
-Set Initial Key True
-Accumulate by layer True
-Update viewport True
-Nice and Steady
-Constraints

What does this error mean? Thank you!

Hi @Hallie, let’s dive in.

The cause of the error looks to be from _is_enabled.

_is_enabled takes a Marker and produces a true or false depending on whether it’s enabled. The check happens via a cmds.ragdollInfo() as opposed to just checking the Enabled attribute on the Marker, because a Marker can be indirectly disabled via its group or solver.

In this case, it looks like whatever got passed to cmds.ragdollInfo was not a valid Marker. So I’d have a look at what that may be, by calling the function using it manually a few times.

from ragdoll.vendor import cmdx
from ragdoll import recording

solver = cmdx.ls(type="rdSolver")[0]  # Assuming you only have 1 solver
recording._generate_kinematic_hierarchy(solver)

This should produce the same “Maya command error”, and happen instantly. It will produce a joint hierarchy in the same shape as the Marker hierarchy, they way they are connected to each other.

This is what that function looks like.

From here, I’d try disabling all Markers except the root, like the hip, and run it again. Keep enabling Markers until you find the culprit. If it’s not obvious why the culprit does what it does, do report back here and we’ll keep investigating. This shouldn’t happen regardless, so it’s something I’d like us to patch up if we can.

Thanks for the explanation! I’ll grab the scene from the animator and investigate today.
We were able to bypass the error by moving the animation to a fresh scene and ragdoll-ed rig, but I’ll still investigate in case it happens again in the future. I have a feeling the animator was poking around in places they shouldn’t have been :wink:

Been there. :slight_smile:

In that case, what could have happened is that a non-Ragdoll node was plugged into the rSolver.startState[]. It’s an array attribute with everything that belongs to the solver, it assumes all connections come from Ragdoll nodes, like Markers and groups. So it there’s anything there that shouldn’t be, this error could potentially happen. One way for that to happen is to manually plug something in, via e.g. the Node Editor.

1 Like

Alrighty I think I’ve (sorta) found the culprit. There wasn’t anything non-ragdoll related plugged into the rSolver.startState array, but there was a second rSolver in the scene with the jaw_rGrp somehow linked to it. Somehow the animator created a second rSolver and moved only the jaw_rGrp to it, but left the jaw_rMarkers on the first solver?? Using your script, when I re-enabled the jaw_rMarker is came back with the warning:

rMarker_Jaw_CON was not part of a valid solver

Clearly this scene has some funk in it lol.

Thank you for helping me troubleshoot! I enjoy reading errors and figuring them out :heart: