Locomotion issues (pathing and crashing)

Hi, I’ve been having some trouble with locomotion I’m not sure if there are any known issues with it but one thing I’m noticing is on this six-legged example when I try to set a straight trajectory from the start pose to the locator, regardless of how I do my step sequence by the time I add steps to the last leg I end up with a strange side deviation on the trajectory. There is no rotation between the start and end, the steps are all very regular and alternated, so it should be a straightforward walk, yet I end up with this result every time.

Additionally, for some reason, it worked on some earlier tests but I would get crashes when trying to use plan to animation. I saved my scene before trying, but when I reopened it would be as if the whole thing got corrupted and gives me error messages when I try again. I ended up having to delete everything and start from scratch a few time and always ran into similar issues. Then eventually I also ran into the wonky trajectory issues.

This is what shows up in the script editor:

from locomotion import interactive as ri
ri.plan_to_animation()
# Warning: ragdoll.format_exception_wrapper() - Traceback (most recent call last):
#   File "C:\Users\Humanoide\Documents\maya\modules\Locomotion-2023_11_20\scripts\locomotion\interactive.py", line 145, in format_exception_wrapper
#     return func(*args, **kwargs)
#   File "C:\Users\Humanoide\Documents\maya\modules\Locomotion-2023_11_20\scripts\locomotion\interactive.py", line 862, in plan_to_animation
#     start, end, dsts = recording.plans_to_animation(plans)
#   File "C:\Users\Humanoide\Documents\maya\modules\Locomotion-2023_11_20\scripts\locomotion\internal.py", line 507, in _undo_chunk
#     return func(*args, **kwargs)
#   File "C:\Users\Humanoide\Documents\maya\modules\Locomotion-2023_11_20\scripts\locomotion\recording.py", line 301, in plans_to_animation
#     start_frame, end_frame, dst_to_out = extract_plans(plans)
#   File "C:\Users\Humanoide\Documents\maya\modules\Locomotion-2023_11_20\scripts\locomotion\internal.py", line 507, in _undo_chunk
#     return func(*args, **kwargs)
#   File "C:\Users\Humanoide\Documents\maya\modules\Locomotion-2023_11_20\scripts\locomotion\recording.py", line 280, in extract_plans
#     mod.set_attr(out["tx"], trajectory["tx"])
#   File "C:\Users\Humanoide\Documents\maya\modules\Locomotion-2023_11_20\scripts\locomotion\vendor\cmdx_locomotion.py", line 5710, in decorator
#     return func(self, *args, **kwargs)
#   File "C:\Users\Humanoide\Documents\maya\modules\Locomotion-2023_11_20\scripts\locomotion\vendor\cmdx_locomotion.py", line 6269, in setAttr
#     result = _python_to_mod(value, plug, self._modifier)
#   File "C:\Users\Humanoide\Documents\maya\modules\Locomotion-2023_11_20\scripts\locomotion\vendor\cmdx_locomotion.py", line 5326, in _python_to_mod
#     with DGModifier() as dgmod:
#   File "C:\Users\Humanoide\Documents\maya\modules\Locomotion-2023_11_20\scripts\locomotion\vendor\cmdx_locomotion.py", line 5781, in __exit__
#     commit(undoit, redoit)
#   File "C:\Users\Humanoide\Documents\maya\modules\Locomotion-2023_11_20\scripts\locomotion\vendor\cmdx_locomotion.py", line 8331, in commit
#     getattr(cmds, unique_command)()
# AttributeError: module 'maya.cmds' has no attribute 'cmdx_0_6_3_command'

Occasionally when trying to assign plan I also get this warning:

// Warning: Disabling rPlan_bodyCubeShape due to missing targets.

Hi @g6k, sorry to hear you are having issues with Locomotion! We’ve also spotted the issue with cmdx_0.6_3_command recently and have a fix locally that I’ll make a release of in the next few days.

It’s semi-harmless and can be solved by (1) unloading and (2) loading the cmdx_locomotion.py plug-in from Maya’s plug-in manager.

Are you able to send a scene with the problem in it? We can take a look as soon as possible.

Hm, we better take a closer look. If you can send the file that you cannot open, that would help narrow it down.

Locomotion_Fwd.zip (13.8 KB)
I’ve attached the file for you. Please note that I’ve omitted the referenced rig due to NDA restrictions, but the problem appears to persist, so I hope you can still diagnose it effectively. As an additional point, I transferred the license to another computer to test if the issue was consistent and found that it functioned correctly there (using the same starting file and version of Maya). This might be due to that machine running a slightly older version of Ragdoll. Consequently, it seems the problem might be specific to my setup or related to a more recent version of the software. I believe my laptop, which is experiencing these issues, is running the latest version.

Start_Loco.zip (12.0 KB)
I’m also including an older file version where I initially succeeded in executing the straight path, but then encountered a crash. Given the known issue with the cmdx_0.6_3_command , I think I may have pinpointed a contributing factor to the crashes. Initially, I couldn’t assign the path, so I attempted to set an environment, which resulted in the solver being created in the scene. This action might have reloaded the plugin in some way, subsequently allowing the use of locomotion. However, when I utilize the ‘plan to animation’ function with the solver active in the scene, as in the attached file, maya invariably crashes. Removing the solver seems to resolve the crashing issue.

Thanks, I found the issue.

For starters, when the result is “Not Ideal” then it cannot be trusted. It means some rule was broken, like limits or gravity or contacts with the ground. I found that if I increase the number of iterations to 100, it eventually does find something that obeys the rules.

But it’s still sideways. I found that this was because this was the quickest way for it to reach the destination, given the limits. If we increase the limits, it’s able to take longer steps and therefore finds a quicker path by moving in a straight line.

This is ultimately what the solver is trying to do. To find the most optimal way to follow that path, given the limits, mass and contacts. It’s not always obvious which rule is broken, but limits is especially common and something to look out for. Try making the limits even narrower, and you’ll find it tries its best to get to the destination in various other “creative” ways.

This really shouldn’t cause a crash. The error happens when Ragdoll/Locomotion tries storing your latest command for undo. With this error, it means the command cannot be undone.

I’m able to call Plan to Animation in this other file.

To double-check, can you open this same file and try the command? It would rule out an issue with Ragdoll versus the other parts of your scene.

Thank you for all the details. For some reason on my other computer, it managed to find a straight path with very similar settings, but it is possible I didn’t use the same limits and distance, so I’ll have to test between changing some of my settings and the two different setups. On the laptop, I was in the middle of editing another file so I reopened Start_Loco and tried using “plan to animation” on the file. I got no crash either this time which surprised me. To make sure the issue was completely gone I closed down this session of Maya and reopened the file in a fresh one, and this time got a crash again. I was able to reproduce this a couple of times.