Snapping objects to curve

43 views
Skip to first unread message

yann19

unread,
Mar 21, 2019, 1:34:07 PM3/21/19
to Python Programming for Autodesk Maya
I am having some issues with 'snapping' geometries onto a curve.

The 'snapping' does seems to work, however, the spacing between objects are not what I am expecting.
I am guessing that I may have miss out on something..

I have attached some screenshots for better clarity:

org.jpg

(The curve is flat on the surface, but eventually I am planning to conform the curve such that it has 'depth' eg. on a terrain)

This is the result I got after running my code:

result.jpg


and this is what I am expecting to achieve:

expected_output.jpg



My code is over here: https://pastebin.com/raw/xTz6ACJv

Marcus Ottosson

unread,
Mar 21, 2019, 7:35:56 PM3/21/19
to python_in...@googlegroups.com
The spacing is determined by the "parameter range" of your NURBS curve, which is normally evenly distributed between 0-1. Try running "Rebuild" on your curve to reset that range.

--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/47f3f23c-c8c1-4113-8e1b-c88b049b23af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sumant shenoy

unread,
Apr 9, 2019, 10:50:01 AM4/9/19
to Python Programming for Autodesk Maya
https://www.highend3d.com/maya/script/snap-box-for-maya 
https://vimeo.com/48469167
i created this tool some time ago it may help i used some basic math to get values just look at the script .hope it helps 

Jason Brummett

unread,
Apr 9, 2019, 1:03:36 PM4/9/19
to python_in...@googlegroups.com
Just use mash curve node? or parametrize curve from 0-1 or length as suggested.  Only other trick is to make a curve an underworld node but doesn't really help with spacing more than rebuilding.

--
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_m...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages