Query distance between 2 objects

17 views
Skip to first unread message

Blackwell ST

unread,
Jan 2, 2021, 5:13:15 AMJan 2
to Python Programming for Autodesk Maya
Happy New Years!

I was wondering if anyone knew a method to query distance (positional/translation) between 2 objects. To be specific, I'm trying to query the distance between a CV point and the nearest vertice on selected mesh. Hope that makes sense. 


Jakob Kousholt

unread,
Jan 2, 2021, 7:15:53 AMJan 2
to python_inside_maya
Happy New Year!

The MfnMesh class has a method called getClosestPoint that sounds like what you are looking for.



Jake Kousholt  | Software Engineer / Pipeline TD


On Sat, 2 Jan 2021 at 05:13, Blackwell ST <gavin...@gmail.com> wrote:
Happy New Years!

I was wondering if anyone knew a method to query distance (positional/translation) between 2 objects. To be specific, I'm trying to query the distance between a CV point and the nearest vertice on selected mesh. Hope that makes sense. 


--
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/34ee98a8-7da2-4bb9-b156-3b7a0335d6a0n%40googlegroups.com.

Blackwell ST

unread,
Jan 2, 2021, 9:24:13 AMJan 2
to Python Programming for Autodesk Maya
Thanks a bunch Jakob!

The "mMesh.getClosestPoint" seemed to do the trick, I keep forgetting about OpenMaya's library, need to dive deeper into it.
Reply all
Reply to author
Forward
0 new messages