SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Animation / Mel Scripts & Programming / Object placement on a curve no aninimation
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 15-04-2003, 01:44 AM   #1
nix21
Registered User
 
Join Date: Jun 2002
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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:



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
nix21 is offline   Reply With Quote
Old 15-04-2003, 05:25 AM   #2
mark_wilkins
Registered User
 
mark_wilkins's Avatar
 
Join Date: Jan 2003
Posts: 161
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
mark_wilkins is offline   Reply With Quote
Old 16-04-2003, 06:02 AM   #3
nix21
Registered User
 
Join Date: Jun 2002
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
nix21 is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.