query a vertex's world position in runtime


#1

hello, i am looking for a node(plugin or script) that query a mesh’s vertices and output them as vector that has world translation values…something like

mesh -> theNode -> output the XYZ world values as vector

this should work in runtime as i need this to output a deforming mesh’s vertex translation info. i need this for setting up some locators on a mesh, so that it still stick even when the mesh is deforming.

i can write this very plugin in the future, but not now, i am still fresh into the Maya Python API…but if somebody can guide me into the right direction then this would be great. thank you very much.


#2

i am currently looking into some solutions available in highend3d. a few looks to be what i am looking for, i shall share it here when i get what i want…now, polyEvaluate seems to be the closest thing that i can find in the commands reference, at the moment, i cannot find anything that says that it will output a mesh’s word position coordinate…

the MltMeshVertex class will do i think, all i need to do is learn how to use this with my beginner API skills…hoping for guidance


#3
vector worldPos[] = `xform -q -ws -t pSphere1.vtx[259]`;

xform is slow so I hope that’s not the backbone of anything you’re doing.

edit: if you’re going to use some kind of stick to geometry tool, I’d go for follicles (you must have non overlapping UVs) http://www.creativecrash.com/maya/downloads/scripts-plugins/polygon/c/djrivet-mel--3 or the old rivet tool bound to edges, but that was a pain.

There’s also pointOnPoly constraint (is it new?), but I’ve never used it.


#4

BernieBernie, Thank you very much. Point on poly may be what I was looking for, however, we are using an older version of Maya that may not support this, but I can check anyway.

I will have quite a bit of controls that will use this thing. so it may get slow. will the output of the xform be query-able in runtime? Thanks, I shall try your suggestions.

No experience with follicles yet, even though these thing has been around for years, this can be a good chance. Thanks again


#5

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.