CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 09-17-2013, 04:35 PM   #1
mlager8
Lord of the posts
 
mlager8's Avatar
portfolio
Matthew Lager
3D artist
Oceanside, USA
 
Join Date: Nov 2008
Posts: 875
snap object to every vertex?

Is there a way to snap an object to every vertex of a model? Basically I need to snap a smoothed cube to every vertex of a ribbon to give it a beaded grip look. I have absolutely no mel experience whatsoever but was hoping someone here could help me out a bit
__________________

 
Old 09-17-2013, 06:27 PM   #2
Argiri
SuperDeeg
 
Argiri's Avatar
portfolio
Anargyros Kotsaris
USA
 
Join Date: May 2013
Posts: 68
If understood correctly this should help out. It's Python but it should get the job done. Just select the object you want snapped to the verts, then select the target object, then run the script.

Code:
from pymel.core import * obj, target = selected() for v in target.vtx: dupObj = duplicate(obj)[0] dupObj.t.set(pointPosition(v))


Let me know if this worked for you!
 
Old 09-17-2013, 06:52 PM   #3
mlager8
Lord of the posts
 
mlager8's Avatar
portfolio
Matthew Lager
3D artist
Oceanside, USA
 
Join Date: Nov 2008
Posts: 875
worked like a charm! Thanks a ton, saved me a lot of time today!
__________________

 
Old 10-09-2013, 01:24 AM   #4
strarup
Know-it-All
 
strarup's Avatar
Alex V. U. Strarup
R&D
Denmark
 
Join Date: Jan 2003
Posts: 382
Hi,

on the second page of this thread, are some mel scripts, on how to snap/constraning something to vertices. :-)
http://forums.cgsociety.org/showthr...87&page=2&pp=15

if you e.g. will have it to follow the vertices in a animation. not sure if it will be helpful in your request. :-)


kind regards

Alex
__________________
Alex V. U. Strarup
Mel script monkey
Facebook LinkedIn


one mistake can ruin it all... :)
 
Old 10-09-2013, 01:24 AM   #5
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 03:49 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.