thanks vince, and that code was from the example I was building from...and I had changed it to not be list in mine, but was running into the same error
On Fri, Jun 18, 2021 at 9:32 AM vince touache <fruityfr...@gmail.com> wrote: > 1. don't override python keywords (e.g. "list") > 2. are you stuck to api1 or is that ok to use api2? > 3. Provide dag path instead of mobjects to your function sets if you can, > that'll let you work with world space > > Then, you could start with something like this (api2): > fnSphere = > MFnMesh(MGlobal.getSelectionListByName('pSphereShape1').getDagPath(0)) > u, v = 0.52, 0.52 > polyIds, positions = fnSphere.getPointsAtUV(u, v, tolerance=0.00001) > it = MItMeshPolygon(fnSphere.object()) > it.setIndex(polyIds[0]) > it.getVertices() > > I'm sure there are faster ways to do it, by working with triangles and not > poly all the way long, but can't retreive the command off top of my head. > But this should give you a good starting point already > > Le jeudi 17 juin 2021 à 20:13:56 UTC-4, todd.wi...@gmail.com a écrit : > >> ok so on this....I have my UV coord, there is no function for converting >> that to a face and the examples im finding ONLY cover using a map ID not a >> random UV position, additionally, the code example actually doesnt even work >> >> >> import maya.cmds as cmds >> import maya.OpenMaya as OpenMaya >> >> list = OpenMaya.MSelectionList() >> sphereName = "pSphereShape1" >> planeName = "pPlaneShape1" >> >> list.add(sphereName) >> list.add(planeName) >> >> sphereObj = OpenMaya.MObject() >> planeObj = OpenMaya.MObject() >> >> list.getDependNode(0, sphereObj) >> list.getDependNode(1, planeObj) >> >> sphereMesh = OpenMaya.MFnMesh(sphereObj) # errors out here with # >> RuntimeError: (kInvalidParameter): Object is incompatible with this method >> # >> planeMesh = OpenMaya.MFnMesh(planeObj) >> >> >> On Thu, Jun 17, 2021 at 2:59 PM Todd Widup <todd....@gmail.com> wrote: >> >>> that would work :) >>> wasnt thinking about getting faces >>> >>> >>> On Thu, Jun 17, 2021 at 2:46 PM vince touache <fruit...@gmail.com> >>> wrote: >>> >>>> you can get the polygon (as in "the face") at a given u and v, and from >>>> the polygon, you query the vertices. Once there, you can get the >>>> skinweights and barycentric. Or am I missing something? >>>> >>>> Le jeudi 17 juin 2021 à 17:43:25 UTC-4, todd....@gmail.com a écrit : >>>> >>>>> lol what I meant is how can you query the weight if given the UV >>>>> position? >>>>> >>>>> On Thu, Jun 17, 2021 at 2:26 PM vince touache <fruit...@gmail.com> >>>>> wrote: >>>>> >>>>>> I believe maya is using barycentric coordinates, that would be an >>>>>> easy way of doing what you need (although the "UVs" part is not >>>>>> mandatory) >>>>>> >>>>>> Le jeudi 17 juin 2021 à 17:25:14 UTC-4, todd....@gmail.com a écrit : >>>>>> >>>>>>> hey all, any good way of getting skin weights at a UV position (not >>>>>>> a vtx) in python? >>>>>>> >>>>>>> -- >>>>>>> Todd Widup >>>>>>> Creature TD / Technical Artist >>>>>>> todd....@gmail.com >>>>>>> >>>>>> -- >>>>>> 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/9364d2d3-6100-4aac-b7a7-d81d01a78fd9n%40googlegroups.com >>>>>> <https://groups.google.com/d/msgid/python_inside_maya/9364d2d3-6100-4aac-b7a7-d81d01a78fd9n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>> . >>>>>> >>>>> >>>>> >>>>> -- >>>>> Todd Widup >>>>> Creature TD / Technical Artist >>>>> todd....@gmail.com >>>>> >>>> -- >>>> 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/b965c34d-a1de-4ed6-af53-32e4d1c32973n%40googlegroups.com >>>> <https://groups.google.com/d/msgid/python_inside_maya/b965c34d-a1de-4ed6-af53-32e4d1c32973n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> >>> >>> -- >>> Todd Widup >>> Creature TD / Technical Artist >>> todd....@gmail.com >>> >> >> >> -- >> Todd Widup >> Creature TD / Technical Artist >> todd....@gmail.com >> > -- > 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_maya+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/d3b11a45-0cbf-4d77-9ab0-df3f292ea431n%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/d3b11a45-0cbf-4d77-9ab0-df3f292ea431n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Todd Widup Creature TD / Technical Artist todd.wi...@gmail.com -- 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_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CABBPk36i%2Bmz5JFmo8x%2Byi-rdM-6iEumFd3_pDzqQ-EortN1c4Q%40mail.gmail.com.