Driving an object along mesh using geometry constraint and motion paths (Performance issues)

45 views
Skip to first unread message

Toby Rutter

unread,
Sep 22, 2016, 6:59:55 AM9/22/16
to Python Programming for Autodesk Maya
I'm working with some animators who are currently doing a lot of multi vehicle animations. In order to save some time we are currently creating a motion path curve for each vehicle and using the U value to set the position of a locator along the curve. Through a series of offsets this locator is then geoemetry constrained/normal constrained to a proxy version of the environment. This is a pretty ideal way for the animators to work with the slight problem that the frame rate in the scene and playback is horrendously slow.

I was wondering if anyone had any experience doing something similar or any suggestions of a more performative way of doing this. I don't really have the time/experience with the C++ api to write something like this from scatch.

Any advice would be appreciated, thanks in advance.

Marcus Ottosson

unread,
Sep 22, 2016, 7:55:17 AM9/22/16
to python_in...@googlegroups.com
The geometry constraint is slow, but more importantly it is *non-deterministic* - as in, it could produce different results across multiple runs, without telling you about it.

As a solution to both this and your performance concerns, I might recommend using a pointOnSurface, follicle, or something like it, to constrain your wheels. As each wheel has a fixed offset from the ground (i.e. the radius), you could simply constrain the transform and offset it by this value. Performance, especially when using a follicle, should barely be affected.

I did this once in the past on wheels for a series of bicycles. If you are also looking to have your wheels deform on ground contact, you could simply offer the animator an "offset to the offset" where this delta is connected to a deformer of sorts - such as a child lattice of each wheel.

Toby Rutter

unread,
Sep 22, 2016, 8:24:08 AM9/22/16
to Python Programming for Autodesk Maya
Thanks for the suggestion Marcus that sounds ideal. We've been using an additional point constraint to the motion path to remove the non-deterministic element of the geometry constraint, needless to say its dirty hack.

Marcus Ottosson

unread,
Sep 22, 2016, 8:35:20 AM9/22/16
to python_in...@googlegroups.com
No problem!

As an alternative, if you or your animators find motion paths too restrictive, consider projecting a rectangular, 4-vertex plane onto the ground, and have each wheel follow each vertex. The projection would handle keeping wheels on the ground, and the animator would no longer be restricted to the motion path. Projection can happen via e.g. TransferAttributes, ShrinkWrap or the Python/API.

It's more complex in that you'll also need something to keep wheels from "strafing" - that is, moving sideways - but as I said, is an alternative to motion paths if motion paths is ever a problem.

Rémi Deletrain

unread,
Sep 22, 2016, 9:15:17 AM9/22/16
to Python Programming for Autodesk Maya
It's possible to work with projection --> https://vimeo.com/59896276.
I prefere to make node for that but it's possible to build in nodal.

with point on mesh/surface you have your plane projection oriented from normal.
with all intersection it's possible to calculate the reel pivot of your vehicul. And for more fun adapte with dynamics system for suspension (particle, jiggle, etc)
Reply all
Reply to author
Forward
0 new messages