PDA

View Full Version : Position one motionpath a specific arclength from another motionpath


gmask
11-09-2011, 03:27 AM
I'm trying to figure out how to place a second motion path to follow the first one a specific arclength behind another locator that is constrained to a motionPath.

It seems like this should be possible.. so far the only solution I have found is this...

http://xyz2.net/mel/mel.108.htm

I'm not satisfied with the iterative nature of this and hope there is something more direct where I establish a certain distance (arclength) and come up with a u value that I can feed into the second motion path.


Offsetting the just the u value with a static value in an expression won't work because the timing and chord length will change the arcLength spacing between the two locators.

WesHowe
11-09-2011, 04:51 AM
I am still not quite certain about your distance behind criteria, but you could use a single expression to drive both locators. Expressions can be driven on a time change, so they do not always require a lot of horsepower, and you can drive objects with direct attribute references or through setAttr(), Maya will translate the direct attribute references (e.g. locator1.translateX) into connections automatically.

The pointOnCurve() function will give you the position (or the normal/tangent) along a curve given the fractional position desired (such as 0.5 for halfway); arcLen() will give you the overall curve length. If you wanted the second locator one-eighth of the curve behind the first, you would use 0.125 less for the value you feed to pointOnCurve, then use setAttr() (or a direct locatorN.translate connection) to move both locators to their new positions.

<* Wes *>

gmask
11-09-2011, 04:40 PM
I am still not quite certain about your distance behind criteria, but you could use a single expression to drive both locators. Expressions can be driven on a time change, so they do not always require a lot of horsepower, and you can drive objects with direct attribute references or through setAttr(), Maya will translate the direct attribute references (e.g. locator1.translateX) into connections automatically.

As I described in my first post this will not work as it will not maintain a consistent distance between the two motionPath constrained objects.

Keep in mind that the path they are constrained to is being deformed as well so if it's overall arcLength changes then the spacing between the two motionPaths will change doing it the way you suggest which is not what I want.

Anywho I think I've come up with a solution which is to take a curve that represents the fixed distance I want between the two points and run it through a flow path.

CGTalk Moderation
11-09-2011, 04:40 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.