Discussion:
[Maya-Python] Driving an object along mesh using geometry constraint and motion paths (Performance issues)
Toby Rutter
9 years ago
Permalink
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.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/ec44a892-05a9-4359-ba05-836c2a449834%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marcus Ottosson
9 years ago
Permalink
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.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCr20Jvq%3DZ0FCvgRoPT_BxVvanWyo2PEbDe6O2wHTj%2BtQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Toby Rutter
9 years ago
Permalink
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.
...
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/4db78a70-a56c-46e4-a2e5-fbd2edaa8509%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marcus Ottosson
9 years ago
Permalink
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.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOC0HAcuErr2VWJtO3JLF7BT6y7jdRgPz9p70ADA_cOOKw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Rémi Deletrain
9 years ago
Permalink
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)
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/9c27d308-3b41-480f-bbf1-d7ff3f2db371%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...