Beer glass scene creation
This course contains a little bit of everything with modeling, UVing, texturing and dynamics in Maya, as well as compositing multilayered EXR's in Photoshop.
# 1 15-04-2003 , 01:44 AM
Registered User
Join Date: Jun 2002
Posts: 2

Object placement on a curve no aninimation

I am currently working on a script where I place objects along a curve. This is not for animation, just placement on the curve.

Here is a snippet:

********************

float $pointOnCurve[] = `pointOnCurve -pr $tmp -p ($curveName[0])`;

move ($pointOnCurve[0]) ($pointOnCurve[1]) ($pointOnCurve[2]) ($nameObject[$temp-1]);

*******************

where $nameObject[] is the array containing the objects to be moved onto the curve.

My question is this---How do you get the objects to actually follow the curve, where rotation of object also goes with the curve, not just being placed on the curve?

Mabye this simple pic will clarify:

user added image

I basically want it to be like the "follow" commmand when attaching an object to a curve for animaion along the curve, however I don't want the animation.

Hope that's easy enough to understand.

thanks,
Nic

# 2 15-04-2003 , 05:25 AM
mark_wilkins's Avatar
Registered User
Join Date: Jan 2003
Posts: 161
You can get the tangent to the curve by calling pointOnCurve with a -t flag, then rotate the objects to orient with that tangent direction.

-- Mark


Mark R. Wilkins
author of MEL Scripting for Maya Animators
www.melscripting.com
# 3 16-04-2003 , 06:02 AM
Registered User
Join Date: Jun 2002
Posts: 2
thanks for the answer Mark. yeah I basically have been trying that and I at least have gotten the rotation working, using tangent constraint.

I actually saw something to that effect in your book with the helic particles around a curve. Great Book by the way, very helpful.

It works perfectly on a two dimensional curve, say in th xz plane, but when pulling up a point in the positive y direction it will cause the object to point outward(say down the z-axis, if the curve was made in the z direction).

-Is there anyway to force the object(say a cone) to remain pointing downward(down the y axis)?

thanks again,
Nic

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads